You are on page 1of 25

UNIT-I

INTRODUCTION

Operating System acts as an intermediary between the user of a computer and the computer
hardware. The purpose of an operating system is to provide an environment in which a user can
execute programs in a convenient and efficient manner.

● Mainframe operating systems are designed primarily to optimize utilization of hardware.


● Personal computer (PC) operating systems support complex games, business applications
and everything in between.
● Mobile computer operating systems provides an environment in which a user can easily
interface with the computer to execute programs.

Components of Computer system A computer system can be divided roughly into four
components:

1. Hardware

2. Operating system

3. Application programs

4. Users

● Hardware such as Central processing unit (CPU), Memory and the Input/Output (I/O)
devices provides the basic computing resources for the system.
● Application programs such as word processors, spreadsheets, compilers and Web
browsers define the ways in which these resources are used to solve users’ computing
problems.
● Operating system controls the hardware and coordinates its use among the various
application programs for the various users. Operating system provides an Environment
within which other programs can do useful work.

1. SYSTEM VIEW OF OPERATING SYSTEM

From the computer’s point of view an operating system is viewed as a Resource Allocator and a
Control Program.

● The operating system acts as the manager of the resources such as CPU time, memory space,
file-storage space, I/O devices and so on. Resource allocation is important where many users
access the same mainframe or minicomputer.
● An operating system is a control program that manages the execution of user programs to
prevent errors and improper use of the computer. It is especially concerned with the operation
and control of I/O devices. Note: Resource utilization means how various hardware and
software resources are shared.
2. USER VIEW OF OPERATING SYSTEM

The user’s view of the computer varies according to the Interface being used.

● Personal Computer: Most computer users sit in front of a PC consisting of a


monitor,keyboard, mouse and system unit. Such a system is designed for one user to
monopolize its resources. The goal is to maximize the work that the user is performing.
These operating systems designed mostly for ease of use without considering resource
utilization because these systems are single user systems.
● Main frame: A user sits at a terminal connected to a mainframe or a minicomputer.Other
users are accessing the same computer through other terminals. These users share
resources and may exchange information. The operating system in such cases is designed
to maximize resource utilization— to assure that all available CPU time, memory and I/O
are used efficiently and that no individual user takes more than her fair share.
● Workstations: Users sit at workstations connected to networks of other workstations and
servers. These users have dedicated resources at their disposal, but they also share
resources such as networking and servers, including file, compute and print servers.
Therefore the operating system is designed to compromise between individual usability
and resource utilization.
● Mobile Computers: The user interface for mobile computers generally features a touch
screen, where the user interacts with the system by pressing and swiping fingers across
the screen rather than using a physical keyboard and mouse. Embedded Computing:
Some computers may not have user view.
● Embedded computers in home devices and automobiles may have numeric keypads and
may turn indicator lights on or off to show status, but their operating systems are
designed primarily to run without user intervention. Ex: Printers, GPS, Microwave
Ovens, TV, Digital Camera etc.

DEFINING OPERATING SYSTEMS

Universally there is no accepted definition for operating system:

● Operating system is software that is used for controlling and allocating resources. The
fundamental goal of computer systems is to execute user programs and to make solving user
problems easier. Computer hardware alone is not easy to use, application programs are developed.
These programs require certain common operations such as controlling the I/O devices.
● The operating system is also defined as the program that is running at all times on the computer is
called the Kernel.

COMPUTER-SYSTEM ARCHITECTURE

A computer system can be categorized according to the number of general-purpose processors used.

1. Single-Processor Systems

2. Multi-Processor Systems

3. Clustered systems

Single Processor system

● Single processor system has one main CPU capable of executing a general-purpose instruction set
from system processes and user processes.
● All single processor systems have other special-purpose processors also. They come in the form
of device-specific processors such as disk, keyboard and graphics controllers, I/O processors etc.
● These special-purpose processors runs a limited instruction set and do not run user processes.
They are managed by the operating system.
● Operating system sends information about their next task to these processors and monitors their
status.
● Example: A disk-controller microprocessor receives a sequence of requests from the main CPU
and implements its own disk queue and scheduling algorithm. This arrangement relieves the main
CPU of the overhead of disk scheduling. Note: The use of special-purpose microprocessors does
not turn a single-processor system into a multiprocessor.

Multi-Processor system

● Multi-processor systems have two or more processors that share the resources such as computer
bus, memory, clock and peripheral devices. Multiprocessor systems have three main advantages:
i. Increases the throughput: By increasing the number of processors more work will be done
in less time (i.e.) the speed of the system will increases.
ii. Economy of scale: Multiprocessor systems share peripherals, mass storage and power
supplies; hence the cost is less as compared to single-processor systems.
iii. Increased reliability: In single processor system if the processor fails the entire system
fails, but in multi-processor system if processor fails then the entire system will not fail,
other processor will pick up and shares the work of failed processor.

Multi-processor systems are of two types:

1. Asymmetric multiprocessing

2. Symmetric multiprocessing

● Asymmetric Multi-Processing: Each processor is assigned a specific task in asymmetric


multiprocessing and it uses boss–worker relationship. The Boss processor controls the system by
scheduling and assigning the tasks to worker processor. The worker processor has to complete the
task assigned by boss processor.
● Symmetric Multi-Processing (SMP) Each processor performs all tasks within the operating
system and no boss–worker relationship exists between processors.
The below figure shows the SMP architecture:

● Each processor has its own set of registers and cache memory and all processors share
physical memory.
● In SMP if there are N CPU’S then N processes can run without causing performance
degradation.
● It is the most common used system. All modern operating systems including Windows,
Mac OS X and Linux provide support for SMP.

Multicore processors

● Multicore processors are special type of multiprocessors in which multiple computing cores
reside on a single chip. Each core has its own register set and its own local cache.
● These are more efficient than multiple chips with single cores because on-chipcommunication is
faster and one chip with multiple cores uses less power than multiple single-core chips.

The below figure shows dual-core design with two cores on the same chip
Clustered Systems

● Clustered system is also a type of multiprocessor system.


● Clustered systems are composed of two or more individual systems or nodes joined together.
● Each node may be a single processor system or a multicore system.

∙ Clustered computers share storage and are closely linked via a local-area network LAN.

∙ Clustering is usually used to provide High-availability service (i.e.) service will continue even if
one or more systems in the cluster fail. Clustering can be structured Asymmetrically or
Symmetrically.

● In Asymmetric clustering, one machine is in Hot-Standby mode while the other is running the
applications. The hot-standby host machine only monitors the active server. If the active server
fails, the hot-standby host becomes the active server.
● In Symmetric clustering, two or more hosts are running applications and are monitoring each
other. This structure is obviously more efficient, as it uses all of the available hardware. Parallel
clusters: parallel clustering allow multiple hosts to access the same data on shared storage. The
clustering is done over Wide Area Networks (WAN’s).

FUNCTIONS OF OPERATING SYSTEM

Operating system is a responsible for following activities.

⮚ Process Management:- A process is a program in execution. A program does nothing unless its
instructions are executed by a CPU. Example:
1. A time-shared user program such as a compiler is a process.
2. A word-processing program being run by an individual user on a PC is a process.
3. A system task such as sending output to a printer is a process.
● A process needs certain resources including CPU time, memory, files and I/O devices to
accomplish its task.
● These resources are either given to the process when it is created or allocated to it while it∙ is
running.
● A program is a passive entity, like the contents of a file stored on disk, whereas a process∙ is an
active entity.
● The CPU executes one instruction of the process after another until all instructions in that∙
process completes.
● At any time, at most only one instruction is executed on behalf of the process.
● A process is the unit of work in a system. A system consists of a collection of processes such as
operating-system processes and user processes.
● Operating system process executes system code whereas user processes executes user code.

The operating system is responsible for the following activities of process management:

1. Creating and deleting both user and system processes.

2. Scheduling processes and threads on the CPUs.

3. Suspending and resuming processes.

4. Providing mechanisms for process synchronization and process communication.

⮚ MEMORY MANAGEMENT:-
● Main memory is a large array of bytes. Each byte has its own address. Main memory is a
repository of quickly accessible data shared by the CPU and I/O devices.
● A program to be executed, it must be mapped to absolute addresses and loaded into memory.
● As the program executes, it accesses program instructions and data from main memory by
generating these absolute addresses.
● The program terminates, its memory space is declared available and the next program can be
loaded and executed.
● Memory management is needed to improve both CPU utilization and computer speed.

∙ Operating systems is responsible for following activities of memory management:

1. Allocating and deallocating memory space as needed.

2. Deciding which processes and data to move into the memory and move out of memory.

3. Keeping track of which parts of memory are currently being used and who is using them.

⮚ STORAGE MANAGEMENT:- Storage management can be divided into 4 different categories:


1. File system management
2. Mass storage management
3. Cache
4. I/O devices
1. File system management:- A file is a collection of related information that represents
program and data. Examples: Data files, text files etc.
OS is responsible for the following activities in connection with file management:
Creating and deleting files.
∙ Creating and deleting directories to organize files.
∙ Supporting primitives for manipulating files and directories.
∙ Mapping files onto secondary storage
∙ Backing up files on stable (nonvolatile) storage media.
2. Mass-Storage Management:- Secondary storage disks are permanent storage devices.
● Most programs including compilers, assemblers, word processors, editors and formatters
are stored on a disk until loaded into memory.
● Magnetic tape drives and tapes and CD and DVD drives and platters are typical tertiary
storage devices.
● The media tapes and optical platters vary between WORM (write-once, read-manytimes)
and RW (read– write) formats.

The operating system is responsible for the following activities in connection with disk
management: Free-space management, Storage allocation, Disk scheduling.

⮚ Caching:- Cache is faster storage system used to store the information temporarily and the size of
cache is very small.
● Information is normally kept in storage systems such as main memory. As it is used, it is
copied into the cache on a temporary basis.
● When we need a particular piece of information, we first check whether it is in the cache.
● If information is in cache then we use the information directly from the cache.
● If information is not cache, we use the information from the source, putting a copy in the
cache.
⮚ I/O Systems:- One of the purposes of an operating system is to hide details of specific hardware
devices from the user. Only the device driver knows details of the specific device. Example: In
UNIX, the peculiarities of I/O devices are hidden from the bulk of the operating system itself by
the I/O subsystem. The I/O subsystem consists of several components:
● A memory-management component that includes buffering, caching and spooling
∙ A general device-driver interface
∙ Drivers for specific hardware devices.

⮚ PROTECTION AND SECURITY :-Protection is a mechanism for controlling the access of


processes or users to the resources defined by a computer system.
● This mechanism must be provided to specify the controls to be imposed and the controls to be
enforced.
● If a computer system has multiple users and allows the concurrent execution of multiple
processes, then access to data must be regulated. For that purpose, mechanisms ensure that
files, memory segments, CPU and other resources can be operated on by only those processes
that have gained proper authorization from the operating system.
Example:
1. Memory-addressing hardware ensures that a process can execute only within its own
address space.
2. The timer ensures that no process can gain control of the CPU without eventually
relinquishing control.
3. Device-control registers are not accessible to users, so the integrity of the various
peripheral devices is protected.

Security is a mechanism to defend a system from external and internal attacks.


● Such attacks include viruses and worms, denial-of service attacks, identity theft and theft of
service such as unauthorized use of a system.
● Even though the system provides Protection mechanisms still system needs security
mechanisms.
Example: A user whose authentication information such as user id and password is stolen.
User data could be copied or deleted even though file and memory protection are working.

Classification of Operating System:-

1. Batch Operating system


2. Multiprogramming
3. Distributed Operating System
4. Real Time Operating System
5. Network Operating System

1. What is Batch Operating System?

Batch processing was very popular in the 1970s. The jobs were executed in batches. People used to have a
single computer known as a mainframe. Users using batch operating systems do not interact directly with
the computer. Each user prepares their job using an offline device like a punch card and submitting it to
the computer operator. Jobs with similar requirements are grouped and executed as a group to speed up
processing. Once the programmers have left their programs with the operator, they sort the programs with
similar needs into batches.

The batch operating system grouped jobs that perform similar functions. These job groups are treated as a
batch and executed simultaneously. A computer system with this operating system performs the following
batch processing activities:
1. A job is a single unit that consists of a preset sequence of commands, data, and Programs.
2. Processing takes place in the order in which they are received, i.e., first come, first serve.
3. These jobs are stored in memory and executed without the need for manual information.
4. When a job is successfully run, the operating system releases its memory.

Advantages:
Increased performances as a new get started as soon as the previous job finished without any
manual intervention.
Disadvantage
1. Lack of interaction between the user and job.
2. CPU is often idle, because the speeds of the mechanical I/O devices are slower than CPU.

2. Multiprogramming
Sharing the processor, when two or more programs reside in memory at the same time, is
referred as multiprogramming. Multiprogramming assumes a single shared processor.
Multiprogramming increases CPU utilization by organizing jobs so that the CPU always
has one to execute. The following figure shows the memory layout for a
multiprogramming system.
An OS does the following activities related to multiprogramming.
● The operating system keeps several jobs in memory at a time.
● This set of jobs is a subset of the jobs kept in the job pool.
● The operating system picks and begins to execute one of the jobs in the memory.
● Multiprogramming operating systems monitor the state of all active programs
and system resources using memory management programs to ensure that the
CPU is never idle, unless there are no jobs to process.
Advantages

● High and efficient CPU utilization.


● User feels that many programs are allotted CPU almost simultaneously.

Disadvantages

● CPU scheduling is required.


● To accommodate many jobs in memory, memory management is required.
In this types the operating systems picks up and begins to execute one of the jobs from the memory. If any
of this job needs an I/O operation then the operating system switches to another job (CPU and OS are
always busy).
If several jobs are ready to run at the same time, then the OS chooses the job to
run through the process of CPU Scheduling
Advantages:
● CPU is active all the time and never become idle.
● The system looks to be fast as all the tasks runs in parallel.
● Multiprogramming systems supports multiple users.
● Resources are used efficiently.
Disadvantages:
● It becomes difficult to program a system because of complicated schedule
handling.
● Due to high load of tasks, long time jobs have to wait for a long time.
3. Time-Sharing Operating Systems is one of the important type of operating system.
Time-sharing enables many people, located at various terminals, to use a particular computer
system at the same time. Multitasking or Time-Sharing Systems is a logical extension of
multiprogramming. Processor’s time is shared among multiple users simultaneously is termed as
time-sharing
Advantages of Timesharing operating systems are −
o It provides the advantage of quick response.
o This type of operating system avoids duplication of software.
o It reduces CPU idle time.
Disadvantages of Time-sharing operating systems are −
o Time sharing has problem of reliability.
o Question of security and integrity of user programs and data can be raised.
o Problem of data communication occurs.
4. Distributed system:- Distributed Operating System is a model where distributed applications are
Running on multiple computers linked by communications (network).
o A distributed application is a program that runs on more than one computer and
Communicates through a network.
o The distributed system run on a Distributed Operating System to provide an illusion to the end
user such that the entire network is working like a single system.
o Distributed system perform load balancing by distributing the computational tasks(load) between
computers.

4. These systems are referred as loosely coupled systems where each processor has its own
local memory and processors communicate with one another through various
communication lines.
5. By loosely coupled systems, means that such computers possess no hardware
connections at the CPU - memory bus level(no memory sharing).
● The Distributed OS involves a collection of autonomous computer systems, capable
of communicating and cooperating with each other through a LAN / WAN.
Advantages
● resource sharing facility, a user at one site may be able to use the resources
available at another.
● Reliable - Failure of one site in a distributed system doesn’t affect the others, the
remaining sites can potentially continue operating.
● Reduction of the load on the host computer.
● Reduction of delays in data processing.

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.
5. Real Time System
● The real-time operating system used for a real-time application
● Those applications where data processing should be done in the fixed and small quantum
of time.
● Real time system means that the system is subjected to real time, i.e., response should be
guaranteed within a specified timing constraint or system should meet the specified
deadline.
● Ex: Controlling traffic signal, home appliance are application of Real Time operating
system
● In real time operating system there is a little swapping of programs between primary and
secondary memory.
● Most of the time, processes remain in primary memory in order to provide quick
response, therefore, memory management in real time system is less demanding
compared to other systems.
a. Hard real-time systems
● A hard real-time system has time-critical deadlines that must be met, otherwise
system failure can occur.
● In hard real-time systems secondary storage is limited or missing with data stored
in ROM.
Examples: – air traffic control – vehicle subsystems control – Nuclear power plant
Control
b. Soft real-time systems
● Soft real time by default as “Not Hard Real Time”,Missing some deadlines by some
amount under some circumstances may be acceptable rather than failure.
● Soft real time means systems which have reduced constraints on “lateness” but
still must operate very quickly and repeatable.

6. 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.
7. Multiprocessor Operating System:- A Multiprocessor system is simply a collection of more
than one CPU in a single computer system. Here in this article, we have shared a basic
introduction to Multiprocessors.
A Multiprocessor system is a collection of a number of standard processors put together in an
innovative way to improve the performance and speed of computer hardware.

The main feature, objective, and purpose of the Multiprocessors are to provide high speed at a
low cost in comparison to a uniprocessor.
Multiprocessing is the use of two or more central processing units (CPUs) within a single
computer system.

Multiprocessing also refers to the ability of a system to support more than one processor and or
the ability to allocate tasks between them.
The term processor in multiprocessor can mean either a CPU or an input-output processor (IOP).

Multiprocessor Operating System


Multiprocessor Operating System simply means when there are two or more central processing
units (CPUs) present in a single computer system.
These multiple CPUs are in communication with each other and share the same computer bus,
memory, and other peripheral devices.
These systems are referred to as tightly coupled systems.
They are two different types applied for various environments.

Types of Multiprocessor
There are mainly two types of multiprocessor systems.

● Symmetric multiprocessing (SMP)


● Asymmetric multiprocessing (ASMP)
Symmetric multiprocessing systems are those that treat all CPUs equally.
Asymmetric multiprocessing is a non-uniform memory access (NUMA) multiprocessing, and
clustered multiprocessing are all options for dividing system resources in systems where all CPUs
are not equal.
Multiprocessors come in a variety of shapes and sizes.

Asymmetric and symmetric multiprocessors are the two basic types of multiprocessors. The
following are the specifications:

● Symmetric Multiprocessor System (SMP):


Each processor in these systems has a similar copy of the operating system, and they all
communicate with one another.

this is known as the Multiprocessors system with Symmetry.

All of the processors are in a peer-to-peer arrangement, which means that there is no master-slave
relationship between them.

● Asymmetric Multiprocessors System (ASMP):


Each CPU in an asymmetric system is assigned a certain duty. A master processor is in
charge of giving instructions to all of the other processors.

A master-slave relationship exists in an asymmetric multiprocessor system.

8. Multi-User Operating System:- A Multi-user operating system is a computer operating system


which allows multiple users to access the single system with one operating system on it. It is
generally used on large mainframe computers.
Example: Linux, Unix, Windows 2000, Ubuntu, Mac OS etc.,
In the multi-user operating system, different users connected at different terminals and we can
access, these users through the network as shown in the diagram.

Features of the Multi-user Operating System


• Multi-tasking- Using multi-user operating system we can perform multiple tasks at a time, i.e.
we can run more than one program at a time.
Example: we can edit a word document while browsing the internet.
• Resource sharing- we can share different peripherals like printers, hard drives or we can share
a file or data. For this, each user is given a small time slice of CPU time.
• Background processing- It means that when commands are not processed firstly, then they are
executed in the background while another programs are interacting with the system in the real
time.

Types of Multi-user Operating System


A multi-user operating system is of 3 types which are as follows:
1. Distributed Systems: in this, different computers are managed in such a way so that they can
appear as a single computer. So, a sort of network is formed through which they can communicate
with each other.
2. Time-sliced Systems: in this, a short period is assigned to each task, i.e. each user is given a
time slice of the CPU time. As we know these time slices are tiny, so it appears to the users that
they all are using the mainframe computer at the same time.
3. Multiprocessor Systems: in this, the operating system utilizes more than one processor.
Example: Linux, Unix, Windows XP

Advantages of the Multi-user Operating System


• When one computer in the network gets affected, then it does not affect another computer in the
network. So, the system can be handled efficiently.
• Also, different users can access the same document on their computer.
Example: if one computer contains the pdf file which the other user wants to access, then the
other user can access that file.
• We use the multi-user operating system in the printing process so that different users can access
the same printer and regular operating system can not do this process.
• Airlines also use this operating system for ticket reservation.
• We make use of the multi-user operating system in teachers and library staff for handling and
searching for books. In this, the book record is stored in one computer while the other systems
which are connected can access that computer for querying of books.

Disadvantages of the Multi-user Operating System


• Sometimes sharing your data becomes dangerous for you as your private Data also gets shared.
• Virus attacking takes place on all computer simultaneously as the computers are shared. So if
one computer is affected then other also gets affected.
• Also, computer information is shared.

9. Multithreading :- A thread is a path which is followed during a program’s execution.


Majority of programs written now a days run as a single thread. Lets say, for example a program
is not capable of reading keystrokes while making drawings. These tasks cannot be executed by
the program at the same time. This problem can be solved through multitasking so that two or
more tasks can be executed simultaneously. Multitasking is of two types: Processor based and
thread based. Processor based multitasking is totally managed by the OS, however multitasking
through multithreading can be controlled by the programmer to some extent. The concept
of multi-threading needs proper understanding of these two terms – a process and a thread. A
process is a program being executed. A process can be further divided into independent units
known as threads. A thread is like a small light-weight process within a process. Or we can say a
collection of threads is what is known as a process.
Applications – Threading is used widely in almost every field. Most widely it is seen over the
internet nowadays where we are using transaction processing of every type like recharges, online
transfer, banking etc. Threading is a segment which divide the code into small parts that are of
very light weight and has less burden on CPU memory so that it can be easily worked out and can
achieve goal in desired field. The concept of threading is designed due to the problem of fast and
regular changes in technology and less the work in different areas due to less application. Then as
says “need is the generation of creation or innovation” hence by following this approach human
mind develop the concept of thread to enhance the capability of programming.

Structure of Operating System:-


● A large and complex modern operating system must be engineered to function,
properly and modified easily
● Partition the large task into small components.
● Each of module should be well-defined portion of the system, with carefully
defined input output function.
● 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 following structures of the operating system:
1. Simple Structure
2. Layered Approach
3. Monolithic Kernel
4. Kernel
5. Microkernel
6. Modules

1. Simple Structure:- Such operating systems do not have well defined structure and are
small, simple and limited systems. The interfaces and levels of functionality are not well
separated. MS-DOS is an example of such operating system. In MS-DOS application
programs are able to access the basic I/O routines. These types of operating system cause
the entire system to crash if one of the user programs fails.
Diagram of the structure of MS-DOS is shown below.
Advantages of Simple structure:
● It delivers better application performance because of the few interfaces between the
application program and the hardware.
● Easy for kernel developers to develop such an operating system.
Disadvantages of Simple structure:
● The structure is very complicated as no clear boundaries exists between modules.
● It does not enforce data hiding in the operating system.

2. Layered Structure:-
● An OS can be broken into pieces and retain much more control on system. In this
structure the OS is broken into 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 only.
● This simplifies the debugging process as 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.
Advantages of Layered structure:
● Layering makes it easier to enhance the operating system as implementation of a
layer can be changed easily without affecting the other layers.
● It is very easy to perform debugging and system verification.
Disadvantages of Layered structure:
● In this structure the application performance is degraded as compared to simple
structure.
● It requires careful planning for designing the layers as higher layers use the
functionalities of only the lower layers.
3. Monolithic Kernel:- Monolithic Kernel is another classification of Kernel. Like
microkernel, this one also manages system resources between application and hardware, but
user services and kernel services are implemented under the same address space. It increases
the size of the kernel, thus increasing the size of the operating system as well. This kernel
provides CPU scheduling, memory management, file management, and other operating
system functions through system calls. As both services are implemented under the same
address space, this makes operating system execution faster.
4. Microkernel:- A microkernel is one of the classifications of the kernel. Being a kernel it
manages all system resources. But in a microkernel, the user services and kernel services are
implemented in different address spaces. The user services are kept in user address space,
and kernel services are kept under kernel address space, thus also reduces the size of kernel
and size of an operating system as well.

It provides minimal services of process and memory management. The communication


between client program/application and services running in user address space is established
through message passing, reducing the speed of execution microkernel. The Operating
System remains unaffected as user services and kernel services are isolated so if any user
service fails it does not affect kernel service. Thus it adds to one of the advantages of a
microkernel. It is easily extendible i.e. if any new services are to be added they are added to
user address space and hence require no modification in kernel space. It is also portable,
secure, and reliable. Examples of microkernel-based operating systems include L4, QNX,
and MINIX.

Microkernel Architecture –
Since the kernel is the core part of the operating system, so it is meant for handling the most
important services only. Thus in this architecture, only the most important services are inside
the kernel and the rest of the OS services are present inside the system application program.
Thus users are able to interact with those not-so-important services within the system
application. And the microkernel is solely responsible for the most important services of the
operating system they are named as follows:
● Inter process-Communication
● Memory Management
● CPU-Scheduling
Some key features of microkernel-based operating systems include:
● Small and simple kernel: The microkernel is designed to be as small and simple as
possible, containing only the basic functions needed to manage system resources, such as
memory, processes, and interprocess communication.

● Modular design: Most of the operating system’s services and drivers are moved into user
space, where they can be loaded and unloaded as needed. This allows for a more modular
and flexible design, and makes it easier to add or remove functionality from the system.
● Message passing: Communication between different parts of the operating system is
typically done using message passing, rather than shared memory. This provides a more
secure and reliable way to exchange information between processes, and helps prevent
bugs and errors from propagating throughout the system.

● Extensibility: The microkernel design makes it easier to add new functionality to the
operating system, since new services and drivers can be added to user space without
modifying the kernel itself.

● Security: By separating the kernel from most of the operating system’s services,
microkernel-based operating systems can be more secure, since bugs and vulnerabilities
in user-space code are less likely to affect the kernel. Additionally, microkernel-based
systems often use formal verification techniques to ensure the correctness of the kernel’s
code.

Advantages of Microkernel –

● Modularity: Because the kernel and servers can be developed and maintained
independently, the microkernel design allows for greater modularity. This can make
adding and removing features and services from the system easier.
● Fault isolation: The microkernel design aids in the isolation of faults and their prevention
from affecting the entire system. If a server or other component fails, it can be restarted
or replaced without causing any disruptions to the rest of the system.
● Performance: Because the kernel only contains the essential functions required to manage
the system, the microkernel design can improve performance. This can make the system
faster and more efficient.
● Security: The microkernel design can improve security by reducing the system’s attack
surface by limiting the functions provided by the kernel. Malicious software may find it
more difficult to compromise the system as a result of this.
● Reliability: Microkernels are less complex than monolithic kernels, which can make them
more reliable and less prone to crashes or other issues.
● Scalability: Microkernels can be easily scaled to support different hardware architectures,
making them more versatile.
● Portability: Microkernels can be ported to different platforms with minimal effort, which
makes them useful for embedded systems and other specialized applications.

5. Kernel:- Kernel is central component of an operating system that manages


operations of computer and hardware. It basically manages operations of memory and
CPU time. It is core component of an operating system. Kernel acts as a bridge
between applications and data processing performed at hardware level using
inter-process communication and system calls.
kernel loads first into memory when an operating system is loaded and remains into
memory until operating system is shut down again. It is responsible for various tasks
such as disk management, task management, and memory management.
Kernel has a process table that keeps track of all active processes.

● Process table contains a per process region table whose entry points to entries in
region table.
● Kernel loads an executable file into memory during ‘exec’ system call’.
● It decides which process should be allocated to processor to execute and which
process should be kept in main memory to execute.
● It basically acts as an interface between user applications and hardware.
● The major aim of kernel is to manage communication between software i.e.
user-level applications and hardware i.e., CPU and disk memory.

Objectives of Kernel :

● To establish communication between user level application and hardware.


● To decide state of incoming processes.
● To control disk management.
● To control memory management.
● To control task management.

S.
Parameters Microkernel Monolithic kernel
No.

In microkernel, user
In monolithic kernel, both user
services and kernel
1. Address Space services and kernel services are kept
services are kept in
in the same address space.
separate address space.

Design and OS is complex to design. OS is easy to design and implement.


2.
Implementation
Microkernel are smaller in Monolithic kernel is larger than
3. Size size. microkernel.

Easier to add new


4. Functionality Difficult to add new functionalities.
functionalities.

To design a microkernel, Less code when compared to


5. Coding more code is required. microkernel

Failure of one component Failure of one component in a


6. Failure does not effect the working monolithic kernel leads to the failure
of micro kernel. of the entire system.

7. Processing Speed Execution speed is low. Execution speed is high.

It is easy to extend It is not easy to extend monolithic


8. Extend Microkernel. kernel.

To implement IPC
messaging queues are used Signals and Sockets are utilized to
9. Communication
by the communication implement IPC in monolithic kernels.
microkernels.

10. Debugging Debugging is simple. Debugging is difficult.

Extra time and resources are needed


11. Maintain It is simple to maintain.
for maintenance.

Message forwarding and


Message passing and context
Message passing and context switching are
12. switching are not required while the
Context switching required by the
kernel is working.
microkernel.
The kernel only offers IPC
The Kernel contains all of the
13. Services and low-level device
operating system’s services.
management services.

14. Example Example : Mac OS X. Example : Microsoft Windows 95.

6.Modules:- Modular structure or approach:


It is considered as the best approach for an OS. It involves designing of a modular kernel.
The kernel has only set of core components and other services are added as dynamically
loadable modules to the kernel either during run time or boot time. It resembles layered
structure due to the fact that each kernel has defined and protected interfaces but it is
more flexible than the layered structure as a module can call any other module.
For example Solaris OS is organized as shown in the figure.

OPERATING-SYSTEM SERVICES
An Operating system provides an environment for the execution of programs. OS
provides certain services to programs and to the users of those programs.
Operating system services are provided for the convenience of the programmer and to
make the programming task easier.
The list of Operating system services that are helpful to the user:
1. User interface
2. Program Execution
3. I/O Operation
4. File system manipulation
5. Communication
6. Error Detection
7. Resource allocation
8. Accounting
9. Protection and Security

1. User Interface
Almost all operating systems have a User Interface (UI). An UI is generally of 3 types:
● Command-Line Interface (CLI) uses text commands and a method for entering them.
● Batch Interface: The commands and directives to control those commands are entered
into files and those files are executed.
● Graphical User Interface (GUI) is a window system with a pointing device (i.e. mouse)
to direct I/O, choose from menus and make selections and a keyboard to enter text.
2. Program Execution
The system must be able to load a program into main memory and to run that program. The
program must be able to end its execution, either normally or abnormally.
3. I/O operations
A running program may require I/O, which may involve a file or an I/O device. Example are
blanking a display screen, recording to a CD or DVD drive or.
4. File-system manipulation
● Programs need to read and write files and directories.
● They need to create and delete them by name, search for a file and list file information.
● Operating systems include permissions management to allow or deny access to files or
directories based on file ownership.
5. Communications
● One process in its life time needs to communicate with another process to exchange
information.
● Communication occurs between processes that are executing on the computer.
● Communications may be implemented via Shared Memory or Message Passing.
● In Shared memory communication two or more processes read and write to a shared
section of memory.
● In Message passing communication the packets of information in predefined formats are
moved between processes by the operating system.
6. Error Detection
The operating system needs to be detecting and correcting errors constantly. The different
types of errors occurred are:
● CPU and Memory hardware errors such as a memory error or a power failure.
● I/O devices errors such as a parity error on disk, a connection failure on a network, or
lack of paper in the printer
● User Program errors such as an arithmetic overflow, an attempt to access an illegal
memory location.
● For each type of error, the operating system should take the appropriate action to ensure
correct and consistent computing.
7. Resource Allocation
● When there are multiple users or multiple jobs running at the same time, resources must
be allocated to each of them.
● Operating system resources are CPU cycles, main memory, file storage, I/O devices etc.
The operating system manages many of these resources.
● CPU cycles, main memory and file storage may have special allocation code. I/O devices
may have much more general request and release code.
● In determining how best to use the CPU, operating systems have CPU-scheduling
routines that take into account the speed of the CPU, the jobs that must be executed, the
Number of registers available and other factors.
● There may also be routines to allocate printers, USB storage drives and other peripheral
devices.
8. Accounting
● Operating system keeps track of different kind of resources used by all users.
● This record keeping may be used for accounting so that users can be billed or simply for
accumulating usage statistics.
● Usage statistics are valuable tool for researchers who wish to reconfigure the system to
improve computing services.
9. Protection and security
● Protection ensures that all access to system resources is controlled because when several
separate processes execute concurrently, it should not be possible for one process to
interfere with the others or with the operating system itself.
● Security of the system defends the system from outsider’s attacks such as invalid access
of system resources such as I/O devices etc. Security starts with user authentication by
providing username and password to gain access to system resources.

You might also like