Operating system --- Harbin Institute of Technology Sun Zhigang 70 lecture summary (video 1-12)

After watching Mr. Sun's video on station B, I felt it was too long-winded to watch the process. Here is a personal summary.

1.1 Recommended books:
Operating system concepts pdf
modern operating systems pdf
 
2.2 What are the operating systems
IOS
MacOS
Linux
Andriod
Unix
VxWorks --- aerospace and military fields, embedded
FreeBSD --- server, stable
DOS --- can only operate one program
 
Operating System Features: Manage Hardware Resources
 
5.5
 

 

 
INT (Assembly Instruction: Interrupt): Enter the interrupt service routine after the interrupt (must be written by the operating system)
 
System call : The application executes the INT instruction and jumps to the interrupt service routine (kernel)
When the application calls open(), the conversion to assembly is INT, and then the system .
The interrupt service routine checks the system call number to find the location of the program.
 
strace -- trace which system calls a program calls
 
printf() calls write()
 
Question: Function parameter passing process in C language
Push parameters into the stack one by one, and then take them out one by one
 
Problem: System call parameter passing procedure
similar
 
User-mode data can only be written to user-mode memory, and kernel-mode can directly access user-mode memory
User mode cannot directly access kernel mode memory.
 
6.6
System program:
Disk Partition, Disk Snapshot, Task Manager, Explorer (manipulate files)
 
7.7
DOS: Applications can use hardware without the DOS operating system
Solaris OS:
 
8.8 Process Management
Assembly instructions:
in command --- direct operation of hardware port input
out --- Directly operate the hardware port to read in
These two instructions are not allowed to execute in user mode
 
Computer boot process:
 

 

Execute BIOS program (in ROM)
Select the storage device (hard disk or U disk, etc.)
MBR is placed in the first sector of the hard disk (1 to 512 bytes)
Load MBR to 0x7c00 and execute
 
 
Process: (memory address: 0-max)
PC and other registers
code segment (instruction)
stack
heap
Data segment (data determined in the compilation phase, such as the string of helloworld)
 
max up to 4G
 
Process switching --- PCB (Precess Control Blocking) process control block
 
1. Store the state (registers, etc.) in the PCB before process switching
2. The operating system kernel selects the next scheduled process
3. Load the PCB for the next process
 
Ready PCB Queue
Blocking the PCB queue
 
 
 
Question 1 From the running state to the ready state: the CPU is used by the program before the process is switched, how does the system kernel obtain the right to execute
Use interrupts (clock interrupts, interrupts at intervals, interrupt service routines -- the operating system)
 
Problem 2 From running state to waiting state:
The program actively enters the waiting state, and the program calls the system call
 
Problem: Need to reduce the overhead of process switching
Hardware: CPU design completed:
1. One command completes on-site save, which is much faster than PUSH one by one
2. Directly change a batch of register groups
 
12 Process Creation
Child process is created by parent process
1. The resources of the child process and the parent process are completely shared---embedded system
2. Child processes share part of parent process resources --- Unix systems
3. There is no relationship between the child process and the parent process --- Windows
 
a parent process child process running at the same time
b The parent process waits for the child process to finish its work before running
 
          1) Child process memory space clone parent process memory space---Linux
          2) The child process loads the program from the hard disk --- Windows
 
 
 fork() ---- Execute to fork(), the operating system will copy the parent process here, return 0 to the child process and return greater than 0 to the parent process

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325293715&siteId=291194637