Article Directory
- Preface
- 1. Overview of the operating system
- 1.1 Functions of the operating system
- 1.2 Special operating system
- 2. Process management
- 2.1 The concept of process and thread
- 2.2 Process status
- 2.3 Semaphore and PV operation
- 2.4 Forward chart
- 2.5 deadlock problem
- 3. Storage management
- 3.1 Segment Page Storage
- 3.2 Disk Management
- IV. Equipment Management
- 5. Document Management
- 5.1 Document related concepts
- 5.2 Tree directory structure
Preface
This article is a note that I wrote only key abstracts during the soft exam review stage (purely personal opinion). I believe you have seen a lot of detailed introductions on the Internet.operating systemI just put forward the articles, so I didn't explain them in detail, just for better review.^ O ^
1. Overview of the operating system
1.1 Functions of the operating system
- Resource Management(Processor Management, Memory Management, File Management, Device Management)
- Control the loading and execution of the program, that is, allocate resources for program operation
- Provides interfaces for human-computer interaction, that is, the user front-end interface, which facilitates task requests and program execution
- System security, protect computer system security and data security
- Provide interfaces for hardware and software, improve system performance
1.2 Special operating system
Classification | Features |
---|---|
Batch operating system | Single channel batch processing: The system processes only one job at a time until the job is completed before processing the next job.Multiple batch processing: The system can process multiple jobs at the same time to improve resource utilization and job throughput |
Time-sharing operating system | Multiplexity, interactivity, independence, timeliness |
Real-time operating system | Efficiency, high speed, reliability, real-time |
Network operating system | Control communication and collaboration between multiple computer nodes to realize the sharing, management and maintenance of network resources |
Distributed operating system | Connect multiple computers through the network to achieve collaborative work and resource integration, transparency, reliability, and high performance |
Microcomputer operating system | Concurrency, sharing, virtuality, asynchronousness |
Embedded operating system | Miniaturization, customizable (configured for hardware variations), real-time, reliability, portability, (supported by HAL and BSP) |
2. Process management
2.1 The concept of process and thread
- processIt is the system that allocates and dispatches resourcesBasic Unit, is also the basis of the operating system structure.
- ThreadIt is a basic concept in computer science, which refers toA processExecuted inIndependent instruction stream。
- The difference between a process and a thread, a process is a process of execution of a program. Without a process, there will be no process.
- Each thread in the same process cansharedVarious resources of the process.
2.2 Process status
【Three-state model】
run:The process occupies the CPU.
Ready:The process has obtained all resources except the CPU, and once the CPU is not occupied, the CPU can be obtained to run.
block:The process cannot execute because it is waiting for an event to occur (such as I/O operations, semaphores, etc.), and even if the process acquires the CPU, it cannot run.
【Five-state Model】
New state (real ready):The process has just been created and not readyqueue。
Ready (active ready):The process is ready, waiting for allocation.
Running state:The process is executing.
Blocking state (active blocking):The waiting event cannot be executed.
Termination state:The process is completed but not cleaned by the operating system.
2.3 Semaphore and PV operation
Synchronization of processes
Synchronization refers to the need for collaboration between multiple processes during execution in a certain order or time relationship.
Mutual Exclusion of Processes
Mutual exclusion means that when multiple processes access a shared resource, at most one process can access the resource at any time.
PV operation
Semaphore:is a special variable that represents available resources.
P operation
When a process or threadneedWhen accessing a shared resource, it performs a P operation.
V operation
When a process or threadFinishAfter access to a shared resource, it performs a V operation.
2.4 Forward chart
- In the concurrent graph, there is a V operation to release resources, and there is a P operation resource in the front area.
- The initial value of the semaphore that realizes concurrent is generally zero, and there are several semaphores with several arrows.
2.5 deadlock problem
- Deadlock refers to a deadlock caused by multiple processes (or threads) during operation due to competing for resources. Without external forces, these processes (or threads) will no longer be able to move forward.
- In fact, when a deadlock occurs, one additional resource number can solve the deadlock.
3. Storage management
3.1 Segment Page Storage
【Page Storage】
Divide the program and memory into blocks of the same size, and call the program into memory in units of pages.
【Segment Storage】
Divide the logical space by the natural segments in the user's job and then transfer it into memory.
【Segment page storage】
A combination of segment and page styles, first segmented, and then paging. A program has several segments, and each segment can have several segments, and the size of each segment is different.
advantage
High memory usage, easy to share storage, and share protection
shortcoming
High complexity, because of managementsoftwareThe increase in cost increases, and the processing of batch small files is not applicable
3.2 Disk Management
- Access time = seek time + waiting time
- FCFS first come first service (whoever applies for service first)
- SSTF minimum search time is preferred (select the request closest to the current head for disk access)
- SCAN scanning algorithm (elevator algorithm, scan in sequence)
- CSCAN loop algorithm (one-way scanning)
IV. Equipment Management
- Hardware: Complete specific I\O operations
- Interrupt handler: Wake up the device driver after I\O is completed
- Device driver: Set registers and check device status
- Device-independent I\O layer: device name resolution, blocking process, allocating buffers
- User-level I\O layer: issue I\O calls
- List item
5. Document Management
5.1 Document related concepts
- File: A collection of information stored on the computer using the computer hard disk as the carrier, and the file includes the file body and file description.
5.2 Tree directory structure
- The root node (or root directory) is located at the top of the tree, which represents the starting point of the file system.
- Absolute path: Starting from the root directory, the full name of the file is absolute path + file name
- Relative path: Starting from the next program in the current directory
- In most modern operating systems, such as Windows, macOS, and Linux, they use a tree directory structure to organize and manage files.