Operating Systems Structures and Processes Flashcards
1
Q
What are the key services provided by an OS?
A
- UI: CLI, GUI
- Program Execution: Loads and runs programs
- I/O Operations: Manages devices
- File-System Manipulation: Creates/deletes files, enforces permissions
- Communication: Shared memory or message passing between processes
- Error Detection: Handles hardware/software errors
- Resource Allocation: Manages CPU, memory
- Accounting & Security: Tracks usage and enforces access control
2
Q
What is a system call?
A
A programming interface to request OS services (e.g. open(), fork())
3
Q
How are parameters passed to system calls?
A
Via registers, memory blocks or the stack
4
Q
Compare Windows and Unix system calls
A
- Windows: CreateProcess(), ReadFile()
- Unix: fork(), read()
5
Q
What are the parts of a process?
A
- Text: Code + program counter
- Stack: Temporary data
- Data: Global variables
- Heap: Dynamically allocated memory
6
Q
What are the process states?
A
- New: Created
- Ready: Waiting for CPU
- Running: Executing
- Waiting: Blocked
- Terminated: Finished
7
Q
What is stored in a PCB?
A
Process state, PC, registers, scheduling info, memory limits, I/O status
8
Q
What are the key queues in process scheduling?
A
- Job Queue: All processes
- Ready Queue: Processes in memory ready to execute
- Device Queue: Processes waiting for I/O
9
Q
Compare short-term and long-term schedulers
A
- Short-term: Selects next process for CPU (frequent, fast)
- Long-term: Controls multiprogramming by loading processes into memory (infrequent, slow)
10
Q
Process Lifecycle example
A
- Ready -> Running: Dispatched by short-term scheduler
- Running -> Waiting: I/O request or event wait
- Waiting -> Ready: I/O completion
- Running -> Terminated: Process exits