1.Overview
1.1 What is Operating System?
1.2 What Operating Systems Do?
![](https://i-blog.csdnimg.cn/blog_migrate/1f6524c8d62a7e635f34dd68818aeddf.png)
1.3 Computer-System Architecture
(1)Single-Processor Systems
(2)Multiprocessor Systems
2. Process
(textbook Chapter3)
2.1 process concept
![](https://i-blog.csdnimg.cn/blog_migrate/de436848c08844b8f4a7c2158c8f2b4c.png)
2.1 process state
![](https://i-blog.csdnimg.cn/blog_migrate/06d1a2010b614975fbcbd6ace4d85a39.png)
2.2 Process Control Block (PCB)
进程控制块
PCB is a data structure used for storing the information about a process.
Every process is identified by its own PCB.
include:Process state, program counter, CPU registers, CPU-scheduling information, memory-management information, accounting information, I/O status information.
PCB of each progress resides in(存在于)the main memory and are present in a linked list.
PCB is important in multiprogramming environment as it captures(捕捉) the information pertaining to (有关)the number of processes running simultaneously.
2.3 Process Scheduling
Scheduling Queues
![](https://i-blog.csdnimg.cn/blog_migrate/db9d7852c255bcd65b6691baf43821d0.png)
Schedulers (select processes from the queues)
![](https://i-blog.csdnimg.cn/blog_migrate/2ab30f240172279c321c2a3a08b312c4.png)
Context Switch
When CPU switches to another process, the system must save the state of the old process and load the saved state for the new process and load the saved stated for the new process via a context switch.
Context-switch times are highly dependent on hardware support.
2.4 Operations on Processes
Process Creation
Parent process create children processes, which, in turn create other processes, forming a tree of processes.
each process has a unique process identifier(or pid)
Resource sharing options
1. parent and children share all/no resources
2. children share subset of parent's resources
Execution options
1. parent and children execute concurrently
2. parent waits until children terminate
Process Termination
![](https://i-blog.csdnimg.cn/blog_migrate/fd3285b2078523844e696c10f21a4ddf.png)
2.5 Interprocess Communication
Interprocess communication models:
![](https://i-blog.csdnimg.cn/blog_migrate/5e69dd7926bb394472f76fda16a5587b.png)
Shared-Memory Systems
Message-Passing Systems
The message size is either fixed or variable.
If processes P and Q want to communicate,a communication link must exist between them.