Presentation is loading. Please wait.

Presentation is loading. Please wait.

Operating System Structure

Similar presentations


Presentation on theme: "Operating System Structure"— Presentation transcript:

1 Operating System Structure
It is now time for us to look inside of an O.S OS designs are Monolithic system Layered system Virtual machine ExoKernels Client server system

2 Monolithic Systems “The Big Mess”
The structure is that, there is no structure. The O.S. is written as collection of procedures. Each of which can call any of the other ones whenever it needs to Each procedure in the system has a well defined interface in terms of parameters and results. To construct actual object program of O.S., one first compiles all individual procedures and then binds them all together into a single object. file using the system Linker. In terms of Information hiding there is nothing because each procedure is visible to every other procedure

3 Monolithic Systems The services provided by O.S. are requested by putting parameter in well defined places as in registers or on the stack and then executing a special trap instruction known as kernel call. This instruction Switches machine from user mode to kernel mode and transfers control to the O.S. The O.S. then examines the parameters of the call to determine which system call is to be carried out Basic structure of the O.S. can be divided into 3 parts: (a) A main program that invokes, the requested service procedures. (b) A set of service procedures that carry out system Calls. (c) A set of utility procedures that help the service procedure

4 Monolithic Systems In this model for each system Call there is one service procedures. That takes care of it. The utility procedures do things that are needed by several service procedures as fetching data from user program.

5 OS Structure - Simple Approach
MS-DOS - provides a lot of functionality in little space. Not divided into modules, Interfaces and levels of functionality are not well separated

6 MS-DOS Structure

7 OS Structure - Simple Approach
UNIX limited structuring has 2 separable parts Systems programs Kernel everything below system call interface and above physical hardware is kernel Is responsible for File system, CPU scheduling, memory management etc

8 Traditional UNIX System Structure

9 Layered Systems A first generalization of previous approach is to organize the O.S. as a hierarchy of layers Main Advantage of the layered approach is modularity Each layer uses functions and services of the lower level layers Simplifies debugging and system verification

10 Layered Systems Ex first layer can be debugged without any concern for the rest of the system, b’coz by definition it uses only the basic H/W to implement its functions Once first layer is debugged, its correct functioning can be assumed while the second layer is worked on, and so on If an error is found during the debugging of a particular layer, we know that the error must be on that layer, b’coz the layers below it are already debugged The design and implementation is simplified when the system is broken down into layers

11 Layered Systems The systems had 6 layers.
A first generalization of previous approach is to organize the O.S. as a hierarchy of layers. The first system constructed was THE system (Technische Hogeschool Eindhoven) The systems had 6 layers.

12 Layered Systems Problems with the layered approach
The appropriate definition of the various layers (because a layer can use only those layers that are at a lower level) Careful planning is necessary Ex device drivers for backing store must be lower than that of the memory management routines

13 Layered Systems Problems with the layered approach
It is less efficient than other types Ex a user program to execute an I/O operation, it executes a system call that is trapped to the I/O layer, which calls the memory-mgmt layer, through to the CPU scheduling and finally to the hardware At each layer, the parameters may be modified, data may need to be passed etc Each layer adds overhead to the system call and system call takes more time compare to non-layered system

14 Layered Systems The layering concept was present in the MULTICS Systems OS/2 WIN NT Windows 95 Instead of layers, MULTICS was organized as a series of concentric rings with inner being more privileged than outer ones. When a procedure in an outer ring wanted to call a procedure in an Inner ring, it had to make the equivalent of a systems call whose parameters were checked for validity before allowing the call to proceed.

15 Virtual Machines Timesharing system Multiprogramming
Developed by IBM originally called CP/CMS and later renamed as VM1370, which’ based on observations Timesharing system Multiprogramming An extended machine with a more convenient interface than the bare hardware. “Essence of VM/370 is to completely separate these two function”

16 Virtual Machines The heart of the systems known as virtual machine monitor runs on the bare hardware and does multiprogramming providing several virtual machine to the next layer up a shown in Fig.

17 Virtual Machines Virtual machines are exact copies of bare hardware including kernel users mode I. interrupts and everything else the real machine has. Since each virtual machine is identical to the true hardware, each one can run any O.S. that will run directly on bare hardware. Different virtual machine runs different OS. Some run on OS/360 while other run on a single user interactive system called CMS (conversational Monitor system).

18 Virtual Machines VM OS for IBM is Virtual Machine EX
By using CPU scheduling and Virtual Memory techniques, an OS can create an illusion of multiple processes Each executing its own (virtual) processor with its own (virtual) memory. Virtual Machine provides an interface that is identical to the Hardware. Each process is provided with a virtual copy of the underlying computer The resources of the physical computer are shared to create the virtual machines CPU, I/O, Memory, disks are shared & virtual copies are created.

19 Virtual Machines (Cont)
Each VM is isolated from all other VM so there are no security problems.

20 VM Architecture Users are given their own VM They can run any of the OS or S/W packages on these machines

21 Virtual Machines Examples:
Running MS-DOS on a Pentium machine (system compatibility problems are solved) Running Windows, Linux and other OS on the same machine. A program written in Java receives services from the Java Runtime Environment (JRE) software by issuing commands to, and receiving the expected results from, the Java software. By providing these services to the program, the Java software is acting as a "virtual machine", taking the place of the operating system or hardware for which the program would ordinarily be tailored. .NET Runtime uses CLR

22 Exo-Kernels With VM/370 each user gets an exact copy of the actual computer With virtual 8086 mode on Pentium, each user process gets an exact copy of a different computer MIT have built a system that gives each user a clone of the actual computer, but with a subset of the resources One VM might get disk blocks 0 to 1023, the next might get blocks 1024 to 2047, and so on. At the bottom layer, running in kernel mode, is a program called exokernel. Its job is to allocate resources to virtual Machines and then check attempts to use them to make sure no machine is trying to use somebody else’s resources.

23 Exokernels Each user level virtual machine can run its own OS as on VM/370 and the Pentium virtual 8086s, except that each one is restricted to using only the resources it has asked for and been allocated. The advantage of exokernel scheme is that it saves a layer of mappings. (remapping not required) In other VM monitor must maintain tables to remap disk addresses (all other resources) The exokernel keeps track of which virtual machine has been assigned which resources. Separating multiprogramming from the user operating system

24 Client-Server System A usual approach is to implement most of O.S. function in user processes. To request a service, a “user process or client process” sends a request to a server process.

25 Client-Server System All the kernel does is to handle the communication between clients and servers. All servers run as user mode processes and not in kernel mode, they don’t have direct access to the hardware. As a consequence if a bug in the file server is triggered the file service may crash but this won’t bring the whole machine down.

26 Client-Server System Another advantage of the client-server model is its adaptability to use in distributed system. If a client communicates with a server by sending it messages. The client needn’t know whether messages is handled locally in its own machine or whether it was sent across network to a server on a remote machine


Download ppt "Operating System Structure"

Similar presentations


Ads by Google