OPERATING SYSTEM STRUCTURE
• INTRODUCTION
• LAYERED SYSTEM
• KERNEL
• TYPES OF KERNEL(MONOLITHIC/MACRO KERNEL AND
MICRO /EXO-KERNEL)
• CLIENT-SERVER MODEL
• VIRTUAL MACHINES
• SHELL
INTRODUCTION
• An operating system is a design that enables user
application programs to communicate with the
hardware of the machine.
• We want clear structure to let us apply an operating
system to our particular needs because os have
complex structure.
• It will become easier to create an OS system in pieces,
so that larger issues will be break into smaller, more
manageable sub problems.
• OS structure refers as the strategy for connecting and
incorporating various OS components within the
kernel.
SIMPLE STRUCTURE
SIMPLE STRUCTURE
• Most straightforward operating system structure.
• Interfaces and degrees of functionality in this structure are clearly defined,
programs are able to access I/O routines, which may result in
unauthorized access to I/O procedures.
• Example MS-DOS operating system is based on this structure where:
– 4 layers are used to make MS-DOS
– ROM BIOS device drivers, MS-DOS device drivers, application
programs and system programs.
– If the system is built in layers, it will be simpler to design, manage and
update. To complete task each layer can interact with one another.
• Pros and cons of simple structure:
• Pros: Simple to develop, offer superior performance, etc.
• Cons: If one user program crash whole OS will breaks, no abstraction or
data hiding, etc.
LAYERED SYSTEM
• The OS is separated into layers or levels in this
kind of arrangement
• Layer 0(lower layer): contains the hardware;
Layer 1…..layer n(the topmost layer) contains the
user interface;
• These layers are organized hierarchically, with the
top level layers making use of the capabilities of
the lower level ones.
• It provide level of abstraction and debugging is
simpler where all lower level layers debugged
before the upper layer is examined.
LAYERED STRUCTURE
Pros and cons of layered structure:
pros:
- Obtain some amount of abstraction so work duties are
separated.
- Debugging is simpler
Cons:
- Due to layering performance may slow
- Layered dependency will arise because upper layers only
make use of lower layers capabilities.
WHAT IS KERNEL?
• Core components of operating system that
provides essential services for all other parts
of the system.
• Kernel acts as a bridge between applications
and data processing performed at hardware
level using inter-process communication and
system call.
OBJECTIVE OF KERNEL
• To establish communication between user
level application and hardware.
• To control process management.
• To control disk management
• To control memory management
• To control task management ,etc.
EXAMPLE :HOW KERNEL DO PROCESS
MANAGEMENT?
• Process creation: You open a text editor and web
browser. When you launch these programs, the
kernel is responsible for creating and managing
the corresponding processes.
• Process scheduling: The kernel decides how much
CPU time each process gets, and it switches
between rapidly. It ensures that no single process
hogs all the resources, providing a fair share to
each.
Explore other example by yourself.
Types of Kernel (Monolithic/Macro
Kernel)
• The monolithic OS control all aspects of the operating
system operations including file, memory, device
management and operational issues.
• All the operating system services operate in Kernel space.
• Multiple programming techniques such as batch processing
and time sharing increase processor throughput.
• This is an old operating system that was used in banks to
carry out simple tasks like batch processing and time
sharing operations.
• It has dependencies between systems components.
• Example unix, linux, etc.
Types of Kernel (Monolithic/Macro
Kernel)
Advantage of Monolithic Kernel:
• Efficiency: No need to switch between user
and kernel mode for every system call.
• Tight integration: It is easy to implement
complex functionalities because all operating
system services are running in kernel space.
• Simplicity: The have unified structure so that
these kernels are simpler to design,
implement and debug, etc.
Types of Kernel (Monolithic/Macro
Kernel)
Disadvantage of Monolithic Kernel:
• Stability issues : Any bug or security vulnerability
in a kernel service can affect the entire system.
• Security vulnerabilities: Since all the operating
system services are running in kernel space, any
security vulnerability in one of the services can
compromise the entire system.
• Maintenance difficulties: Monolithic kernels can
be more difficult to maintain than other types of
kernels because any change in one of the services
can affect the entire system. etc.
Types of Kernel (Micro Kernel)
• In the mid 1980s researchers at carnegie mellon university
developed an operating system called Mach that
modularized the kernel using the microkernel approach.
• This method structures the operating system by removing
all non essential components from the kernel and
implementing them as system and user level programs.
• It provide minimal process and memory management, in
addition to a communication facility.
• The client program and service never interact directly.
Rather they communicate indirectly by exchanging
messages with the microkernel.
Types of Kernel (Micro Kernel)
Advantages of micro kernel:
• It enables portability of the OS across platforms
• Due to the isolation of each micro kernel , its
reliable and secure.
• Testing and debugging is easy due to reduced
size of micro -kernels.
• The remaining operating system remains
unaffected and keeps running properly even if a
component or micro kernel fails.
Types of Kernel (Micro Kernel)
Disadvantages of Micro kernel:
• The performance of the system is decreased by
increased inter module communication.
• The construction of a system is complicated
because more communication and
synchronization mechanism between the
different operating system services.
• Higher resource is required because more
communication and synchronization mechanism
between the different operating system services.
Comparison between monolithic and
micro kernel:
Type of kernel(Exo- kernel)
• An operating system called exo kernel which was created at MIT
with the goal of offering application level management of hardware
resources.
• It is the type of kernel which follows end- to end principle. It has
fewest hardware abstractions as possible. It allocates physical
resources to applications.
• The exokernel architecture goal is to enable application-specific
customization by separating resource management from
protection.
• Exokernels differ from micro and monolithic kernels in that their
primary objective is to prevent forced abstraction.
• An exo kernel aims to be minimalistic, providing only the essential
functions needed for the operating system to work. It keeps things
simple and lightweight.
• Example Exos, Nemesis, etc.
Type of kernel(exo kernel)
Type of kernel(exo kernel)
Advantages of exo kernel:
• Flexibility: It allows developers to customize and
optimize the operating system for their specific
application needs.
• Performance:They eliminate unnecessary abstractions
and allow application to directly access the hardware.
• Security: They allow effective control over the
allocation of the system resources such as memory and
CPU time.
• Modularity: Allows easy addition or removal of
operating system services.
Type of kernel(exo kernel)
Disadvantage of exo-kernel:
• Require detail and careful consideration of
system resource allocation so it is complex
• To develop the application which directly
access hardware resource is more difficult.
• Still an emerging technology and may not
have the same level of support and resources
as traditional kernels so it may cause limited
support and debugging difficulty.
Client server Model
• Distributed computing architecture that divides
tasks or processes between clients and servers.
• Often used in networking environment
• In OS the client server model is often
implemented to facilitate communication
between different processes or components
within the system
• In this structure the task is partition or workload
is shared between the provider of resource called
server and requesters called client.
• Server share resources and client use it.
Client server model
Client:
- User or application that requests services or resources
- Initiates communication with server
- Typically end user device or software applications
- Client is responsible for user interface, application logic and user
related task
Server:
- System or software that provides services or resources
- Listens for incoming requests, process them and send back the
result
- Servers are dedicated machines or processes responsible for
handling specific tasks or services
- Server is responsible for data storage, processing and managing
shared resources or services.
Client server model
Advantages:
- Scalability: Allows scalability by distributing task among
multiple servers
- Centralized management: Server provides centerlized
point for managing resources ,security and data
- Resource sharing: By sharing resource it will be easier
to manage and maintain.
Example: The communication between the file client and
server could use protocol like server message block(SMB)
protocol, which is commonly used for file and printer
sharing in Windows Environment.
Virtual Machine Vms
• Imagine you have one high graphics computer that you
use for gaming and college project.
• Now you want to run two different operating system
on it because for gaming you need windows and for
project you need linux.
• But there may be the issue that two OS don’t always
get along well or share resource nicely. To overcome
this you decide to create two imaginary computers
within your high graphics computer with its own OS,
application and files.
• Each of these imaginary computers a “Virtual machine”
VIRTUAL IMAGE CREATED BY BING AI
Virtual Machine(VMs)
• The hardware of our pc is abstracted by a virtual machine into a
variety of various execution contexts based on our needs, giving us
the impression that each execution environment is a separate
computer.
• Using CPU scheduling and VM technique an OS allows us to execute
multiple process simultaneously while we have an impression the
each one is using a separate processor and memory.
• System calls and file system are example that process are giving
which hardware is unable to give.
• A virtual machine provide an interface that is similar to that most
fundamental hardware.
• We can develop a virtual machine for a variety of reasons, all of
which are fundamentally connected to the capacity to share the
same underlying hardware supporting various execution
environments i.e operating system
Virtual Machine(VMs)
• Each virtual machine is an isolated and independent instance of an
operating system
Advantages:
- No issue with security because total isolation between each virtual
machine
- A virtual machine may offer an architecture for the instruction set
that is different from of that actual computers
Disadvantages:
- When it comes to hardware access, virtual computers are less
effective than physical ones.
- Depending on the workload , operating numerous virtual machines
simultaneously on a host computer may have an adverse effect on
one of them.
Shell
• A shell is a special user program that provides an interface
for the user to use operating system services. Shell accepts
human- readable commands from users an converts the
into something which the kernel can understand.
• It is a command language interpreter that executes
commands read from input devices such as keyboards. The
shell gets started when the user logs in or starts terminal.
• It acts as an intermediary between the user and the kernel.
It also provides various features like command history, tab
completion and scripting capabilities to make it easier for
the user to work with the system.
• Shell commands like ls, mkdir and many more can be used
to request to complete the specific operation to the OS.
Shell
Shell is broadly classified into two categories:
- Command line shell: Accessed by users using a command line
interface. Special program called terminal in Linux/mac os or
command prompt in Window OS is provided to type in the human
readable commands such as ‘mkdir’,etc. an then it is being
executed. The result is then displayed on the terminal to the user.
- Graphical shell: Manipulating programs based on the GUI by
allowing for operation such as opening, closing, moving and resizing
etc ,for interacting with the program. Users do not need to type in
commands for every action.
- There are several shells are available for linux systems like:
1. BASH(Bourne Again Shell)
2. CSH(C Shell)
3. KSH(Korn shell)
Assignment
• Explore kernel and its types with diagram and
examples.
• Please explore about GOOGLE ANDROID and
windows operating system architecture with
appropriate diagram.
• Find out some key aspects about linux shells
and try to learn some linux and MS-Dos
commands.