Operating system introduction operating system target
- Ease of
- Effectiveness
- Scalability
- Development
The role of the operating system
OS as the interface between user and computer hardware system, that is, the OS is between the user and the computer hardware, the user uses the OS to use the computer system
Note that the OS is a system software
Users can use the computer in the following three ways
- Command mode
- System call Mode
- Graphics, Window mode
Os as a manager of computer resources
Computer resources include: processor, memory, I/O devices, and information (data and programs)
Features of the OS:
- Processor management: Distribution and control processors
- Storage Management: Responsible for memory allocation and recovery
- I/O Device Management: Responsible for the allocation and manipulation of I/O devices
- File management: Responsible for file access, sharing, and protection
The OS implements an abstraction of computer resources
OS is a multi-layered system software installed on computer hardware, they not only enhance the function of the system, but also hide the details of the hardware operation, they realize the computer hardware of multiple levels of abstraction.
Operating system development process without operating system computer system
The user (ie programmer) uses the computer hardware system in a manual way.
Offline input/Output mode
Single-channel batch systems (simple batch processing system)
Put a batch of jobs into the tape offline, and supervise the program on the system, under its control, so that the batch of jobs can be processed one after another continuously.
Features: Automatic, sequential, single-channel sex.
Multi-channel Batch systems (multiprogramming batch processing system)
The job is first placed on the external memory as a queue, called the fallback queue, and then the job scheduler chooses several jobs from the fallback queue to call into memory so that they share the CPU and the various resources in the system
Benefits: Provides CPU utilization, provides memory and I/O device utilization, and increases system throughput.
Features: multi-channel, disorder, scheduling.
Time-sharing systems (time-sharing system)
Multiple terminals with a monitor and keyboard are connected on a single computer to interactively use the computer and share the resources in the host.
Features: Multiplexing, independence, timeliness, interactivity.
Real-time systems (real-time system)
The system can respond to requests for external events in a timely (or immediate) manner, complete the processing of the event within a specified time period and control all real-time tasks to run in unison.
Features: Multi-channel, independent, timely, interactive, reliable.
Development of microcomputer operating system
The operating system configured on a microcomputer is a microcomputer operating system
Single-user single-task operating system (CP/M,MS-DOS) ——-> Single-user multitasking (Windows) ——-> Multi-user multitasking (UNIX os-->solaris os,linux OS)
Basic features of the operating system
- concurrency (emphasis)
- concurrency vs. parallel
parallel: two or more events occur at the same time
Concurrency: occurs within the same time interval in two or more events (macro with multiple programs running concurrently)
-
- thread
Sharing of
- Mutex sharing: Only one process (thread) is allowed to access the resource over a period of time.
Simultaneous access: Allows for a period of time by multiple processes "simultaneously" access to them, macro "simultaneous", micro "alternating."
Concurrency and sharing are the two basic characteristics of an operating system, and they are mutually existent conditions.
- Virtual (Vsan)
The so-called "virtual" in the operating system refers to a technique that turns a physical entity into a number of logical counterparts.
- Asynchronous
Asynchronous means that the process is moving forward at an unpredictable rate of people.
Main function Processor management function of the operating system
- Process Control: Creates a process for the job, revokes the completed process, and controls the state transitions that the process is running in.
- Process synchronization: Coordinating the operation of multiple processes (including threads)
Coordination mode: Process mutex, process synchronization mode
- Process communication: Used to exchange information between the processes of mutual cooperation
- Scheduling: Each job waiting on the fallback queue is usually scheduled to be executed, and within the traditional operating system, there are two steps of job scheduling and process scheduling.
Memory management functions
- Memory allocation
Static allocation: the memory space for each job is determined when the job is loaded, it is not allowed to request new memory space, and is not allowed to move in memory
Dynamic allocation: the memory space for each job is also determined when the job is loaded, but runs again to request a new memory space and also runs in memory move.
In order to implement memory allocation, the mechanism of memory allocation should have such a structure and function:
- Memory allocation data structure, which is used to record memory space usage as a basis for memory allocation.
- Memory allocation function, the system allocates memory space for the user program according to a certain memory allocation algorithm
- Memory recycling function, the system to the user no longer need memory through the user's release request to complete the system recycling function.
- Memory protection
Ensure that each user program runs in its own memory space and does not interfere with each other.
- Address mapping
Memory Management provides a geo-mapping capability to translate the logical addresses in the address space into the corresponding physical addresses of the memory space.
- Memory expansion
Memory expansion in memory management does not lose the capacity to expand physical memory, but instead of the virtual storage technology, the logical expansion of memory capacity, so that users feel the memory capacity is much larger than the actual memory capacity.
Device Management features
Manage all peripheral devices in the computer system, the main task is to complete the I/O request made by the user process and assign the required I/O to the user process
devices, increase CPU and I/O device utilization, increase I/o speed, and facilitate user-friendly use of I/O devices.
- Buffer Management
The introduction of buffering effectively alleviates the contradiction between CPU and I/O device speed mismatch (high speed of CPU operation, contradiction between I/O speed), and improves CPU utilization. Common buffers: A single-buffering mechanism that simultaneously transmits data in a double-buffering mechanism that is used by multiple devices simultaneously with a common buffer pool mechanism.
- Device Assignment
According to the I/O request of the user process, the existing resources of the system are assigned to the device according to a certain device.
- Equipment handling
Device processing, also known as the device driver, the basic task is to implement the communication between the CPU and the device controller, that is, the CPU sends the I/O command to the device controller, requires it to complete the specified I/O operation, and the CPU receives the interrupt request from the controller, and gives the prompt response and corresponding processing.
File management features
- Management of file storage space
Allocate a graduated external memory space for each file, provide external memory utilization, and help improve the speed of the file system.
- Directory Management
Establish their catalog entries for each file, and organize the numerous catalog items efficiently to achieve convenient file fetching by name.
- Read/write management and protection of files
- Read/write management of the file: reads data from external memory or writes data to external memory based on the user's request.
- File Protection: Prevents unauthorized users from accessing files, preventing impersonation from accessing files, and preventing the use of files in an incorrect manner
User interface
1. Command interface
- Online user interface: provided for online users, consists of a set of keyboard operation commands and interpreter programs.
- Offline user interface: For users of batch jobs, it is also called batch processing user interface, which consists of a set of job control JCL
2. Program Interface
This interface is set for user programs to access system resources in execution, is the only way the user program obtains operating system services, it consists of a set of system calls, each system call is a sub-program to complete a specific function, each time the application requires the OS to provide a certain service (function), Invokes a system call with the appropriate functionality.
3. Graphics interface
Graphical user interface using a graphical interface, with very easy to identify the various icons to the system's functions, a variety of applications and files intuitive expression.
OS Architecture design traditional operating system architecture
- Unstructured operating System (first generation OS)
- Modular architecture OS (second generation OS)
Control the complexity of large software based on decomposition and modularity principles. In order for the OS to have a clearer structure, the OS is no longer directly composed of many processes, but the OS is carefully divided into several modules with some independence and size, that is, the module interface method
- Layered Architecture OS (third-generation OS)
Client/server mode (Client/server or C/s)
- The composition of the client/server model
- Client (in fact, our computer ~): Usually on a LAN network connected to multiple network workstations (referred to as the client), each client is an autonomous computer, can handle local business, or a message to the server to request a service.
- Server: Typically a larger computer with a network file system or database system on it, it should be able to provide one or more services to all users on the web. It has been working, passively waiting for a request from the client, and once the customer has been checked for a service request, it completes the customer's request and sends the results back to the customer.
- Network system: A system for connecting all clients and servers, and for sharing communication and network resources between them.
- Client/server interaction
- Customer sends a message
- server receives messages
- Server Loopback Message
- Client receives message
- Benefits of client/server mode
- Data distribution processing and storage, the client can process and store data, do not need to put all the data on the host.
- Ease of centralized management
- Flexibility and extensibility
- Easy adaptation of application software
"Operating System Notes" I. INTRODUCTION