0% found this document useful (0 votes)
4 views

OS M-1

An operating system serves as an intermediary between users and computer hardware, managing resources and providing an environment for program execution. It encompasses functionalities such as resource, process, storage, memory, and security management, and has evolved through four generations from vacuum tubes to personal computers. Various types of operating systems exist, including batch, time-sharing, distributed, network, and real-time systems, each with distinct advantages and disadvantages.

Uploaded by

Sahib
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

OS M-1

An operating system serves as an intermediary between users and computer hardware, managing resources and providing an environment for program execution. It encompasses functionalities such as resource, process, storage, memory, and security management, and has evolved through four generations from vacuum tubes to personal computers. Various types of operating systems exist, including batch, time-sharing, distributed, network, and real-time systems, each with distinct advantages and disadvantages.

Uploaded by

Sahib
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

OPERATING SYSTEM

An operating system acts as an intermediary between the user of a


computer and computer hardware. The purpose of an operating
system is to provide an environment in which a user can execute
programs conveniently and efficiently.
An operating system is a software that manages computer hardware.
The hardware must provide appropriate mechanisms to ensure the
correct operation of the computer system and to prevent user
programs from interfering with the proper operation of the system.
Operating System – Definition:

• An operating system is a program that controls the execution


of application programs and acts as an interface between the
user of a computer and the computer hardware.
• A more common definition is that the operating system is
the one program running at all times on the computer
(usually called the kernel), with all else being application
programs.
• An operating system is concerned with the allocation of
resources and services, such as memory, processors, devices,
and information. The operating system correspondingly
includes programs to manage these resources, such as a
traffic controller, a scheduler, a memory management
module, I/O programs, and a file system.
Major Functionalities of Operating System:
• Resource Management: When parallel accessing happens
in the OS means when multiple users are accessing the
system the OS works as Resource Manager, Its
responsibility is to provide hardware to the user. It decreases
the load in the system.
• Process Management: It includes various tasks
like scheduling and termination of the process. It is done
with the help of CPU Scheduling algorithms.
• Storage Management: The file system mechanism used for
the management of the storage. NIFS, CFS, CIFS, NFS,
etc. are some file systems. All the data is stored in various
tracks of Hard disks that are all managed by the storage
manager. It included Hard Disk.
• Memory Management: Refers to the management of
primary memory. The operating system has to keep track of
how much memory has been used and by whom. It has to
decide which process needs memory space and how much.
OS also has to allocate and deallocate the memory space.
• Security/Privacy Management: Privacy is also provided by
the Operating system by means of passwords so that
unauthorized applications can’t access programs or data. For
example, Windows uses Kerberos authentication to prevent
unauthorized access to data.
The process operating system as User Interface:
1. User
2. System and application programs
3. Operating system
4. Hardware
Every general-purpose computer consists of hardware, an operating
system(s), system programs, and application programs. The
hardware consists of memory, CPU, ALU, I/O devices, peripheral
devices, and storage devices. The system program consists of
compilers, loaders, editors, OS, etc. The application program
consists of business programs, and database programs.

Operating Systems have evolved over the years. So, their evolution
through the years can be mapped using generations of operating
systems. There are four generations of operating systems. These can
be described as follows −
The First Generation ( 1945 - 1955 ): Vacuum Tubes and
Plugboards
Digital computers were not constructed until the second world war.
Calculating engines with mechanical relays were built at that time.
However, the mechanical relays were very slow and were later
replaced with vacuum tubes. These machines were enormous but were
still very slow.
These early computers were designed, built and maintained by a single
group of people. Programming languages were unknown and there
were no operating systems so all the programming was done in
machine language. All the problems were simple numerical
calculations.
By the 1950’s punch cards were introduced and this improved the
computer system. Instead of using plugboards, programs were written
on cards and read into the system.
The Second Generation ( 1955 - 1965 ): Transistors and Batch
Systems
Transistors led to the development of the computer systems that could
be manufactured and sold to paying customers. These machines were
known as mainframes and were locked in air-conditioned computer
rooms with staff to operate them.
The Batch System was introduced to reduce the wasted time in the
computer. A tray full of jobs was collected in the input room and read
into the magnetic tape. After that, the tape was rewound and mounted
on a tape drive. Then the batch operating system was loaded in which
read the first job from the tape and ran it. The output was written on
the second tape. After the whole batch was done, the input and output
tapes were removed and the output tape was printed.
The Third Generation ( 1965 - 1980 ): Integrated Circuits and
Multiprogramming
Until the 1960’s, there were two types of computer systems i.e the
scientific and the commercial computers. These were combined by
IBM in the System/360. This used integrated circuits and provided a
major price and performance advantage over the second generation
systems.
The third generation operating systems also introduced
multiprogramming. This meant that the processor was not idle while a
job was completing its I/O operation. Another job was scheduled on
the processor so that its time would not be wasted.
The Fourth Generation ( 1980 - Present ): Personal Computers
Personal Computers were easy to create with the development of large-
scale integrated circuits. These were chips containing thousands of
transistors on a square centimeter of silicon. Because of these,
microcomputers were much cheaper than minicomputers and that
made it possible for a single individual to own one of them.
The advent of personal computers also led to the growth of networks.
This created network operating systems and distributed operating
systems. The users were aware of a network while using a network
operating system and could log in to remote machines and copy files
from one machine to another.
TYPES OF OPEARTING SYSTEM
An Operating System performs all the basic tasks like managing
files, processes, and memory. Thus operating system acts as the
manager of all the resources, i.e. resource manager. Thus, the
operating system becomes an interface between user and machine.
Types of Operating Systems: Some widely used operating systems
are as follows-
1. Batch Operating System –
This type of operating system does not interact with the computer
directly. There is an operator which takes similar jobs having the
same requirement and group them into batches. It is the
responsibility of the operator to sort jobs with similar needs.

Advantages of Batch Operating System:


• It is very difficult to guess or know the time required for any
job to complete. Processors of the batch systems know how
long the job would be when it is in queue
• Multiple users can share the batch systems
• The idle time for the batch system is very less
• It is easy to manage large work repeatedly in batch systems
Disadvantages of Batch Operating System:
• The computer operators should be well known with batch
systems
• Batch systems are hard to debug
• It is sometimes costly
• The other jobs will have to wait for an unknown time if any
job fails
Examples of Batch based Operating System: Payroll System,
Bank Statements, etc.
2. Time-Sharing Operating Systems –
Each task is given some time to execute so that all the tasks work
smoothly. Each user gets the time of CPU as they use a single
system. These systems are also known as Multitasking Systems. The
task can be from a single user or different users also. The time that
each task gets to execute is called quantum. After this time interval is
over OS switches over to the next task.

Advantages of Time-Sharing OS:


• Each task gets an equal opportunity
• Fewer chances of duplication of software
• CPU idle time can be reduced
Disadvantages of Time-Sharing OS:
• Reliability problem
• One must have to take care of the security and integrity of
user programs and data
• Data communication problem
Examples of Time-Sharing OSs are: Multics, Unix, etc.
3. Distributed Operating System –
These types of the operating system is a recent advancement in the
world of computer technology and are being widely accepted all over
the world and, that too, with a great pace. Various autonomous
interconnected computers communicate with each other using a
shared communication network. Independent systems possess their
own memory unit and CPU. These are referred to as loosely coupled
systems or distributed systems. These system’s processors differ in
size and function. The major benefit of working with these types of
the operating system is that it is always possible that one user can
access the files or software which are not actually present on his
system but some other system connected within this network i.e.,
remote access is enabled within the devices connected in that
network.

Advantages of Distributed Operating System:


• Failure of one will not affect the other network
communication, as all systems are independent from each
other
• Electronic mail increases the data exchange speed
• Since resources are being shared, computation is highly fast
and durable
• Load on host computer reduces
• These systems are easily scalable as many systems can be
easily added to the network
• Delay in data processing reduces
Disadvantages of Distributed Operating System:
• Failure of the main network will stop the entire
communication
• To establish distributed systems the language which is used
are not well defined yet
• These types of systems are not readily available as they are
very expensive. Not only that the underlying software is
highly complex and not understood well yet
Examples of Distributed Operating System are- LOCUS, etc.
4. Network Operating System –
These systems run on a server and provide the capability to manage
data, users, groups, security, applications, and other networking
functions. These types of operating systems allow shared access of
files, printers, security, applications, and other networking functions
over a small private network. One more important aspect of Network
Operating Systems is that all the users are well aware of the
underlying configuration, of all other users within the network, their
individual connections, etc. and that’s why these computers are
popularly known as tightly coupled systems.
Advantages of Network Operating System:
• Highly stable centralized servers
• Security concerns are handled through servers
• New technologies and hardware up-gradation are easily
integrated into the system
• Server access is possible remotely from different locations
and types of systems
Disadvantages of Network Operating System:
• Servers are costly
• User has to depend on a central location for most operations
• Maintenance and updates are required regularly
Examples of Network Operating System are: Microsoft Windows
Server 2003, Microsoft Windows Server 2008, UNIX, Linux, Mac
OS X, Novell NetWare, and BSD, etc.
5. Real-Time Operating System –
These types of OSs serve real-time systems. The time interval
required to process and respond to inputs is very small. This time
interval is called response time.
Real-time systems are used when there are time requirements that
are very strict like missile systems, air traffic control systems,
robots, etc.
Two types of Real-Time Operating System which are as follows:
• Hard Real-Time Systems:
These OSs are meant for applications where time constraints
are very strict and even the shortest possible delay is not
acceptable. These systems are built for saving life like
automatic parachutes or airbags which are required to be
readily available in case of any accident. Virtual memory is
rarely found in these systems.
• Soft Real-Time Systems:
These OSs are for applications where for time-constraint is
less strict.

Advantages of RTOS:
• Maximum Consumption: Maximum utilization of devices
and system, thus more output from all the resources
• Task Shifting: The time assigned for shifting tasks in these
systems are very less. For example, in older systems, it takes
about 10 microseconds in shifting one task to another, and in
the latest systems, it takes 3 microseconds.
• Focus on Application: Focus on running applications and
less importance to applications which are in the queue.
• Real-time operating system in the embedded
system: Since the size of programs are small, RTOS can
also be used in embedded systems like in transport and
others.
• Error Free: These types of systems are error-free.
• Memory Allocation: Memory allocation is best managed in
these types of systems.
Disadvantages of RTOS:
• Limited Tasks: Very few tasks run at the same time and
their concentration is very less on few applications to avoid
errors.
• Use heavy system resources: Sometimes the system
resources are not so good and they are expensive as well.
• Complex Algorithms: The algorithms are very complex and
difficult for the designer to write on.
• Device driver and interrupt signals: It needs specific
device drivers and interrupts signals to respond earliest to
interrupts.
• Thread Priority: It is not good to set thread priority as
these systems are very less prone to switching tasks.
Examples of Real-Time Operating Systems are: Scientific
experiments, medical imaging systems, industrial control systems,
weapon systems, robots, air traffic control systems, etc.

Services of Operating System

1. Program Execution
2. Input Output Operations
3. File Management
4. Error Handling
5. Resource Management
6. Communication between Processes
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.

Input Output Operations:

Operating System manages the input-output operations and


establishes communication between the user and device drivers.
Device drivers are software that is associated with hardware that is
being managed by the OS so that the sync between the devices works
properly. It also provides access to input-output devices to a program
when needed.

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.

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.

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.

Communication between Processes:

The Operating system manages the communication between


processes. Communication between processes includes data transfer
among them. If the processes are not on the same computer but
connected through a computer network, then also their communication
is managed by the Operating System itself.

Security and Protection:

In an operating system, protection is a mechanism that controls the


access of the process, programs, or users over any resources of the
computer system. The operating system ensures that all access to
system resources must be monitored and controlled. It also ensures
that the external resources or peripherals must be protected from
invalid access. It provides authentication by using usernames and
passwords.
These were some of the services that an operating system provides.
System Calls in Operating System (OS)

A system call is a way for a user program to interface with the operating
system. The program requests several services, and the OS responds by
invoking a series of system calls to satisfy the request. A system call
can be written in assembly language or a high-level language
like C or Pascal. System calls are predefined functions that the
operating system may directly invoke if a high-level language is used.

In this article, you will learn about the system calls in the operating
system and discuss their types and many other things.

What is a System Call?

A system call is a method for a computer program to request a service


from the kernel of the operating system on which it is running. A
system call is a method of interacting with the operating system via
programs. A system call is a request from computer software to an
operating system's kernel.

The Application Program Interface (API) connects the operating


system's functions to user programs. It acts as a link between the
operating system and a process, allowing user-level programs to
request operating system services. The kernel system can only be
accessed using system calls. System calls are required for any programs
that use resources.

ode and data for system calls are stored in global kernel memory.
Why do you need system calls in Operating System?

There are various situations where you must require system calls in the
operating system. Following of the situations are as follows:

1. It is must require when a file system wants to create or delete a


file.
2. Network connections require the system calls to sending and
receiving data packets.
3. If you want to read or write a file, you need to system calls.
4. If you want to access hardware devices, including a printer,
scanner, you need a system call.
5. System calls are used to create and manage new processes.
How System Calls Work

The Applications run in an area of memory known as user space. A


system call connects to the operating system's kernel, which executes
in kernel space. When an application creates a system call, it must first
obtain permission from the kernel. It achieves this using an interrupt
request, which pauses the current process and transfers control to the
kernel.

If the request is permitted, the kernel performs the requested action,


like creating or deleting a file. As input, the application receives the
kernel's output. The application resumes the procedure after the input
is received. When the operation is finished, the kernel returns the
results to the application and then moves data from kernel space to user
space in memory.

A simple system call may take few nanoseconds to provide the result,
like retrieving the system date and time. A more complicated system
call, such as connecting to a network device, may take a few seconds.
Most operating systems launch a distinct kernel thread for each system
call to avoid bottlenecks. Modern operating systems are multi-
threaded, which means they can handle various system calls at the same
time.

Types of System Calls

There are commonly five types of system calls. These are as follows:
1. Process Control
2. File Management
3. Device Management
4. Information Maintenance
5. Communication

Now, you will learn about all the different types of system calls one-
by-one

Process Control

Process control is the system call that is used to direct the processes.
Some process control examples include creating, load, abort, end,
execute, process, terminate the process, etc.

File Management

File management is a system call that is used to handle the files. Some
file management examples include creating files, delete files, open,
close, read, write, etc.

Device Management
Device management is a system call that is used to deal with devices.
Some examples of device management include read, device, write, get
device attributes, release device, etc.

Information Maintenance

Information maintenance is a system call that is used to maintain


information. There are some examples of information maintenance,
including getting system data, set time or date, get time or date, set
system data, etc.

Communication

Communication is a system call that is used for communication. There


are some examples of communication, including create, delete
communication connections, send, receive messages, etc.

Examples of Windows and Unix system calls

There are various examples of Windows and Unix system calls. These
are as listed below in the table:

Process Windows

Process Control CreateProcess()


ExitProcess()
WaitForSingleObject()

File Manipulation CreateFile()


ReadFile()
WriteFile()
CloseHandle()

Device Management SetConsoleMode()


ReadConsole()
WriteConsole()
Information Maintenance GetCurrentProcessID()
SetTimer()
Sleep()

Communication CreatePipe()
CreateFileMapping()
MapViewOfFile()

Protection SetFileSecurity()
InitializeSecurityDescriptor()
SetSecurityDescriptorgroup()

Here, you will learn about some methods briefly:

open()

The open() system call allows you to access a file on a file system. It
allocates resources to the file and provides a handle that the process
may refer to. Many processes can open a file at once or by a single
process only. It's all based on the file system and structure.

read()

It is used to obtain data from a file on the file system. It accepts three
arguments in general:

o A file descriptor.
o A buffer to store read data.
o The number of bytes to read from the file.

The file descriptor of the file to be read could be used to identify it and
open it using open() before reading.

wait()

In some systems, a process may have to wait for another process to


complete its execution before proceeding. When a parent process
makes a child process, the parent process execution is suspended until
the child process is finished. The wait() system call is used to suspend
the parent process. Once the child process has completed its execution,
control is returned to the parent process.

write()

It is used to write data from a user buffer to a device like a file. This
system call is one way for a program to generate data. It takes three
arguments in general:

o A file descriptor.
o A pointer to the buffer in which data is saved.
o The number of bytes to be written from the buffer.

fork()

Processes generate clones of themselves using the fork() system call.


It is one of the most common ways to create processes in operating
systems. When a parent process spawns a child process, execution of
the parent process is interrupted until the child process completes. Once
the child process has completed its execution, control is returned to the
parent process.

close()

It is used to end file system access. When this system call is invoked,
it signifies that the program no longer requires the file, and the buffers
are flushed, the file information is altered, and the file resources are de-
allocated as a result.

exec()

When an executable file replaces an earlier executable file in an already


executing process, this system function is invoked. As a new process is
not built, the old process identification stays, but the new process
replaces data, stack, data, head, etc.

exit()
The exit() is a system call that is used to end program execution. This
call indicates that the thread execution is complete, which is especially
useful in multi-threaded environments. The operating system reclaims
resources spent by the process following the use of the exit() system
function.

Monolithic Structure of Operating System

The monolithic operating system is a very basic operating system in


which file management, memory management, device management,
and process management are directly controlled within the kernel. The
kernel can access all the resources present in the system. In monolithic
systems, each component of the operating system is contained within
the kernel. Operating systems that use monolithic architecture were
first time used in the 1970s.

The monolithic operating system is also known as the monolithic


kernel. This is an old operating system used to perform small tasks like
batch processing and time-sharing tasks in banks. The monolithic
kernel acts as a virtual machine that controls all hardware parts.

It is different from a microkernel, which has limited tasks. A


microkernel is divided into two parts, kernel space, and user space.
Both parts communicate with each other through IPC (Inter-process
communication). Microkernel's advantage is that if one server fails,
then the other server takes control of it.

Monolithic kernel

A monolithic kernel is an operating system architecture where the


entire operating system is working in kernel space. The monolithic
model differs from other operating system architectures, such as the
microkernel architecture, in that it alone defines a high-level virtual
interface over computer hardware.

A set of primitives or system calls implement all operating system


services such as process management, concurrency, and memory
management. Device drivers can be added to the kernel as modules.
Advantages of Monolithic Kernel

Here are the following advantages of a monolithic kernel, such as:

o The execution of the monolithic kernel is quite fast as the services


such as memory management, file management, process
scheduling, etc., are implemented under the same address space.
o A process runs completely in single address space in the
monolithic kernel.
o The monolithic kernel is a static single binary file.

Disadvantages of Monolithic Kernel

Here are some disadvantages of the monolithic kernel, such as:

o If any service fails in the monolithic kernel, it leads to the failure


of the entire system.
o The entire operating system needs to be modified by the user to
add any new service.

Monolithic System Architecture

A monolithic design of the operating system architecture makes no


special accommodation for the special nature of the operating system.
Although the design follows the separation of concerns, no attempt is
made to restrict the privileges granted to the individual parts of the
operating system. The entire operating system executes with maximum
privileges. The communication overhead inside the monolithic
operating system is the same as that of any other software, considered
relatively low.
CP/M and DOS are simple examples of monolithic operating systems.
Both CP/M and DOS are operating systems that share a single address
space with the applications.

o In CP/M, the 16-bit address space starts with system variables and
the application area. It ends with three parts of the operating
system, namely CCP (Console Command Processor), BDOS
(Basic Disk Operating System), and BIOS (Basic Input/Output
System).
o In DOS, the 20-bit address space starts with the array of interrupt
vectors and the system variables, followed by the resident part of
DOS and the application area and ending with a memory block
used by the video card and BIOS.

Advantages of Monolithic Architecture:

Monolithic architecture has the following advantages, such as:

o Simple and easy to implement structure.


o Faster execution due to direct access to all the services

Disadvantages of Monolithic Architecture:


Here are some disadvantages of monolithic architecture:

o The addition of new features or removal of obsolete features is


very difficult.
o Security issues are always there because there is no isolation
among various servers present in the kernel.

LAYERED STRUCTURE

Layered Structure of Operating System

The operating system can be implemented with the help of various


structures. The structure of the OS depends mainly on how the various
common components of the operating system are interconnected and
melded into the kernel. Depending on this, we have to follow the
structures of the operating system.

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.
o This allows implementers to change the inner workings and
increases modularity.
o As long as the external interface of the routines doesn't change,
developers have more freedom to change the inner workings of
the routines.
o The main advantage is the simplicity of construction and
debugging. The main difficulty is defining the various layers.

The main disadvantage of this structure is that the data needs to be


modified and passed on at each layer, 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.

Architecture of Layered Structure

This type of operating system was created as an improvement over the


early monolithic systems. The operating system is split into various
layers in the layered operating system, and each of the layers has
different functionalities. There are some rules in the implementation of
the layers as follows.

o A particular layer can access all the layers present below it, but it
cannot access them. That is, layer n-1 can access all the layers
from n-2 to 0, but it cannot access the nth
o Layer 0 deals with allocating the processes, switching between
processes when interruptions occur or the timer expires. It also
deals with the basic multiprogramming of the CPU.

Thus if the user layer wants to interact with the hardware layer, the
response will be traveled through all the layers from n-1 to 1. Each layer
must be designed and implemented such that it will need only the
services provided by the layers below it.

There are six layers in the layered operating system. A diagram


demonstrating these layers is as follows:

1. Hardware: This layer interacts with the system hardware and


coordinates with all the peripheral devices used, such as a printer,
mouse, keyboard, scanner, etc. These types of hardware devices
are managed in the hardware layer.
The hardware layer is the lowest and most authoritative layer in
the layered operating system architecture. It is attached directly
to the core of the system.
2. CPU Scheduling: This layer deals with scheduling the processes
for the CPU. Many scheduling queues are used to handle
processes. When the processes enter the system, they are put into
the job queue.
The processes that are ready to execute in the main memory are
kept in the ready queue. This layer is responsible for managing
how many processes will be allocated to the CPU and how many
will stay out of the CPU.
3. Memory Management: Memory management deals with
memory and moving processes from disk to primary memory for
execution and back again. This is handled by the third layer of the
operating system. All memory management is associated with
this layer. There are various types of memories in the computer
like RAM, ROM.
If you consider RAM, then it is concerned with swapping in and
swapping out of memory. When our computer runs, some
processes move to the main memory (RAM) for execution, and
when programs, such as calculator, exit, it is removed from the
main memory.
4. Process Management: This layer is responsible for managing
the processes, i.e., assigning the processor to a process and
deciding how many processes will stay in the waiting schedule.
The priority of the processes is also managed in this layer. The
different algorithms used for process scheduling are FCFS (first
come, first served), SJF (shortest job first), priority scheduling,
round-robin scheduling, etc.
5. I/O Buffer: I/O devices are very important in computer systems.
They provide users with the means of interacting with the system.
This layer handles the buffers for the I/O devices and makes sure
that they work correctly.
Suppose you are typing from the keyboard. There is a keyboard
buffer attached with the keyboard, which stores data for a
temporary time. Similarly, all input/output devices have some
buffer attached to them. This is because the input/output devices
have slow processing or storing speed. The computer uses buffers
to maintain the good timing speed of the processor and
input/output devices.
6. User Programs: This is the highest layer in the layered operating
system. This layer deals with the many user programs and
applications that run in an operating system, such as word
processors, games, browsers, etc. You can also call this an
application layer because it is concerned with application
programs.

Advantages of Layered Structure

There are several advantages of the layered structure of operating


system design, such as:

1. Modularity: This design promotes modularity as each layer


performs only the tasks it is scheduled to perform.
2. Easy debugging: As the layers are discrete so it is very easy to
debug. Suppose an error occurs in the CPU scheduling layer. The
developer can only search that particular layer to debug, unlike
the Monolithic system where all the services are present.
3. Easy update: A modification made in a particular layer will not
affect the other layers.
4. No direct access to hardware: The hardware layer is the
innermost layer present in the design. So a user can use the
services of hardware but cannot directly modify or access it,
unlike the Simple system in which the user had direct access to
the hardware.
5. Abstraction: Every layer is concerned with its functions. So the
functions and implementations of the other layers are abstract to
it.

Disadvantages of Layered Structure

Though this system has several advantages over the Monolithic and
Simple design, there are also some disadvantages, such as:

1. Complex and careful implementation: As a layer can access


the services of the layers below it, so the arrangement of the layers
must be done carefully. For example, the backing storage layer
uses the services of the memory management layer. So it must be
kept below the memory management layer. Thus with great
modularity comes complex implementation.
2. Slower in execution: If a layer wants to interact with another
layer, it requests to travel through all the layers present between
the two interacting layers. Thus it increases response time, unlike
the Monolithic system, which is faster than this. Thus an increase
in the number of layers may lead to a very inefficient design.
3. Functionality: It is not always possible to divide the
functionalities. Many times, they are interrelated and can't be
separated.
4. Communication: No communication between non-adjacent
layers.

MICROKERNEL OPERATING SYSTEM

The microkernel is one of the kernel's classifications. Being a kernel, it


handles all system resources. On the other hand, the user and kernel
services in a microkernel are implemented in distinct address
spaces. User services are kept in user address space, while kernel
services are kept in kernel address space. It aids to reduce the kernel
and OS's size.

It provides a minimal amount of process and memory management


services. The interaction between the client application and services
running in user address space is established via message passing that
helps to reduce the speed of microkernel execution. The OS is
unaffected because kernel and user services are isolated, so if any of
the user services fails, the kernel service is unaffected. It is extendable
because new services are added to the user address space, hence
requiring no changes in kernel space. It's also lightweight, secure, and
reliable.

Architecture of Microkernel

A microkernel is a minimum needed of software required to implement


an operating system correctly. Memory, process scheduling methods,
and fundamental inter-process communication are all included.
In the above figure, the microkernel includes basic needs like process
scheduling mechanisms, memory, and interprocess communication. It
is the only program that executes at the privileged level, i.e., kernel
mode. The OS's other functions are moved from the kernel-mode and
execute in the user mode.

The microkernel ensures that the code may be easily controlled because
the services are split in the user space. It means some code runs in the
kernel mode, resulting in improved security and stability.

Since the kernel is the most crucial OS component, it is responsible for


the essential services. As a result, under this design, only the most
significant services are present inside the kernel in this architecture. In
contrast, the rest operating system services are available inside the
system application software. As a result, users can interact with such
unnecessary services within the system application. The microkernel is
entirely responsible for the operating system's most significant
services, which are as follows:

1. Inter-Process Communication
2. Memory Management
3. CPU Scheduling

Inter-Process Communication

Interprocess communication refers to how processes interact with one


another. A process has several threads. In the kernel space, threads of
any process interact with one another. Messages are sent and received
across threads using ports. At the kernel level, there are several ports
like process port, exceptional port, bootstrap port, and registered port.
All of these ports interact with user-space processes.

Memory Management

Memory management is the process of allocating space in main


memory for processes. However, there is also the creation of virtual
memory for processes. Virtual memory means that if a process has a
bigger size than the main memory, it is partitioned into portions and
stored. After that, one by one, every part of the process is stored in the
main memory until the CPU executes it.

CPU Scheduling

CPU scheduling refers to which process the CPU will execute next. All
processes are queued and executed one at a time. Every process has a
level of priority, and the process with the highest priority is performed
out first. CPU scheduling aids in optimizing CPU utilization. In
addition, resources are being used more efficiently. It also minimizes
the waiting time. Waiting time shows that a process takes less time in
the queue and that resources are allocated to the process more quickly.
CPU scheduling also reduces response and turnaround times.

Advantages and Disadvantages of Microkernel

Various advantages and disadvantages of the microkernel are as


follows:

Advantages

1. Microkernels are secure since only those parts are added, which
might disturb the system's functionality.
2. Microkernels are modular, and the various modules may be
swapped, reloaded, and modified without affecting the kernel.
3. Microkernel architecture is compact and isolated, so it may
perform better.
4. The system expansion is more accessible, so it may be introduced
to the system application without disrupting the kernel.
5. When compared to monolithic systems, microkernels have fewer
system crashes. Furthermore, due to the modular structure of
microkernels, any crashes that do occur are simply handled.
6. The microkernel interface helps in enforcing a more modular
system structure.
7. Server failure is treated the same as any other user program
failure.
8. It adds new features without recompiling.

Disadvantages

1. When the drivers are implemented as procedures, a context


switch or a function call is needed.
2. In a microkernel system, providing services are more costly than
in a traditional monolithic system.
3. The performance of a microkernel system might be indifferent
and cause issues.

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.
Characteristics of virtual machines
The characteristics of the virtual machines are as follows −
•Multiple OS systems use the same hardware and partition
resources between virtual computers.
• Separate Security and configuration identity.
• Ability to move the virtual computers between the physical
host computers as holistically integrated files.
The below diagram shows you the difference between the single OS
with no VM and Multiple OS with VM −

Benefits
Let us see the major benefits of virtual machines for operating-system
designers and users which are as follows −
• The multiple Operating system environments exist
simultaneously on the same machine, which is isolated from
each other.
• Virtual machine offers an instruction set architecture which
differs from real computer.
• Using virtual machines, there is easy maintenance,
application provisioning, availability and convenient
recovery.
Virtual Machine encourages the users to go beyond the limitations of
hardware to achieve their goals.
The operating system achieves virtualization with the help of a
specialized software called a hypervisor, which emulates the PC client
or server CPU, memory, hard disk, network and other hardware
resources completely, enabling virtual machines to share resources.
The hypervisor can emulate multiple virtual hardware platforms that
are isolated from each other allowing virtual machines to run Linux
and window server operating machines on the same underlying
physical host.

You might also like