lecture 1 Flashcards
(67 cards)
What is an operating system (OS)?
Middleware between user programs and system hardware
What are the main components managed by an OS?
- CPU
- Main memory
- I/O devices (disk, network card, mouse, keyboard, etc.)
What is the purpose of an OS in terms of hardware abstraction?
The OS abstracts hardware details from the application
What does the program counter (PC) represent?
Address of the next instruction
What are condition codes used for?
Store status information about the most recent arithmetic operation, used for conditional branching
What is a process in the context of an OS?
A running program
What does the OS do when a program is run?
- Fetches instruction from memory
- Loads data into registers
- Decodes and executes the instruction
- Stores results to memory
What is the role of a device driver?
Talks the language of the hardware devices and issues instructions to devices
What are the design goals of an operating system?
- Convenience
- Efficiency of usage
- Isolation between multiple processes
What does a process consist of?
- Address Space
- One or more threads of control
- Additional system state
- Open files
- Open sockets
What is the difference between single-threaded and multithreaded processes?
Single-threaded has one thread of control, while multithreaded has multiple threads encapsulating concurrency
Why have multiple threads per address space?
- Parallelism
- Concurrency
What is the function of the OS in memory management?
Manages the memory of the process including code, data, stack, and heap
What is the significance of virtual addresses in a process?
Each process thinks it has a dedicated memory space starting from 0
What does the OS do for memory protection?
Isolates processes from each other and itself
What is virtualization in the context of an OS?
The OS transforms physical resources into a virtual form
What are the three easy pieces of an OS?
- Virtualization
- Concurrency
- Persistence
What happens during the execution of a compiled program?
- The program is loaded into memory
- The OS manages the execution environment
What is the purpose of the OS in resource allocation?
Manage protection, isolation, and sharing of resources
What does the OS provide for running programs?
Each running program is provided with its own process
What is the role of the OS in process switching?
Enables switching between processes efficiently
Fill in the blank: The OS provides clean, easy-to-use abstractions of physical resources, creating the illusion of _______.
[infinite memory, dedicated machine]
What does a virtual machine virtualize?
The CPU
What is the purpose of the Spin function in the cpu.c example?
Repeatedly checks the time and returns once it has run for a second