130 73
English Pages [18]
Operating System Structure
Introduction An operating system is a design that enables user application programs to communicate with the hardware of the machine. The operating system should be built with the utmost care because it is such a complicated structure and should be simple to use and modify. Partially developing the operating system is a simple approach to accomplish this. Each of these components needs to have distinct inputs, outputs, and functionalities. Following are the structures that implement operating systems ➢
Simple Structure
➢
Monolithic Structure
➢
Layered Approach Structure
➢
Micro-Kernel Structure
➢
Exo-Kernel Structure
➢
Virtual Machines 2
Layered Systems ➢
With layered approach, the operating system is broken up into a hierarchy of layers.
➢
The bottom layer is the hardware and the highest layer is the user-interface as shown in figure below:
Fig. A Layered OS
3
Layered Systems Cont. The layered structure approach breaks up the operating system into different layers and retains much more control on the system. The bottom layer (layer 0) is the hardware, and the topmost layer (layer N) is the user interface. These layers are so designed that each layer uses the functions of the lower-level layers only. It simplifies the debugging process as if lower-level layers are debugged, and an error occurs during debugging. The error must be on that layer only as the lower-level layers have already been debugged. The main advantage is the simplicity of construction and debugging. The main difficulty is defining the various layers. An example of this type of operating system structure is UNIX.
4
Advantages of Layered Structure ➢
Modularity- There is a limitation to every layer as each layer will do its task only that it is designed for.
➢
Easy debugging- Since the tasks are specific for every layer, it is easy to debug.
➢
Easy update- Since all the layers are limited to themselves only, updating is easy as it does not affect any other layers near it.
➢
No direct access to hardware- If we want to access the hardware directly, it is not possible in the layers structure design. The process needs to travel through each layer one by one before reaching the hardware layer
➢
Abstraction- Each layer of the layered structure has its function so here we can see abstraction.
5
Disadvantages of Layered Structure ➢
Complex and careful implementation- In this structure, a particular layer can access the service of a layer that is below it, so the placement and arrangement of the layers should be done precisely so that a task can execute in a good flow throughout the layers.
➢
Slower execution- In this structure, we can not access a layer directly that is away from a particular layer. There is a request generated that allows the process to travel from one layer to another layer. So, the execution takes time in this structure. The response time increased here which is not seen in earlier monolithic systems.
6
Kernel Kernel is a computer program that is a core or heart of an operating system. ➢
Kernel is the core part of an OS(Operating system); hence it has full control over everything in the system. Each operation of hardware and software is managed and administrated by the kernel.
➢
It acts as a bridge between applications and data processing done at the hardware level. It is the central component of an OS.
➢
➢
It is the part of the OS that always resides in computer memory and enables the communication between software and hardware components. It is the computer program that first loaded on start-up the system (After the bootloader). Once it is loaded, it manages the remaining start-ups. It also manages memory, peripheral, and I/O requests from software. Moreover, it translates all I/O requests into data processing instructions for the CPU. It manages other tasks also such as memory management, task management, and disk management. 7
Kernel Cont. ➢
A kernel is kept and usually loaded into separate memory space, known as protected Kernel space. It is protected from being accessed by application programs or less important parts of OS.
➢
Other application programs such as browser, word processor, audio & video player use separate memory space known as user-space.
➢
Due to these two separate spaces, user data and kernel data don't interfere with each other and do not cause any instability and slowness.
8
Monolithic/Macro Kernel In a monolithic kernel, the same memory space is used to implement user services and kernel services. ➢
It means, in this type of kernel, there is no different memory used for user services and kernel services.
➢
As it uses the same memory space, the size of the kernel increases, increasing the overall size of the OS.
➢
The execution of processes is also faster than other kernel types as it does not use separate user and kernel space.
Examples of Monolithic Kernels are Unix, Linux, Open VMS, XTS-400, etc. If all the components and functionalities of a project are entangled and combined in a single codebase, then that is a monolithic application. 9
Micro/Exo kernel A microkernel is also referred to as μK, and it is different from a traditional kernel or Monolithic Kernel. In this, user services and kernel services are implemented into two different address spaces: ●
user space
●
and kernel space.
Since it uses different spaces for both the services, so, the size of the microkernel is decreased, and which also reduces the size of the OS. Microkernels are easier to manage and maintain as compared to monolithic kernels. Still, if there will be a greater number of system calls and context switching, then it might reduce the performance of the system by making it slow. These kernels use a message passing system for handling the request from one server to another server. 10
Micro/Exo kernel Cont. Only some essential services are provided by microkernels, such as defining memory address spaces, IPC(Interprocess Communication), and process management. Other services such as networking are not provided by Kernel and handled by a user-space program known as servers. One of the main disadvantages of monolithic kernels that an error in the kernel can crash the whole system, can be removed in the microkernel. As in a microkernel, if a kernel process crashes, the crashing of the whole system can still be prevented by restarting the error-caused services. Examples of Microkernel are L4, AmigaOS, Minix, K42, etc.
11
Client-Server Model The Client-server model is a distributed application structure that partitions task or workload between the providers of a resource or service, called servers, and service requesters called clients. In the client-server architecture, when the client computer sends a request for data to the server through the internet, the server accepts the requested process and deliver the data packets requested back to the client. Clients do not share any of their resources. Examples of Client-Server Model are Email, World Wide Web, etc.
12
How the Client-Server Model works? ➢
Client: When we talk the word Client, it mean to talk of a person or an organization using a particular service. Similarly in the digital world a Client is a computer (Host) i.e. capable of receiving information or using a particular service from the service providers (Servers).
➢
Servers: Similarly, when we talk the word Servers, It mean a person or medium that serves something. Similarly in this digital world a Server is a remote computer which provides information (data) or access to particular services. So, its basically the Client requesting something and the Server serving it as long as its present in the database.
13
Virtual Machines A virtual machine (VM) is a virtual environment which functions as a virtual computer system with its own CPU, memory, network interface, and storage, created on a physical hardware system. VMs are isolated from the rest of the system, and multiple VMs can exist on a single piece of hardware, like a server. That means, it as a simulated image of application software and operating system which is executed on a host computer or a server. It has its own operating system and software that will facilitate the resources to virtual computers.
14
Virtual Machines Cont. When we run different processes on an operating system, it creates an illusion that each process is running on a different processor having its own virtual memory, with the help of CPU scheduling and virtual-memory techniques. There are additional features of a process that cannot be provided by the hardware alone like system calls and a file system. The virtual machine approach does not provide these additional functionalities but it only provides an interface that is same as basic hardware. Each process is provided with a virtual copy of the underlying computer system. Nowadays, the idea of a virtual machine is heavily used in a variety of context:
Windows and other operating system for running old MS-DOS programs.
Sun Microsystems invented a virtual machine called the JVM for running Java programs.
15
➢
Shell
An OS shell is a software component that presents a user interface to various operating system functions and services.
➢
It is an outer layer of interface between the user and the operating system.
➢
A direct user-kernel dialog is very uncommon and only the shell program is able to communicate with the user without the kernel API.
➢
It manages the user-system interaction by prompting users for an input, interpreting their input and then handling an output from the OS.
➢
For example, if a user types the command: The shell creates a child process and runs the date program. While the child process is running, the shell waits for it to terminate.
A shell is an environment or a special user program which provide an interface to user to use operating system services. It executes programs based on the input provided by the user. 16
Difference between Shell and Kernel Shell
Kernel
Shell allows the users to communicate with the kernel.
Kernel controls all the tasks of the system.
It is the interface between kernel and user.
It is the core of the operating system.
It is a command line interpreter (CLI).
Its a low level program interfacing with the hardware (CPU, RAM, disks) on top of which applications are running.
Shell commands like ls, mkdir and many more can be used It performs process management. to request to complete the specific operation to the OS. It is the outer layer of OS. It interacts with user understandable language.
It is the inner layer of OS. and
interprets
to
machine Kernel directly interacts with the hardware by accepting machine understandable language from the shell.
Acts as an intermediary between the user and the kernel
Operates at a lower level than the shell and interacts with hardware
Provides various features like command history, tab Responsible for tasks such as memory management, completion, and scripting capabilities process scheduling, and device drivers Executes commands and programs
Enables user and applications to interact with hardware resources 17
Conclusion ➢
The operating system makes it possible for the user to communicate with the hardware of the computer. The operating system is used as the foundation for installing and using system software.
➢
The interconnections between the various operating system components can be defined as the operating system structure.
➢
The operating system is divided into various different structural types: simple structure, monolithic approach, layered approach, micro-kernels, exokernels, and virtual machines.
➢
Each time one of these methods or structures changed, the OS became progressively better.
18