Process
Process is the abstraction for executing a program with limited privileges
it needs permission from kernel to access the memory, disk, anything
Process is Instance of program
ex. many process for same program
Program = part of Process state
ex. program can invoke more than one process
Segments of Application
Code
instructions
Data
initialized global variables
Stack
Local varibles
arguments
Heap
dynamic allocation (malloc, free)
Exceptions handling
some codes should be restricted, because of its potential danger.
Simple approach: run instruction in simulator (ex. JVM)
faster approach: run directly in CPU user mode, take exceptions to maintain safety
Exceptions
System calls = protected procedure call
intentional, request by program to OS
limited, carefully coded
Interrupts (Async)
Timer, I/O
manage with interrupt vector table
Exceptions (Sync)
div0, segfault, …
Two Components of process
Execution Thread
sequence of execution
single thread, no concurrency
Address Space
execution environment
CPU registers, main memory, IO, File system, …
Shell
Job Control System
create, manage set of programs to do some task.
Process Control