Lecture 3 Flashcards
A process is…
…a program in execution
A process has at least the following:
- Program counter
- Stack
- Data section
Difference between program and process
Program is the actual file on the disk, process is the job
When you execute a file, the OS…
…invokes a process (allocates whatever the program requires to run)
Another word for a process is a…
…job
The stack stores the ____ and grows from ____ to ____
Local variables, max to 0
The heap stores the ____ and grows from ____ to ____
Dynamically allocated memory, 0 to max
Data stores ____ and is below the ____
Global variables, heap
Text stores ____ and is below the ____
Program code, data
As a process executes, it changes its…
…state
Process States:
- New (just created)
- Running (Instructions being executed)
- Waiting (Waiting for an event to occur)
- Ready (Waiting for the CPU)
- Terminated (Process has finished execution)
OS maintains info about process in…
…PCB (Process Control Block)
PCB contains what info?
- Process State
- Program Counter
- CPU registers
- CPU scheduling info
- Memory-management info
- Accounting info
- I/O status
PCB used to…
…switch CPU from one process to another
PCB in Linux is represented by…
…the C structure task_struct (in a doubly linked list)