Explain different Operating System structures or Explain structures of OS (Operating System)

-> The six designs we will discuss here are monolithic systems, layered systems, microkernels, client-server systems, virtual machines, and exokernels.

1. Monolithic Systems

-> By far the most common organization, in the monolithic approach the entire operating system runs as a single program in kernel mode.
-> The operating system is written as a collection of procedures, linked together into a single large executable binary program.
-> When this technique is used, each procedure in the system is free to call any other one, if the latter provides some useful computation that the former needs.
-> Being able to call any procedure you want is very efficient, but having thousands of procedures that can call each other without restriction may also lead to a system that is unwieldy and difficult to understand.
-> To construct the actual object program of the operating system when this approach is used, one first compiles all the individual procedures (or the files containing the procedures) and then binds them all together into a single executable file using the system linker.
-> Even in monolithic systems, however, it is possible to have some structure. The services (system calls) provided by the operating system are requested by putting the parameters in a well-defined place (e.g., on the stack) and then executing a trap instruction.
-> This organization suggests a basic structure for the operating system:
1. A main program that invokes the requested service procedure.
2. A set of service procedures that carry out the system calls.
3. A set of utility procedures that help the service procedures.

2. Layered System

-> A generalization of the approach of figure is to organize the operating system as a hierarchy of layers, each one constructed upon the one below it.
-> The first system constructed in this way was the THE system built at the Technische Hogeschool Eindhoven in the Netherlands by E. W. Dijkstra (1968) and his students.
-> The system had six layers. Layer 0 dealt with allocation of the processor, switching between processes when interrupts occurred or timers expired. Above layer 0, the system consisted of sequential processes, each of which could be programmed without having to worry about the fact that multiple processes were running on a single processor. In other words, layer 0 provided the basic multiprogramming of the CPU.
-> Layer 1 did the memory management. It allocated space for processes in main memory and on a 512K word drum used for holding parts of processes (pages) for which there was no room in main memory.
-> Layer 2 handled communication between each process and the operator console (that is, the user). On top of this layer each process effectively had its own operator console.
-> Layer 3 took care of managing the I/O devices and buffering the information streams to and from them. Above layer 3 each process could deal with abstract I/O devices with nice properties, instead of real devices with many peculiarities.
-> Layer 4 was where the user programs were found. They did not have to worry about process, memory, console, or I/O management. The system operator process was located in layer 5.
-> A further generalization of the layering concept was present in the MULTICS system.

3. Microkernels

-> Traditionally, all the layers went in the kernel, but that is not necessary. In fact, a strong case can be made for putting as little as possible in kernel mode because bugs in the kernel can bring down the system instantly.
-> In contrast, user processes can be set up to have less power so that a bug there may not be fatal.
-> The basic idea behind the microkernel design is to achieve high reliability by splitting the operating system up into small, well-defined modules, only one of which the microkernel runs in kernel mode and the rest run as relatively powerless ordinary user processes.
-> By running each device driver and file system as separate user processes, a bug in one of these can crash that component but cannot crash the entire system.
-> Examples of microkernel are Integrity, K42, L4, PikeOS, QNX, Symbian, and MINIX 3.
-> MINIX 3 microkernel is only 3200 lines of C code and 800 lines of assembler for low level functions such as catching interrupts and switching processes.
-> The C code manages and schedules processes, handles inter-process communication and offer a set of about 35 systems calls to the rest of OS to do its work.
-> The process structure of MINIX 3 is shown in figure, with kernel call handler labeled as Sys.
-> The device driver for the clock is also in the kernel because the scheduler interacts closely with it. All the other device drivers run as separate user processes.
-> Outside the kernel, the system is structureas three layers of processes all running in user mode.
-> The lowest layer contains the device driver. Since they run in user mode they do not have access to the I/O port space and cannot issue I/O commands directly. 
-> Above driver is another user mode layer containing servers, which do most of the work of an operating system.
-> One interesting server is the reincarnation server, whose job is to check if the other servers and drivers are functioning correctly. In the event that a faulty one is detected, it is automatically replaced without any user intervention.
-> All the user programs lie on the top layer.

4. Client Server Model

-> A slight variation of the microkernel idea is to distinguish classes of processes in two categories.
-> First one is the servers, each of which provides some services, and the second one is clients, which use these services.
-> This model is known as the Client Server model.
-> Communication between clients and servers is done by message passing.
-> To obtain a service, a client process constructs a message saying what it wants and sends it to the appropriate services.
-> The service then does the work and sends back the answer.
-> The generalization of this idea is to have the clients and servers run on different computers, connected by a local or wide area network.
-> Since a client communicates with a server by sending messages, the client need not know whether the message is handled locally in its own machine, or whether it was sent across a network to a server on a remote machine.
-> A PC sends a request for a Web page to the server and the Web page comes back.
-> This is a typical use of client-server model in a network.

5. Virtual Machine

-> The initial releases of OS/360 were strictly batch systems. But many users wanted to be able to work interactively at a terminal, so OS designers decided to write timesharing systemfor it.
-> The heart of the system, known as the virtual machine monitor, run on the bare hardware and does the multiprogramming, providing not just one but several virtual machines to the next layer up.
-> Each virtual machine is identical to the true hardware; each one can run any OS that will run directly on the bare hardware.
-> Different virtual machines can run different operating systems.
-> On VM/370, some run OS/360 while the others run single-user interactive system called CMS (Conversational Monitor System) for interactive timesharing users.
-> When CMS program executed a system call, a call was trapped to the operating system in its own virtual machine, not on VM/370. CMS then issuethe normal hardware I/O instruction for reading its virtual disk or whatever was needed to carry out the call.
-> These I/O instructions were trapped by VM/370 which then performs them.
-> The idea of a virtual machine is heavily used nowadays in a different context.
-> An area where virtual machines are used, but in a somewhat different way, is for running Java programs.
-> When Sun Microsystems invented the Java programming language, it also invented a virtual machine (i.e., a computer architecture) called the JVM (Java Virtual Machine).
-> The Java compiler produces code for JVM, which then typically is executed by a software JVM interpreter.
-> The advantage of this approach is that the JVM code can be shipped over the Internet to any computer that has a JVM interpreter and run there.

6. Exokernel

-> Rather than cloning (copying) the actual machine, as is done with virtual machines, another strategy is partitioning it.
-> In other words, giving each user a subset of the resource.
-> For example one virtual machine might get disk blocks 0 to 1023, the next one might get block 1024 to 2047, and so on.
-> Program running at the bottom layer (kernel mode) called the exokernel. Its job is to allocate resources to virtual machines and then check attempt to use them to make sure no machine is trying to use somebody else’s resources.
-> The advantage of the exokernel scheme is that it saves a layer of mapping.
-> In the other designs, each virtual machine thinks it has its own disk, with blocks running from 0 to some maximum, so the virtual machine monitor must maintain tables to remap disk addresses.
-> In exokernel remapping is not needed. The exokernel need only keep track of which virtual machine has been assigned which resource. 

Post a Comment

GTU done 2018 |