operating system is a regular program, so it would be logical to organize it in the same way as most programs are organized, that is, composed of procedures and functions. In this case the components operating system are not independent modules, A components one big program. This structure operating system called monolithic core(monolithic kernel). A monolithic kernel is a collection of procedures, each of which can call each one. All procedures run in privileged mode. Thus, monolithic core- this is such a scheme operating system, in which all its components are parts of one program, use common data structures and interact with each other by directly calling procedures. For monolithic operating system the core coincides with the entire system.

In many operating systems With monolithic core kernel assembly, that is, its compilation, is carried out separately for each computer on which it is installed operating system. In this case, you can select a list of hardware and software protocols, support for which will be included in the kernel. Since the kernel is a single program, recompilation is the only way to add new components to it or remove unused ones. It should be noted that the presence of unnecessary components in the kernel is extremely undesirable, since the kernel is always located entirely in RAM. In addition, the exception unnecessary components increases reliability operating system generally.

Monolithic core - the oldest way organizations operating systems. Example of systems with monolithic core is most Unix systems.

Even in monolithic systems, some structure can be discerned. Just as in a concrete block one can distinguish inclusions of crushed stone, so in a monolithic core one can distinguish inclusions of service procedures corresponding system calls. Service procedures run in privileged mode, while user programs run in non-privileged mode. Home can sometimes be used to move from one privilege level to another. service program, which determines which system call was made, the correctness of the input data for this call and transfers control to the corresponding service procedure with a transition to the privileged operating mode. Sometimes there is also a set of software utilities that help perform service procedures.

Layered systems

Continuing the structuring, it is possible to break the entire computing system into a number of smaller levels with well-defined connections between them, so that objects at level N can only call objects at level N-1. The lower level in such systems is usually hardware, the upper level is the user interface. The lower the level, the more privileged commands and actions a module located at this level can perform. This approach was first applied when creating the THE (Technishe Hogeschool Eindhoven) system by Dijkstra and his students in 1968. This system had the following levels:


Rice. 1.2.

Layered systems are well implemented. When using lower layer operations, you don't need to know how they are implemented, you just need to understand what they do. Layered systems are well tested. Debugging starts from the bottom layer and is carried out layer by layer. When an error occurs, we can be sure that it is in the layer under test. Layered systems are easily modified. If necessary, you can replace only one layer without touching the others. But layered systems are difficult to develop: it is difficult to correctly determine the order of layers and what belongs to which layer. Layered systems are less efficient than monolithic ones. So, for example, to perform I/O operations, the user program will have to sequentially go through all the layers from top to bottom.

Virtual machines

At the beginning of the lecture we talked about looking at operating system How on virtual machine when the user does not need to know the details internal structure computer. It works with files, not with magnetic heads and engine; it works with a huge virtual one, not a limited real one RAM; he doesn’t care much whether he is the only user on the machine or not. Let's consider a slightly different approach. Let operating system implements virtual machine for each user, but not making his life easier, but, on the contrary, complicating it. Each one is like this virtual machine appears before the user as bare metal - a copy of all the hardware in computing system, including the processor, privileged and unprivileged instructions, I/O devices, interrupts, etc. And he is left alone with this iron. When you try to access such virtual hardware at the level of privileged commands, in reality a system call occurs to the real operating system, which performs all the necessary actions. This approach allows each user to upload their own operating system on virtual machine and do with it whatever your heart desires.


Rice. 1.3.

The first real system of this kind was the CP/CMS system, or VM/370 as it is now called, for the IBM/370 family of machines.

The disadvantage of such operating systems is a decrease in efficiency virtual machines compared to a real computer, and they tend to be very bulky. The advantage lies in the use on one computer system of programs written for different operating systems.

Microkernel architecture

Current trend in development operating systems consists of transferring a significant part of the system code to the user level and simultaneously minimizing the kernel. We are talking about an approach to building a kernel called microkernel architecture(microkernel architecture) operating system, when most of its components are independent programs. In this case, the interaction between them is ensured by a special kernel module called a microkernel. The microkernel runs in privileged mode and provides interaction between programs, scheduling of processor usage, primary processing interrupts, I/O operations, and basic memory management.


Rice. 1.4.

The remaining components of the system communicate with each other by passing messages through the microkernel.

Main advantage microkernel architecturehigh degree kernel modularity operating system. This makes it much easier to add new components to it. In microkernel operating system you can, without interrupting its operation, load and unload new drivers, file systems, etc. The process of debugging kernel components is significantly simplified, since a new version drivers can be loaded without restarting the entire operating system. Kernel components operating system are not fundamentally different from user programs, so you can use the usual tools to debug them. Microkernel architecture increases system reliability because a failure at the unprivileged program level is less dangerous than a failure at the kernel mode level.

In the same time microkernel architecture operating system introduces additional overhead associated with message passing, which significantly impacts performance. In order for microkernel operating system was not inferior in speed operating systems on the base

  • virtual memory address space management.
  • management of processes and threads (threads).
  • means of interprocess communication.
  • All other OS services, provided directly by the kernel in classic monolithic kernels, are implemented in the user address space (Ring3) in microkernel architectures and are called services. Examples of such services brought into user space in microkernel architectures are network services, file system, and drivers.

    The main advantage of microkernel architecture is the high degree of modularity of the operating system kernel. This makes it much easier to add new components to it. In a microkernel operating system, you can load and unload new drivers, file systems, etc. without interrupting its operation. The process of debugging kernel components is greatly simplified, since a new version of the driver can be loaded without restarting the entire operating system. The components of the operating system kernel are no fundamentally different from user programs, so you can use ordinary tools to debug them. Microkernel architecture improves system reliability because a failure at the unprivileged program level is less dangerous than a failure at the kernel mode level.

    And in order to add a driver for a particular device to an OS with a microkernel, you do not need to recompile the entire kernel, but only separately compile this driver and run it in user space.

    At the same time, the microkernel operating system architecture introduces additional messaging overhead, which negatively impacts performance. In order for a microkernel operating system to be as fast as operating systems based on a monolithic kernel, it is necessary to very carefully design the division of the system into components, trying to minimize the interaction between them. Thus, the main difficulty in creating microkernel operating systems is the need for very careful design.

    A classic example of a microkernel system is Symbian OS. This is an example of a common and proven microkernel (and starting with Symbian OS v8.1, and nanokernel) operating system.

    The creators of Symbian OS managed to combine efficiency and conceptual harmony, despite the fact that modern versions of this system provide extensive capabilities, including tools for working with streaming data, protocol stacks that are critical to kernel latency, graphics and video high resolution). Symbian developers have moved almost all application (i.e., beyond the competence of the kernel) tasks into server modules operating in the user address space.

    In Windows NT version 3.x, a microkernel architecture with a service process was used for the graphics subsystem and user interface. In particular, the graphics driver was loaded in the context of the service process, not the kernel. Starting from version 4, this was abandoned; the service process was retained only for managing console windows command line, and the graphics subsystem itself, together with the hardware driver (including three-dimensional graphics) moved to a specially separate region of the OS kernel.

    Windows CE OS (and assemblies created on its basis, such as Windows Mobile), being almost completely compatible (as a subset) with Windows NT in terms of calls and application programming methods, is nevertheless completely different from Windows NT in internal architecture and is microkernel OS with the removal of all device drivers, network stacks and graphics subsystem into service processes.

    Disadvantage - the fee for forced “switching” of processes in the kernel (context switching); this fact actually explains the difficulties in designing and writing kernels of such a design. These shortcomings can be circumvented by OSs using the exokernel architecture, which is further development microkernel architecture.

    see also

    Microkernels
    Microkernel-based OS

    Wikimedia Foundation. 2010.

    Synonyms:

    See what a “Microkernel” is in other dictionaries:

      Microkernel... Spelling dictionary-reference book

      The central part of the operating system, which performs the main system management functions: virtual memory management; process execution support; organization of process interaction; servicing data input/output and interrupts. By… … Financial Dictionary- This term has other meanings, see L4. This article should be Wikified. Please format it according to the rules for formatting articles... Wikipedia

    In microkernel operating systems, we can identify a central compact module that belongs to the supervisory part of the system. This module is very small in size and performs a relatively small number of control functions, but allows control to be transferred to other control modules, which will perform the requested function. The microkernel is the minimal core part of the operating system, serving as the basis for modular and portable extensions. The microkernel itself is a system module software operating in the highest priority state of the computer and maintaining communications with the rest of the operating system, which is considered as a set server applications(services).

    In the 90s of the 20th century, it was a very common belief that most operating systems of the next generations would be built as microkernel ones. However, practice shows that this is not entirely true. Developers want to have a compact microkernel, but at the same time include as many functions as possible that are performed directly by this software module. Because the execution of the requested function by another module called from the microkernel leads to additional delays and additional complications. Moreover, there are a lot of different opinions about how operating system services should be organized in relation to the microkernel; how to design device drivers to achieve the greatest efficiency while maintaining functionality


    290______________________________ Chapter 9. Operating systems architecture

    drivers that are as independent as possible from the hardware; whether non-kernel operations should be performed in kernel space or user space; Is it worth keeping the programs of existing subsystems (for example, UNIX) or is it better to discard everything and start from scratch.

    The main idea behind microkernel technology is to create the necessary environment top level hierarchy from which you can easily access all functionality level hardware. In this case, the microkernel is the starting point for the creation of all other system modules. All these other modules, which implement the functions necessary for the system, are called from the microkernel and perform a service role. At the same time, they receive the status of a normal process or task. We can say that microkernel architecture corresponds to client-server technology. It is this technology that makes it possible to implement the above principles of operating system design to a greater extent and with less labor.

    The most important task of developing a microkernel is to select the basic primitives that must be in the microkernel to provide the necessary and sufficient service. The microkernel contains and executes the minimum amount of code necessary to implement basic system calls. These calls include message passing and other communication between processes external to the microkernel, support for interrupt management, and a number of other very few functions. The remaining system functions characteristic of “regular” (non-microkernel) operating systems are provided as modular add-on processes that interact primarily with each other and interact through message passing.

    For most microkernel operating systems, the basis for this architecture is the Mach microkernel technology. This operating system was created at Carnegie Mellon University, and many developers followed its example.

    The functions performed by the microkernel are limited in order to reduce its size and maximize the amount of code that works as application program. The microkernel includes only those functions that are required to define a set of abstract processing environments for application programs and to allow applications to work together. As a result, the microkernel provides only five various types services:

    Virtual memory management;

    Support for jobs and threads;

    Inter-Process Communication (IPC);
    - management of I/O support and interrupts;

    Host 1 and processor services.

    1 Host - main computer. Nowadays, this term refers to any computer that has an IP address.


    Microkernel OS ________________ 291

    Other operating system subsystems and functions such as file systems, support external devices and traditional software interfaces, are formalized as system services or receive the status of ordinary processing tasks. These programs run as microkernel applications.

    Using the concept of multiple threads of execution per task, the microkernel creates an application environment that allows the use of multiprocessors; In this case, it is not at all necessary that the machine be multiprocessor: on a single-processor machine, different threads simply execute at different times. All the support required for multiprocessor machines is concentrated in a relatively small and simple microkernel.

    Thanks to your small sizes and the ability to support other services as normal processes running alongside application programs, microkernels themselves are simpler than monolithic or modular operating system kernels. With a microkernel, the supervisory part of the operating system is broken down into modular parts that can be configured in a number of ways, allowing larger systems to be built by adding parts to smaller ones. For example, each hardware-independent neutral service is logically separate and can be configured different ways. Microkernels also make it easier to support multiprocessors by creating a standard software environment, which can use several processors if there are any, but if they are not, it runs on one. Specialized code for multiprocessors is limited to the microkernel itself. Moreover, networks of microkernels communicating with each other can be used to provide operational system support for the emerging class of massively parallel machines.

    In some cases, using the microkernel approach in practice encounters certain difficulties, which is manifested in a slight slowdown in the speed of execution of system calls when passing messages through the microkernel compared to the classical approach. On the other hand, the opposite can be stated. Because microkernels are small and highly optimized, under certain conditions they can provide the real-time performance required for device control and high-speed communications. Finally, well-structured microkernels provide an insulating layer against hardware differences that are not masked by the use of programming languages. high level. In this way, they make it easier to port code and increase the level of code reuse.

    The most prominent representative of microkernel operating systems is the QNX real-time operating system. The QNX microkernel only supports process scheduling and dispatching, process communication, interrupt handling, and network services lower level (for more information about the QNX OS, see Chapter 10). This microkernel provides only a couple of dozen system calls, but thanks to this it can be located entirely in the internal cache of even processors such as the Intel 486. As is known, different versions This operating system also had different core sizes - from 8 to 46 KB.


    292______________________________ Chapter 9. Operating systems architecture

    To build a minimal QNX system, you need to add a process manager to the microkernel, which creates and manages processes and process memory. To make the QNX operating system applicable to more than just embedded and diskless systems, you need to add file system and device manager. These managers execute outside of kernel space, so the kernel remains small.

    In microkernel operating systems, one can distinguish a central compact module that belongs to the supervisory part of the system. This module is very small in size and performs a relatively small number of control functions, but allows control to be transferred to other control modules, which will perform the requested function. Microkernel- this is the minimal main (core) part of the operating system, serving as the basis for modular and portable extensions. The microkernel itself is a system software module that runs in the computer's highest-priority state and communicates with the rest of the operating system, which is considered a set of server applications (services).

    In the 90s of the 20th century, it was a very common belief that most operating systems of the next generations would be built as microkernel ones. However, practice shows that this is not entirely true. Developers want to have a compact microkernel, but at the same time include as many functions as possible that are performed directly by this software module. Because the execution of the requested function by another module called from the microkernel leads to additional delays and additional complications. Moreover, there are many different opinions about how operating system services should be organized in relation to the microkernel; how to design device drivers to achieve the greatest efficiency, but keep driver functions as independent from the hardware as possible; whether non-kernel operations should be performed in kernel space or user space; Is it worth keeping the programs of existing subsystems (for example, UNIX) or is it better to discard everything and start from scratch.

    The main idea behind microkernel technology is to create the necessary environment at the top level of the hierarchy from which all hardware-level functionality can be easily accessed. In this case, the microkernel is the starting point for the creation of all other system modules. All these other modules, which implement the functions necessary for the system, are called from the microkernel and perform a service role. At the same time, they receive the status of a normal process or task. We can say that microkernel architecture corresponds to client-server technology. It is this technology that makes it possible to implement the above principles of operating system design to a greater extent and with less labor.

    The most important task of developing a microkernel is to select the basic primitives that must be in the microkernel to provide the necessary and sufficient service. The microkernel contains and executes the minimum amount of code necessary to implement basic system calls. These calls include message passing and other communication between processes external to the microkernel, support for interrupt management, and a number of other very few functions. The remaining system functions characteristic of “regular” (non-microkernel) operating systems are provided as modular add-on processes that interact primarily with each other and interact through message passing.

    For most microkernel operating systems, the basis for this architecture is the Mach microkernel technology. This operating system was created at Carnegie Mellon University, and many developers followed its example.

    The functions performed by the microkernel are limited in order to reduce its size and maximize the amount of code that runs as an application program. The microkernel includes only those functions that are required to define a set of abstract processing environments for application programs and to allow applications to work together. As a result, the microkernel provides only five different types of services:

    • virtual memory management;
    • support for jobs and threads;
    • interaction between processes (Inter-Process Communication, IPC);
    • I/O support and interrupt management;
    • host and processor services.

    Other operating system subsystems and functions, such as file systems, external device support, and traditional software interfaces, are packaged as system services or given the status of ordinary processing tasks. These programs run as microkernel applications.

    Using the concept of multiple threads of execution per task, the microkernel creates an application environment that allows the use of multiprocessors; In this case, it is not at all necessary that the machine be multiprocessor: on a single-processor machine, different threads simply execute at different times. All the support required for multiprocessor machines is concentrated in a relatively small and simple microkernel.

    Because of their small size and ability to support other services as normal processes running alongside application programs, microkernels themselves are simpler than monolithic or modular operating system kernels. With a microkernel, the supervisory part of the operating system is broken down into modular parts that can be configured in a number of ways, allowing larger systems to be built by adding parts to smaller ones. For example, each hardware-independent neutral service is logically separate and can be configured in different ways. Microkernels also make it easier to support multiprocessors by creating a standard software environment that can use multiple processors if they exist, but run on one if they don't. Specialized code for multiprocessors is limited to the microkernel itself. Moreover, networks of microkernels communicating with each other can be used to provide operational system support for the emerging class of massively parallel machines.

    In some cases, using the microkernel approach in practice encounters certain difficulties, which is manifested in a slight slowdown in the speed of execution of system calls when passing messages through the microkernel compared to the classical approach. On the other hand, the opposite can be stated. Because microkernels are small and highly optimized, under certain conditions they can provide the real-time performance required for device control and high-speed communications. Finally, well-structured microkernels provide an insulation layer against hardware differences that are not masked by the use of high-level programming languages. In this way, they make it easier to port code and increase the level of code reuse.

    The most prominent representative of microkernel operating systems is the QNX real-time operating system. The QNX microkernel only supports process scheduling and dispatching, process communication, interrupt handling, and lower-level network services. This microkernel provides only a couple of dozen system calls, but thanks to this it can be located entirely in the internal cache of even processors such as the Intel 486. As is known, different versions of this operating system had different core sizes - from 8 to 46 KB.

    Lecture text

    Key questions

    Lecture No. 2. Architecture of operating systems. Part 1

    · Purpose and objectives of the course.

    · Information and data.

    · Basic concepts and definitions: disk operating systems (DOS); OS general purpose; systems of intermediate types, Virtual machine systems; Real-time systems; Cross-development systems; systems of intermediate types.

    · Basic concepts and definitions: Microkernel.

    · History of systems development.

    · Purpose and main components of the SDB.

    · Monolithic operating systems..

    The structure and complexity of operating systems changes significantly as both the operating systems themselves and the hardware evolve. The CTSS operating system, developed at the Massachusetts Institute of Technology (MIT) in 1963, occupied about 36 thousand 36-bit words in memory. OS/360, developed by IBM a year later, already contained more than a million machine commands. The Multics system, jointly developed by specialists from MIT and Bell Laboratories in 1975, already contained about 20 million commands.

    The increasing size and complexity of operating systems has led to three common problems:

    Operating systems reach the user with a significant delay,

    There are hidden errors in the systems that require correction,

    The performance gains in operating systems are not as great as we would like.

    The ways to solve these problems are, generally speaking, quite obvious:

    The system should consist of modules - this simplifies its writing and debugging,

    Modules should have carefully designed and extremely simple interfaces - this also makes it easier to write and debug, as well as make changes to the system.

    Despite the obviousness of this solution, it turned out that for complex systems consisting of millions or more lines, it does not eliminate all problems.

    The structure of the operating system largely depends on which type it belongs to. There are many types of operating systems, but by and large the following can be distinguished:

    Micronuclear,

    Monolithic,

    Multi-level,

    Virtual machines,

    exonucleus,

    Client-server model.

    Microkernel- This is a minimal part of the operating system, which is the basis for modular and portable extensions. The main idea of ​​a microkernel is to create the necessary top-level environment from which all hardware-level functions can be accessed.

    The microkernel contains the minimum amount of code required to implement basic system calls. These calls include message passing and other communications between processes external to the kernel, interrupt management, and some other functions. The remaining functions are implemented as modular add-ons that interact with each other using messages.



    The microkernel runs at highest priority and powers the rest of the operating system as a set of server applications. Mach microkernel technology was created at Carnegie Mellon University and serves as the basis for many operating systems.

    The functionality of the microkernel is limited in order to reduce its size and transfer most of the operating system to the rank of an application program. Typically a microkernel supports five different types of services:

    Virtual memory management,

    Job and flow management,

    Interprocess communication (IPC – inter-process communication),

    I/O and interrupt management

    Providing client-server service.

    Other operating system functions reside in other OS services that run as microkernel applications.

    The essence of microkernel architecture is as follows. Only a very small part of the operating system, called the microkernel, runs in privileged mode. The microkernel is protected from the rest of the OS and from applications. The set of functions of a microkernel corresponds to the functions of the layer of basic mechanisms of a regular kernel. These are functions that cannot be performed in user mode. Figure 1.2 shows the mechanism for moving the bulk of kernel functions into user space.

    Because of its size and ability to support standard programming services, a microkernel is simpler than the kernels of monolithic or modular operating systems.

    Figure 4.1 – Transferring the bulk of kernel functions to user space

    All other kernel functions are packaged as applications running in user mode. There are no clear recommendations about which system functions should be performed in privileged mode and which in user mode.

    Resource managers placed in user mode are called OS servers, since their main purpose is to serve requests from applications and other OS modules. To implement this mechanism, the OS must have effective way calling procedures of one process from another. Supporting this mechanism is the main function of the microkernel.

    Figure 4.2 shows the mechanism for accessing OS functions designed as servers. The client, which can be either an application program or another component of the operating system, requests the execution of some function from the corresponding server by sending it a message. Direct message transfer between applications is not possible, since their address spaces are isolated from each other. The microkernel, running in privileged mode, has access to all address spaces and can therefore act as an intermediary. Thus, the operation of a microkernel operating system corresponds to the client-server model, in which the role of transport is performed by the microkernel.

    The most prominent representative of microkernel operating systems is the QNX real-time operating system. The QNX microkernel plans only for process scheduling and dispatching, process communication, interrupt handling, and lower-level network services. Such a microkernel provides only two dozen system calls and has a size of 8 to 46 kilobytes.

    Figure 4.2 – Implementation system call in microkernel architecture

    To build a minimal QNX system, a process manager must be added to the microkernel, which creates processes and manages them and their memory. To use QNX on a desktop PC, a file system and device manager must also be added to the microkernel.

    All of these managers run outside of kernel space, so the kernel remains small.

    Let's briefly consider the advantages and disadvantages of microkernel operating systems. Their advantages include:

    Portability due to the fact that all machine-dependent code is isolated in the microkernel,

    Extensibility due to a limited set of well-defined microkernel interfaces; adding a new subsystem requires the development of a new application, which does not affect the integrity of the microkernel,

    Reliability due to the fact that each server runs as a separate process in its own memory area, which protects it from other OS servers (in a traditional operating system, all modules can influence each other); The reduced volume of microkernel code also contributes to increased reliability,

    Suitable for distributed computing, as it uses client-server interaction mechanisms, and microkernel OS servers can be located either on the same or on different computers.

    The main disadvantage of a microkernel OS is its reduced performance compared to a classic OS. The fact is that with the classical organization of the OS, the execution of a system call is accompanied by two mode switches, and with a microkernel architecture - four. The situation is illustrated in Figure 4.3.

    Figure 4.3 – Changing modes when performing a system call

    The severity of this shortcoming is well illustrated by the history of the development of Windows NT. In versions 3.1 and 3.5, the window manager, graphical shell and high-level drivers graphics devices were included in the server user mode, and calling these functions was carried out in accordance with the microkernel circuit. However, it became clear to the developers that such a mechanism significantly reduces the performance of the system, so in version 4.0 the modules listed above were included in the kernel. This fact moved the OS away from the ideal microkernel architecture, but made the system more productive.