State of execution
-program counter, stack
Parts & temporary holding area
May require special hardware
-I/O devices
What is a process?
OS manages hardware on behalf of applications
application == program of disk, flash memory(static entity)
process == state of a program when executing loaded in memory(active entity)
What does a process look like?
stack, heap, data, text
address space == “in memory”
representation of a process
physical addresses: locations in physical memory
How does the OS know what a process is doing?
-program counter
-cpu registers
-stack pointer
Process Control Block(PCB)
registers
memory limits
list of open files
priority
signal mask
CPU scheduling info
-PCB created when process is created
-Certain fields are updated when process state changes
-Other fields change too frequently
CPU process
running, ready state
mechanisms for process creation
-fork == copies the parent PCB into new child PCB
child continues execution at instruction after fork
-exec == replace child image, load new program and start from first instr.
unix-based os, the parent of all process: init
the parent of all app processes: zygote
OS must
-preempt
-schedule
-dispatch