System Structure
System Structure
The operating system can be implemented with the help of various structures. The
structure of the OS depends mainly on how the various standard components of the
operating system are interconnected and merge into the kernel.
Simple Structure
Monolithic Structure
Micro-Kernel Structure
Layered Structure
Virtual Machines
Simple Structure
Simple structure operating systems do not have well-defined structures and are small,
simple, and limited. The interfaces and levels of functionality are not well
separated. MS-DOS is an example of such an operating system. In MS-DOS, application
programs are able to access the basic I/O routines. These types of operating systems
cause the entire system to crash if one of the user programs fails.
Simple OS Structure
Monolithic Structure
A monolithic structure is a type of operating system architecture where the entire
operating system is implemented as a single large process in kernel mode. Essential
operating system services, such as process management, memory management, file
systems, and device drivers, are combined into a single code block.
Micro-Kernel Structure
Micro-Kernel structure designs the operating system by removing all non-essential
components from the kernel and implementing them as system and user programs. This
results in a smaller kernel called the micro-kernel. Advantages of this structure are that all
new services need to be added to user space and does not require the kernel to be
modified. Thus it is more secure and reliable as if a service fails, then rest of the operating
system remains untouched. Mac OS is an example of this type of OS.
Advantages of Micro-kernel Structure
It makes the operating system portable to various platforms.
As microkernels are small so these can be tested effectively.
Layered Structure
An OS can be broken into pieces and retain much more control over the system. In this
structure, the OS is broken into a number of layers (levels). 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. This simplifies the
debugging process, if lower-level layers are debugged and an error occurs during
debugging, then the error must be on that layer only, as the lower-level layers have
already been debugged. The main disadvantage of this structure is that at each layer, the
data needs to be modified and passed on which adds overhead to the system. Moreover,
careful planning of the layers is necessary, as a layer can use only lower-level
layers. UNIX is an example of this structure.
Layered OS Structure
The fundamental issue with the virtual machine technique is disc systems. Let’s say the
physical machine only has three disc drives, but it needs to host seven virtual machines.
The program that creates virtual machines would need a significant amount of disc space
in order to provide virtual memory and spooling, so it should be clear that it is impossible
to assign a disc drive to every virtual machine. The answer is to make virtual discs
available.
An operating system is software that acts as an intermediary between the user and
computer hardware. It is a program with the help of which we are able to run various
applications. It is the one program that is running all the time. Every computer must have
an operating system to smoothly execute other programs.
The OS coordinates the use of the hardware and application programs for various users.
It provides a platform for other application programs to work. The operating system is a
set of special programs that run on a computer system that allows it to work properly. It
controls input-output devices, execution of programs, managing files, etc.
Program Execution
It is the Operating System that manages how a program is going to be executed. It loads
the program into the memory after which it is executed. The order in which they are
executed depends on the CPU Scheduling Algorithms. A few are FCFS, SJF, etc. When
the program is in execution, the Operating System also handles deadlock i.e. no two
processes come for execution at the same time. The Operating System is responsible for
the smooth execution of both user and system programs. The Operating System utilizes
various resources available for the efficient running of all types of functionalities.
File Management
The operating system helps in managing files also. If a program needs access to a file, it
is the operating system that grants access. These permissions include read-only,
read-write, etc. It also provides a platform for the user to create, and delete files. The
Operating System is responsible for making decisions regarding the storage of all types
of data or files, i.e, floppy disk/hard disk/pen drive, etc. The Operating System decides
how the data should be manipulated and stored.
Memory Management
Let’s understand memory management by OS in simple way. Imagine a cricket team with
limited number of player . The team manager (OS) decide whether the upcoming player
will be in playing 11 ,playing 15 or will not be included in team , based on his
performance . In the same way, OS first check whether the upcoming program fulfil all
requirement to get memory space or not ,if all things good, it checks how much memory
space will be sufficient for program and then load the program into memory at certain
location. And thus , it prevents program from using unnecessary memory.
Process Management
Let’s understand the process management in unique way. Imagine, our kitchen stove as
the (CPU) where all cooking(execution) is really happen and chef as the (OS) who uses
kitchen-stove(CPU) to cook different dishes(program). The chef(OS) has to cook different
dishes(programs) so he ensure that any particular dish(program) does not take long
time(unnecessary time) and all dishes(programs) gets a chance to
cooked(execution) .The chef(OS) basically scheduled time for all dishes(programs) to run
kitchen(all the system) smoothly and thus cooked(execute) all the different
dishes(programs) efficiently.
Privacy : OS give us facility to keep our essential information hidden like having a lock on
our door, where only you can enter and other are not allowed . Basically , it respect our
secrets and provide us facility to keep it safe.
Resource Management
System resources are shared between various processes. It is the Operating system that
manages resource sharing. It also manages the CPU time among processes using CPU
Scheduling Algorithms. It also helps in the memory management of the system. It also
controls input-output devices. The OS also ensures the proper use of all the resources
available by deciding which resource to be used by whom.
User Interface
User interface is essential and all operating systems provide it. Users either interacts with
the operating system through the command-line interface or graphical user interface or
GUI. The command interpreter executes the next user-specified command.
A GUI offers the user a mouse-based window and menu system as an interface.
Networking
This service enables communication between devices on a network, such as connecting
to the internet, sending and receiving data packets, and managing network connections.
Error Handling
The Operating System also handles the error occurring in the CPU, in Input-Output
devices, etc. It also ensures that an error does not occur frequently and fixes the errors. It
also prevents the process from coming to a deadlock. It also looks for any type of error or
bugs that can occur while any task. The well-secured OS sometimes also acts as a
countermeasure for preventing any sort of breach of the Computer System from any
external source and probably handling them.
Time Management
Imagine traffic light as (OS), which indicates all the cars(programs) whether it should be
stop(red)=>(simple queue), start(yellow)=>(ready queue),move(green)=>(under execution)
and this light (control) changes after a certain interval of time at each side of the
road(computer system) so that the cars(program) from all side of road move smoothly
without traffic.