Process Image
202310092237
Status: #idea
Tags: OS
Process Image
UNIX Process Model
- User level context
- Process text -> Machine instructions of the program
- Process data -> Data that the process can use
- User stack -> Arguments, local variables, pointers for function calls
- Shared memory -> Used for IPC (inter-process communication)
- Register context
- Program counter -> Address of next instruction (may be in kernel-space or in user-space)
- Status register -> Status at time of preemption. Hardware dependant
- Stack pointer -> Points to the stop of the user/kernel stack. Depends on the mode of operation at the time of preemption
- System level context
- Process table entry
- User area -> Process control information that only needs to be accessed in the context of the process
- Per-process region table -> Mapping from virtual to physical address
Returning from kernel running to user running is a decision point for the UNIX scheduler.
UNIX uses a priority round-robin scheduler
All priority-driven schedulers suffer from starvation.
Ageing is a possible solution where a process's priority increases with its age
UNIX will not move asleep processes from swap to memory, even if memory is available.
Creating a child process cuts your time slice in half (in Linux).
Your child joins before you in the ready queue, and then short-term scheduler is called.
Using a syscall is NOT a decision point for the short-term scheduler. Only returning from a syscall is
The preempted state is a transient state for a process
In the Linux model, OS functions are divided into various processes. So, a mode switch also acts as a context switch