Home > Article > Operation and Maintenance > Summary of operating system skills
Definition: Manage system resources, control program execution, improve human-computer interface, provide various services, and rationally organize computer workflow And a system software that provides a good operating environment for users to use computers conveniently and effectively.
Functions: Processor management, storage management, device management, file management, networking and communication management
Features: Concurrency, sharing (1. Transparent resource sharing 2. Exclusive resource sharing), asynchrony
Category: batch operating system, time-sharing operating system, real-time operating system
Process Definition: A process is a program with independent functions on a certain data collection A running activity is also the basic unit for resource allocation and protection by the operating system.
Process status and transition: p73
Three-state model: running state, ready state, waiting state
Five-state model: new state, terminated state What is the reason for the proposal?
Requires the ability to draw pictures to explain that certain transformations do not exist.
The motivation for introducing multi-threading: reducing the time and space overhead incurred when programs are executed concurrently, making concurrency granularity finer and concurrency better.
Advantages of threads: fast thread switching, easy communication, reduced management overhead, and improved concurrency
PCB (Process Control Block) process control block: the unique identifier of the existence of a process, which is used by the operating system to record It is the collection of dynamic characteristics of the process and the data structure that describes the process status and environmental information. It is also the only data structure for the operating system to control the process and the main basis for managing the process. p75
What is the concept of TCB?
Dynamic/static priority?
Processor Scheduling: p101 Example
First come, first served algorithm
Shortest job first algorithm (concept)
Shortest remaining time priority algorithm
Highest response ratio priority algorithm (concept)
Bernstein conditions? Bernstein (short answer)
Deadlock: A group of processes is stuck in a state of waiting forever due to competition for resources.
Hunger: A runnable process is delayed indefinitely by the scheduler and cannot be executed because other processes always take precedence over it.
Process synchronization: Concurrent processes to complete a common task coordinate their activities based on a certain condition, because the coordination constraints caused by waiting for and transmitting signals or messages need to be arranged in the order of execution at certain locations. relation.
Critical section: Program segment related to shared variables in concurrent processes.
Critical resources: The resources represented by shared variables, that is, resources that can only be used by one process at a time.
Three principles of critical section scheduling (mutually exclusive use, let in when free; wait if busy, limited wait; choose one to enter, the algorithm is feasible.):
At most one process can enter the critical section for execution at a time.
If there is already a process in the critical section, other processes trying to enter this critical section should wait.
The process entering the critical section should exit within a limited time to allow a process in the waiting queue to enter.
Software algorithm for critical section management:
Analysis
Will there be any problems?
When will it be released?
Hardware facilities for critical section management:
Turn off interrupts
Test and set instructions
Swap instructions
pv operation definition (one yuan, general)?
Comprehensive question:
The 5 philosophers dining problem (no deadlock solution) p139
Producer-consumer problem ( Many-to-many, many buffers) p140
Reader-writer problem p141
Barber problem p142
Monk Fetching Water
Definition: If each process in a process set is waiting, it can only wait for other processes in the set. The process can only cause events, and it will be stuck in a stalemate indefinitely.
Generated conditions:
Mutually exclusive conditions
Possession and waiting conditions
No deprivation condition
Loop waiting condition
Deadlock avoidance: Comprehensive question 15 points
Banker’s algorithmData structure p163
Algorithm description:
Safety sequence at time T0
Process P1 requests resources (can it be satisfied? Why? )
Program link type: (fill in the blank)
Static link
Dynamic link
Runtime link
Static address relocation: The loader implements the loading and address conversion of the loading code, loads it into the designated area of memory allocated to the process, and all logical addresses in it are modified into a memory physical address.
Dynamic address relocation: The loader implements the loading of the loading code module and loads it into the designated area of the memory allocated to the process, but the logical address of the application processed by the linker is not When any modification is made, the starting address of the program memory is placed into the hardware special register - the relocation register. During program execution, whenever the CPU refers to a memory address (accessing programs and data), the hardware intercepts this logical address and adds the value of the relocation register before it is sent to the memory in order to achieve address translation.
Paging storage management p206
Concept:
Page
Page frame
Logical address
Memory page frame table
Page table
Paging/ What is the implementation principle of segmented dynamic link library? (Explanation + Drawing)
Comprehensive question:
Given the logical address, find the physical address? (Draw)
Given the logical address and page size, calculate the physical address?
Comparison of segmentation and paging (short answer):
Segmentation is a logical unit of information, determined by the logical structure and meaning of the source program , visible to the user, the segment length is determined by the user according to needs, and the segment start address can start from any memory address. In the segmented method, the source program (short number, intra-segment displacement) still maintains a two-dimensional (address) structure after being linked and assembled. The purpose of introduction is to meet the needs of users for modular programming.
Paging is a physical unit of information. It has nothing to do with the logical structure of the source program and is invisible to the user. The page length is determined by the system (hardware). The page can only start from an integer multiple of the page size. In the paging mode, the source program (page number, intra-page displacement) becomes a one-dimensional (address) structure after link assembly. The purpose of introduction is to achieve discrete allocation and improve memory utilization.
Page fault interruption rate p223
Concept: Number of unsuccessful accesses?
Draw a picture, find the page missing interruption rate? p229
I/O control method: (fill in the blank)
Polling method
Interrupt mode
DMA mode
Channel mode
Buffer technology:
Single buffering p265
Double buffering p266
Search positioning: (example questions, short answers) p270
First come, first served algorithm
Shortest search time first algorithm
Scan algorithm
Elevator scheduling algorithm
Cycle Scan Algorithm
-"Operating System Tutorial (Fifth Edition)" by Fei Xianglin and Luo Bin Higher Education Press
The above is the detailed content of Summary of operating system skills. For more information, please follow other related articles on the PHP Chinese website!