mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-27 14:54:05 -06:00
vault backup: 2022-09-21 14:09:30
This commit is contained in:
parent
354decc348
commit
823f0d3b4b
@ -41,7 +41,7 @@ system program types include.,
|
|||||||
|
|
||||||
also runs in user space
|
also runs in user space
|
||||||
|
|
||||||
## system calls
|
# system calls
|
||||||
processes issue requests to the kernel by making system calls
|
processes issue requests to the kernel by making system calls
|
||||||
|
|
||||||

|

|
||||||
@ -105,6 +105,51 @@ generated by:
|
|||||||
|
|
||||||
a system call generates an interrupt and the OS transfers control to a system call handler
|
a system call generates an interrupt and the OS transfers control to a system call handler
|
||||||
|
|
||||||
### data structure of kernel process
|
# Processes
|
||||||
|
a process is dynamic
|
||||||
|
|
||||||
|
a given program can be executing many times of a given machines: each instance is a separate process
|
||||||
|
|
||||||
|
process components
|
||||||
|
- text section/code section: the program code itself
|
||||||
|
- data section: any global variables used by the program
|
||||||
|
- process stack: any local variables currently being used
|
||||||
|
- program counter: a pointer to some place in the program code
|
||||||
|
- contents of CPU registers
|
||||||
|
- memory management information
|
||||||
|
- device/file allocation information
|
||||||
|
- accounting information
|
||||||
|
|
||||||
|
## process control blocks
|
||||||
|
the OS keeps a record of each process in the system, with a data structure called *process control block* (PCB)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## scheduling processes
|
||||||
|
processes take turns to run on the CPU. processes wait to run in one of two queues:
|
||||||
|
- ready queue: process ready to execute
|
||||||
|
- device queue: processes waiting to use a particular device. (one queue per device)
|
||||||
|
|
||||||
|
generally represented as linked lists
|
||||||
|
|
||||||
|
## flow of processes
|
||||||
|

|
||||||
|
|
||||||
|
Rounded rectangles are events.
|
||||||
|
Rectangles are queues where processes wait.
|
||||||
|
Circles are processing resources that serve the events/queues.
|
||||||
|
|
||||||
|
## process creation
|
||||||
|
created by another process: parent process creates a child process
|
||||||
|
- process can copy itself using fork
|
||||||
|
- child process can then call exec() to load a new program
|
||||||
|
- a child process can run concurrently with parent
|
||||||
|
- child process can share the resources of its parent if not restricted
|
||||||
|
|
||||||
|
system start with one process called *init*
|
||||||
|
|
||||||
|
## procees heirarchy
|
||||||
|
processes for a tree
|
||||||
|

|
||||||
|
|||||||
@ -42,6 +42,7 @@ tags:
|
|||||||
- [11-struct-and-union](notes/11-struct-and-union.md)
|
- [11-struct-and-union](notes/11-struct-and-union.md)
|
||||||
- [12-pointers-to-routines](notes/12-pointers-to-routines.md)
|
- [12-pointers-to-routines](notes/12-pointers-to-routines.md)
|
||||||
- [13-OS-intro](notes/13-OS-intro.md)
|
- [13-OS-intro](notes/13-OS-intro.md)
|
||||||
|
- [14-processes-and-system-calls](notes/14-processes-and-system-calls.md)
|
||||||
|
|
||||||
# Archive
|
# Archive
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user