The first chapter, Introduction, Cursory, general understanding, summarized as follows:
There are two views of the operating system: The Explorer View and the extended computer perspective. From a resource manager point of view, the task of the operating system is to efficiently manage parts of the entire system; From an extended computer perspective, the task is to provide users with a virtual machine that is easier to use than a physical computer.
The operating system has a long history, from the early substitution of operator-operated systems to the current multi-channel program system.
The core of any operating system is a set of system calls that define the functions that the operating system can perform. For Minix, the system calls are divided into six categories, and the first class is related to process creation and termination. The second class processes the signal. The third class is for file reading and writing. The fourth category is directory management. The fifth class protects the information. Class sixth is used for time management.
The operating system has several structural models, common with the monolithic model, the hierarchical model, the virtual machine model, and the customer-server model.
Chapter II, Introduction to the process-related content, tomorrow continue to see about Minix how to implement the process, inter-process communication (IPC problem), and process scheduling.
The summary is as follows:
To mask the impact of interrupts, the operating system provides a conceptual model of sequential processes that run concurrently. interprocess communication primitives can be used between processes to communicate with each other, such as semaphores, enhancement, messages, and so on. These primitives are used to ensure that no two processes enter a critical section at any one time. The state of a process can be run, ready, or blocked, and may cause a change in state when it or another process executes an interprocess communication primitive. The
interprocess communication primitives can be used to address issues such as producer-consumer, philosopher dining, reader-writer, and Barber sleeping. However, even if you use these primitives, you must be careful to avoid errors and deadlocks. At present, there are many kinds of scheduling algorithms, including time slice rotation, priority scheduling, multi-level queue and policy-driven scheduling. The
Minix supports process concepts and provides messages for interprocess communication. The message is not buffered, so a send operation succeeds only if the recipient is waiting for it. Similarly, a receive operation succeeds only if the message is already available. The calling process for both of these operations will block when the operation is unsuccessful.
When an outage occurs, the bottom of the core constructs a message and sends the message to the system task associated with the interrupt device. For example, when a disk task reads and writes a piece of data, it issues a command to the hard disk controller and then calls receive and blocks. The hard disk controller will issue an interrupt when the data is ready. The low-level software then constructs a message to the hard disk task and flags it as ready. When the hard disk task is scheduled to run again, it gets the message and processes it. The interrupt handling routine can of course also do something directly, such as clock interrupt handler update time.
interrupts can cause task switching. When a process is interrupted, a stack is created in the process table entry for the process, and all the information needed to start the process again is placed on the new stack. You can start any process again by pointing the stack pointer to its process table entry, then executing a sequence of instructions to restore the CPU register value, and end with a iretd instruction. The scheduler determines which process table items the stack points to. The
core itself can also be interrupted at run time. When the CPU detects an outage, it uses the core stack instead of the stack in the process table. This allows for an interrupt nesting. When the subsequent interrupt service routine finishes, the interrupt service routine that was executed before it can run until the end. A process can be restarted after all interrupts have been processed. The
Minix scheduling algorithm uses three priority queues. The highest priority is the system task; The next is the file system, the memory manager, and other server processes; The lowest is the user process. The user process runs for a short period of time, thus achieving the scheduling effect of the time slice rotation. However, other processes continue to run until they are blocked or deprived.
Operating system: Design and implementation reading pen (1)