Homework
A job is a collection of tasks that a user requires a computer system to work on during a problem-solving or a transactional process. It includes procedures, data and operating instructions.
The job description says yes. BAT,. Sh
====
The so-called privileged instruction, refers to the computer does not allow the user direct use of instructions, such as I/O instructions, interrupt instruction, access to memory protection registers, the sending program status Word to the program status Word register and other directives. The operating system divides the user state (head) and the kernel mentality (pipe state) in the specific implementation, in order to strictly distinguish between the two kinds of programs.
=====
Some of the more closely related hardware modules, such as clock management, interrupt processing, device drivers, etc. at the lowest level. The second is higher-frequency programs, such as process management, memory management, and device management. These two parts form the kernel of the operating system. This part of the content of the instruction operation works in the nuclear mindset.
======
Primitive language
An operating system designed hierarchically, the bottom layer is necessarily a number of public small programs that can be called, each of which completes a prescribed operation. It is characterized by:
- They are at the bottom of the operating system and are the closest part of the hardware.
- The operation of these programs is atomic-the operation can only be one go (this is mainly from the security of the system and easy to manage).
- These programs run for short periods of time and are frequently called.
Programs that have these characteristics are often referred to as primitives (Atomic operation). The direct way to define the primitive is to turn off the interrupt, so that all its actions are completely closed and then opened.
Some of the operations in the system, such as device drivers, CPU switching, and process communication, can be defined as primitives, making them part of the kernel.
========
Nuclear mentality Directive
As you can see from the above, the kernel mentality directive actually includes system invoke class directives and some operating instructions for clocks, interrupts, and primitives.
=======
The inbound directive should be a voluntary interruption, access to the functions provided by the system
=======
System calls
These system calls can be broadly divided into the following categories by function:
- Device Management. Complete the device request or release, as well as the device startup functions.
- File management. Complete the functions of reading, writing, creating and deleting files.
- Process Control. Complete the process creation, revocation, blocking and wake-up functions.
- Process communication. Complete the functions of message passing or signal passing between processes.
- Memory management. Complete memory allocation, recovery, and get the job to occupy the memory area size and the origin of functions.
Obviously, the system calls the kernel mentality running in the system. System functions can be used to ensure the stability and security of the system, and to prevent users from arbitrarily changing or accessing the data or commands of the system. The system invoke command is implemented by one or more sub-program modules provided by the operating system.
Note: The kernel mentality is entered by the user, not just the state need to switch. Also, the stack used may need to be switched from the user stack to the system stack, but the system stack is also part of the process.
======================
The concept of a process
In a multi-channel program environment, multiple programs are allowed to execute concurrently, at which point they lose their closeness and are characterized by discontinuity and non-reproducibility. The concept of process is introduced in order to better describe the concurrent execution of the control program and realize the concurrency and sharing of the operating system.
In order to implement the structure of concurrent execution: We disassembled the program. Then they lose their closeness. How can you maintain a process after you disassemble it? One way is to use the data structure of the PCB to maintain
For programs that participate in concurrent execution (with data) to run independently, a dedicated data structure must be configured, called the Process Control block, PCB. The system uses the PCB to describe the basic situation and running state of the process, and then control and manage the process. Accordingly, the process image (process entity) is composed of three parts: program segment, related data segment and PCB. The so-called creation process is essentially the creation of the PCB in the process image, while the undo process is essentially the PCB that revokes the process. It is important to note that the process image is static and the process is dynamic.
Note: PCB is the only sign that the process exists!
From different angles, processes can have different definitions, and the typical definitions are:
- A process is a process of executing a program.
- A process is the activity that occurs when a program and its data are executed sequentially on the processing machine.
- A process is a process that runs on a data set by a program that has a separate function, which is an independent unit of the system for resource allocation and scheduling.
After introducing the concept of process entity, we can define the process of the traditional operating system as: "The process is the process entity running process, is a system of resource allocation and scheduling of an independent unit." “
Characteristics of the process
A process is caused by concurrent execution of multiple programs, and it is a two distinct concept from a program. The basic characteristic of the process is to compare the sequential execution of individual programs with the basic requirements of process management.
- Dynamic: Process is the execution of a program, it has the creation, activity, suspension, termination and other processes, with a certain life cycle, is the dynamic generation, change and extinction. Dynamics is the most basic feature of a process.
- Concurrency: Refers to a number of process entities, in memory, can run concurrently in a period of time, concurrency is an important feature of the process, but also an important feature of the operating system. The purpose of the introduction process is to enable the program to execute concurrently with the programs of other processes to improve resource utilization.
- Independence: Refers to the process entity is an independent operation, independent access to resources and independent acceptance of the dispatch of the basic unit. Any non-PCB program can not be used as a separate unit to participate in the operation.
- Asynchrony: Because of the mutual constraints of the process, so that the process has a discontinuity of execution, that is, the process at their own independent, unpredictable speed ahead. Asynchrony causes the non-reproducibility of the execution results, and for this reason, the appropriate process synchronization mechanism must be configured in the operating system.
- Structural: Each process is configured with a PCB to describe it. From the view of structure, process entity consists of three parts: program segment, data segment and Process Control section.
==========
- Run to the blocking arrow back:
But
Ready status, running state: When the process in the ready state is dispatched, the processor resource (dispatch processor Time slice) is obtained, and the process is converted from ready to run state.
Run status-ready state: The running process will have to give up the processor after the time slice is exhausted, thus converting the process from the running state to the ready state. Also, in a stripped-down operating system, when a higher-priority process is a thread, the scheduling level translates the process being executed into a ready state for higher-priority processes to execute.
Blocking state: When a process requests the use and allocation of a resource (such as a peripheral) or waits for an event to occur (such as the completion of an I/O operation), it transitions from the running state to the blocking state. The process requests the operating system to provide services in the form of a system call, which is a special form of invoking the operating system kernel procedure by the running user-state program.
Blocking status-ready state: When a process waits for an event to arrive, such as the end of an I/O operation or the end of an interrupt, the interrupt handler must convert the state of the corresponding process from a blocking state to a ready state.
===========
Operating System Concepts