You are on page 1of 25

OPERATING SYSTEM, (UNIT-1)

Operating system (OS)


An operating system (OS) is system software that acts as an interface
between the user and the computer hardware and controls the execution of all
kinds of programs.
OS performs all the basic tasks like file management, memory management,
process management, handling input and output, and controlling peripheral
devices such as disk drives and printers.
The primary purposes of an Operating
System are to enable applications (software) to
interact with a computer's hardware and to
manage a system's hardware and software
resources. It is one of the most required software
that is present in the device.
Some popular Operating Systems include Linux,
Windows, and UNIX etc. Today, Operating systems are found almost in every
device like mobile phones, personal computers, automobiles, TV etc.
Types of Operating Systems
 Batch Operating System
 Time-Sharing Operating System
 Distributed Operating System
 Network Operating System
 Real-Time Operating System
 Multi-Processing System

1. Batch Operating System


The users of a batch operating system do not interact with the computer
directly. Each user prepares his job on an off-line device like punch cards and
submits it to the computer operator. To speed up processing, jobs with similar
needs are batched together and run as a group. The programmers leave their

BCA, 3rd Semester Page 1


OPERATING SYSTEM, (UNIT-1)

programs with the operator and the operator then sorts the programs with similar
requirements into batches.
The problems with Batch Systems are as follows −
 Lack of interaction between the
user and the job.
 CPU is often idle, because the
speed of the mechanical I/O
devices is slower than the CPU.
 Difficult to provide the desired
priority.

2. Time-Sharing Operating Systems (or Multitasking OS)


Time-sharing Operating Systems enables many people, located at various
terminals, to use a particular computer system at the same time and each user
gets the time of CPU as they get in a single system. The tasks performed are
given by a single user or by different users. The time allotted to execute one task
is called a quantum, and as soon as the time to execute one task is completed,
the system switches over to another
task.
Multiple jobs are executed by the CPU
by switching between them, but the
switches occur so frequently. Thus, the
user can receive an immediate
response.
Advantages are as follows –
 Provides the advantage of quick response.
 Avoids duplication of software.
 Reduces CPU idle time.
Disadvantages are as follows −
 Problem of reliability.

BCA, 3rd Semester Page 2


OPERATING SYSTEM, (UNIT-1)

 Question of security and integrity of user programs and data.


 Problem of data communication.
3. Distributed operating System
Distributed systems use multiple central processors to serve multiple real-time
applications and multiple users. Data processing jobs are distributed among the
processors accordingly.
The processors communicate with one another through various communication
lines (such as high-speed buses). These are referred as loosely coupled
systems or distributed systems.
The advantages of distributed systems are as follows −
 With resource sharing facility, a user at one site may be able to use the
resources available at another.
 Speedup the exchange of data with one another.
 If one site fails in a distributed system, the remaining sites can potentially
continue operating.
 Reduction of the load on the host computer.

4. Network operating System


A Network Operating System runs on a server and provides the server the
capability to manage data, users, groups, security, applications, and other
networking functions. The primary purpose of the network operating system is to
allow shared file and printer access among multiple computers in a network,
typically a local area network (LAN), and a private network or to other networks.

BCA, 3rd Semester Page 3


OPERATING SYSTEM, (UNIT-1)

Examples of network operating systems include Microsoft Windows Server 2003,


Microsoft Windows Server 2008, UNIX,
Linux, Mac OS X, NetWare etc.
The advantages are as follows −
 Centralized servers are highly
stable.
 Security is server managed.
 Remote access to servers is
possible from different locations
and types of systems.
The disadvantages −
 High cost of buying and running a server.
 Dependency on a central location for most operations.
 Regular maintenance and updates are required.
5. Real Time operating System
A real-time system is defined as a data processing system in which the
time interval required to process and respond to inputs is so small that it controls
the environment. The time taken by the system to respond to an input and
display of required information is termed as the response time. Real-time
systems are used when there are rigid time requirements on the operation of a
processor. A real-time operating system must have well-defined, fixed time
constraints, otherwise the system will fail. For example, scientific experiments,
industrial control systems, weapon systems, robots, air traffic control systems,
etc.
6. Multi-Processing Operating System
It is a type of Operating
System in which more than one
CPU is used for the execution of
resources. It betters the throughput
of the System.

BCA, 3rd Semester Page 4


OPERATING SYSTEM, (UNIT-1)

Advantages:
It increases the throughput of the system.
 As it has several processors, so, if one processor fails, we can proceed with
another processor.
Disadvantages:
 Due to the multiple CPU, it can be more complex and somehow difficult to
understand.

Services of Operating System


1. Program execution
2. Input Output Operations
3. Communication between Processes
4. File Management
5. Memory Management
6. Process Management
7. Security and Privacy
8. Resource Management
9. User Interface
10. Networking
11. Error handling
12. Time Management
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.

BCA, 3rd Semester Page 5


OPERATING SYSTEM, (UNIT-1)

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.
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.
File Management
The operating system helps in managing files also. If a program needs access to
a file, it is the operating system that grants access. These permissions include
read-only, read-write, etc. It also provides a platform for the user to create, and
delete files. The Operating System is responsible for making decisions regarding
the storage of all types of data or files, i.e, floppy disk/hard disk/pen drive, etc.
The Operating System decides how the data should be manipulated and stored.
Memory Management
Let’s understand memory management by OS in simple way. Imagine a cricket
team with limited number of player. The team manager (OS) decide whether the
upcoming player will be in playing 11, playing 15 or will not be included in team ,
based on his performance . In the same way, OS first check whether the
upcoming program fulfill all requirement to get memory space or not, if all things
good, it checks how much memory space will be sufficient for program and then
load the program into memory at certain location. And thus, it prevents program
from using unnecessary memory.

BCA, 3rd Semester Page 6


OPERATING SYSTEM, (UNIT-1)

Process Management
Let’s understand the process management in unique way. Imagine, our kitchen
stove as the (CPU) where all cooking(execution) is really happen and chef as the
(OS) who uses kitchen-stove(CPU) to cook different dishes(program). The
chef(OS) has to cook different dishes(programs) so he ensures that any
particular dish(program) does not take long time (unnecessary time) and all
dishes(programs) gets a chance to cooked(execution). The chef(OS) basically
scheduled time for all dishes(programs) to run kitchen (all the system) smoothly
and thus cooked(execute) all the different dishes(programs) efficiently.
Security and Privacy
 Security: OS keep our computer safe from an unauthorized user by adding
security layer to it. Basically, Security is nothing but just a layer of
protection which protect computer from bad guys like viruses and hackers.
OS provide us defenses like firewalls and anti-virus software and ensure
good safety of computer and personal information.
 Privacy: OS give us facility to keep our essential information hidden like
having a lock on our door, where only you can enter and other are not
allowed. Basically, it respects our secrets and provides us facility to keep it
safe.
Resource Management
System resources are shared between various processes. It is the Operating
system that manages resource sharing. It also manages the CPU time among
processes using CPU Scheduling Algorithms. It also helps in the memory
management of the system. It also controls input-output devices. The OS also
ensures the proper use of all the resources available by deciding which resource
to be used by whom.
User Interface
User interface is essential and all operating systems provide it. Users either
interface with the operating system through the command-line interface or

BCA, 3rd Semester Page 7


OPERATING SYSTEM, (UNIT-1)

graphical user interface or GUI. The command interpreter executes the next
user-specified command.
A GUI offers the user a mouse-based window and menu system as an interface.
Networking
This service enables communication between devices on a network, such as
connecting to the internet, sending and receiving data packets, and managing
network connections.
Error Handling
The Operating System also handles the error occurring in the CPU, in Input-
Output devices, etc. It also ensures that an error does not occur frequently and
fixes the errors. It also prevents the process from coming to a deadlock. It also
looks for any type of error or bugs that can occur while any task. The well-
secured OS sometimes also acts as a countermeasure for preventing any sort of
breach of the Computer System from any external source and probably handling
them.
Time Management
Imagine traffic light as (OS), which indicates all the cars(programs) whether it
should be stop(red)=>(simple queue) , start(yellow)=>(ready
queue),move(green)=>(under execution) and this light (control) changes after a
certain interval of time at each side of the road(computer system) so that the
cars(program) from all side of road move smoothly without traffic.

SYSTEM CALL
A system call is a programmatic way in which a computer program
requests a service from the kernel of the operating system it is executed on. A
system call is a way for programs to interact with the operating system. A
computer program makes a system call when it makes a request to the operating
system’s kernel. System call provides the services of the operating system to the
user programs via Application Program Interface (API). It provides an interface

BCA, 3rd Semester Page 8


OPERATING SYSTEM, (UNIT-1)

between a process and an operating system to allow user-level processes to


request services of the operating system. System calls are the only entry points
into the kernel system. All programs needing resources must use system calls.
A system call is initiated by the program executing a specific instruction, which
triggers a switch to kernel mode, allowing the program to request a service from
the OS. The OS then handles the request, performs the necessary operations,
and returns the result back to the program.
System calls are essential for the proper functioning of an operating system, as
they provide a standardized way for programs to access system resources.
Without system calls, each program would need to implement its own methods
for accessing hardware and system services, leading to inconsistent and error-
prone behavior.

Features of System Calls


 Interface: System calls provide a well-defined interface between user
programs and the operating system. Programs make requests by calling
specific functions, and the operating system responds by executing the
requested service and returning a result.
 Protection: System calls are used to access privileged operations that are
not available to normal user programs. The operating system uses this
privilege to protect the system from malicious or unauthorized access.
 Kernel Mode: When a system call is made, the program is temporarily
switched from user mode to kernel mode. In kernel mode, the program has
access to all system resources, including hardware, memory, and other
processes.
 Context Switching: A system call requires a context switch, which involves
saving the state of the current process and switching to the kernel mode to
execute the requested service. This can introduce overhead, which can
impact system performance.

BCA, 3rd Semester Page 9


OPERATING SYSTEM, (UNIT-1)

 Error Handling: System calls can return error codes to indicate problems
with the requested service. Programs must check for these errors and
handle them appropriately.
 Synchronization: System calls can be used to synchronize access to
shared resources, such as files or network connections. The operating
system provides synchronization mechanisms, such as locks or
semaphores, to ensure that multiple programs can access these resources
safely.
How does System Call Work?
 User need special resources: Sometimes programs need to do some
special things which can’t be done without the permission of OS like
reading from a file, writing to a file, getting any information from the
hardware or requesting a space in memory.
 Program makes a system call request: There are special predefined
instructions to make a request to the operating system. These instructions
are nothing but just a “system call”. The program uses these system calls
in its code when needed.
 Operating system sees the system call :When the OS sees the system call
then it recongnises that the program need help at this time so it temporarily
stop the program execution and give all the control to special part of itself
called ‘Kernel’ . Now ‘Kernel’ solves the need of program.
 Operating system performs the operations: Now the operating system
perform the operation which is requested by program.
Example: reading content from a file etc.
 Operating system give control back to the program: After performing the
special operation, OS give control back to the program for further
execution of program .

BCA, 3rd Semester Page 10


OPERATING SYSTEM, (UNIT-1)

Types of System Calls

1. File System Operations


These system calls are made while working with files in OS, File manipulation
operations such as creation, deletion, termination etc.

BCA, 3rd Semester Page 11


OPERATING SYSTEM, (UNIT-1)

 open(): Opens a file for reading or writing. A file could be of any type like
text file, audio file etc.
 read(): Reads data from a file. Just after the file is opened through open()
system call, then if some process want to read the data from a file, then it
will make a read() system call.
 write(): Writes data to a file. Whenever the user makes any kind of
modification in a file and saves it, that’s when this is called.
 close(): Closes a previously opened file.
 seek(): Moves the file pointer within a file. This call is typically made when
we the user tries to read the data from a specific position in a file. For
example, read from line – 47. Than the file pointer will move from line 1 or
wherever it was previously to line-47.
2. Process Control
These types of system calls deal with process creation, process termination,
process allocation, deallocation etc. Basically manages all the process that are a
part of OS.
 fork(): Creates a new process (child) by duplicating the current process
(parent). This call is made when a process makes a copy of itself and the
parent process is halted temporarily until the child process finishes its
execution.
 exec(): Loads and runs a new program in the current process and replaces
the current process with a new process. All the data such as stack,
register, heap memory everything is replaced by a new process and this is
known as overlay. For example, when you execute a java byte code using
command – java “filename”. Then in the background, exec() call will be
made to execute the java file and JVM will also be executed.
 wait(): The primary purpose of this call is to ensure that the parent process
doesn’t proceed further with its execution until all its child processes have
finished their execution. This call is made when one or more child

BCA, 3rd Semester Page 12


OPERATING SYSTEM, (UNIT-1)

processes are forked.


 exit(): It simply terminates the current process.
 kill(): This call sends a signal to a specific process and has various
purpose including – requesting it to quit voluntarily, or force quit, or reload
configuration.
3. Memory Management
These types of system calls deals with memory allocation, deallocation &
dynamically changing the size of a memory allocated to a process. In short, the
overall management of memory is done by making these system calls.
 brk(): Changes the data segment size for a process in HEAP Memory. It
takes an address as argument to define the end of the heap and explicitly
sets the size of HEAP.
 sbrk(): This call is also for memory management in heap, it also takes an
argument as an integer (+ve or -ve) specifying whether to increase or
decrease the size respectively.
 mmap(): Memory Map – it basically maps a file or device into main memory
and further into a process’s address space for performing operations. And
any changes made in the content of a file will be reflected in the actual file.
 munmap(): Unmaps a memory-mapped file from a process’s address
space and out of main memory
 mlock() and unlock(): memory lock defines a mechanism through which
certain pages stay in memory and are not swapped out to the swap space
in the disk. This could be done to avoid page faults. Memory unlock is the
opposite of lock, it releases the lock previously acquired on pages.
4. Interprocess Communication (IPC)

When two or more processes are required to communicate, then various IPC
mechanisms are used by the OS which involves making numerous system calls.
Some of them are:
 pipe(): Creates a unidirectional communication channel between

BCA, 3rd Semester Page 13


OPERATING SYSTEM, (UNIT-1)

processes. For example, a parent process may communicate to its child


process through a pipe making a parent process as input source of its child
process.
 socket(): Creates a network socket for communication. Processes in same
or other networks can communicate through this socket, provided that they
have necessary network permissions granted.
 shmget(): It is short for – ‘shared-memory-get’. It allows one or more
processes to share a portion of memory and achieve interprocess
communication.
 semget(): It is short for – ‘semaphore-get’. This call typically manages the
coordination of multiple processes while accessing a shared resource that
is, the critical section.
 msgget(): It is short for – ‘message-get’. IPC mechanism has one of the
fundamental concept called – ‘message queue’ which is a queue data
structure inside memory through which various processes communicate
with each other. This message queue is allocated through this call allowing
other processes a structured way of communication for data exchange
purpose.
5. Device Management

The device management system calls are used to interact with various
peripheral devices attached to the PC or even the management of the current
device.
 SetConsoleMode(): This call is made to set the mode of console (input or
output). It allows a process to control various console modes. In windows,
it is used to control the behaviour of command line.
 WriteConsole(): It allows us to write data on console screen.
 ReadConsole(): It allows us to read data from console screen (if any
arguments are provided).
 open(): This call is made whenever a device or a file is opened. A unique

BCA, 3rd Semester Page 14


OPERATING SYSTEM, (UNIT-1)

file descriptor is created to maintain the control access to the opened file or
device.
 close(): This call is made when the system or the user closes the file or
device.

System Programs in Operating System


System programs are nothing but a special software which give us facility to
manage and control the computer’s hardware and resources. As we have
mentioned earlier these programs are more closely with the operating system so
it executes the operation fast and helpful in performing essential operation which
can’t be handled by application software.

Here are the examples of System Programs:


1. File Management&#x2013 A file is a collection of specific information
stored in the memory of a computer system. File management is defined
as the process of manipulating files in the computer system; its
management includes the process of creating, modifying and deleting files.
2. Command Line Interface (CLI’s): CLIs is the essential tool for user. It
provides user facility to write commands directly to the system for

BCA, 3rd Semester Page 15


OPERATING SYSTEM, (UNIT-1)

performing any operation. It is a text-based way to interact with operating


system. CLIs can perform many tasks like file manipulation, system
configuration and etc.
3. Device drivers: Device drivers work as a simple translator for OS and
device. Basically it acts as an intermediary between the OS and devices
and provide facility to both OS and devices to understand each other’s
language so that they can work together efficiently without interrupt.
4. Status Information&#x2013 Information like date, time amount of available
memory, or disk space is asked by some users. Others provide detailed
performance, logging, and debugging information which is more complex.
All this information is formatted and displayed on output devices or printed.
Terminal or other output devices or files or a window of GUI is used for
showing the output of programs.
5. File Modification &#x2013 For modifying the contents of files we use this.
For Files stored on disks or other storage devices, we used different types
of editors. For searching contents of files or perform transformations of files
we use special commands.
6. Programming-Language support &#x2013 For common programming
languages, we use Compilers, Assemblers, Debuggers, and interpreters
which are already provided to users. It provides all support to users. We
can run any programming language. All languages of importance are
already provided.
7. Program Loading and Execution &#x2013 When the program is ready after
Assembling and compilation, it must be loaded into memory for execution.
A loader is part of an operating system that is responsible for loading
programs and libraries. It is one of the essential stages for starting a
program. Loaders, relocatable loaders, linkage editors, and Overlay
loaders are provided by the system.
8. Communications &#x2013al connections among processes, users, and

BCA, 3rd Semester Page 16


OPERATING SYSTEM, (UNIT-1)

computer systems are provided by programs. Users can send messages to


another user on their screen, User can send e-mail, browsing on web
pages, remote login, the transformation of files from one user to another.

Design and Implementation in Operating System


Design goals are the objectives of the operating system. They must be met
to fulfill design requirements and they can be used to evaluate the design. These
goals may not always be technical, but they often have a direct impact on how
users perceive their experience with an operating system. While designers need
to identify all design goals and prioritize them, they also need to ensure that
these goals are compatible with each other as well as compatible with user
expectations or expert advice
Designers also need to identify all possible ways in which their designs could
conflict with other parts of their systems—and then prioritize those potential
conflicts based on cost-benefit analysis (CBA). This process allows for better
decision-making about what features make sense for inclusion into final products
versus those which would require extensive rework later down the road. It’s also
important to note that CBA is not just about financial costs; it can also include
other factors like user experience, time to market, and the impact on other
systems.
The process of identifying design goals, conflicts, and priorities is often referred
to as “goal-driven design.” The goal of this approach is to ensure that each
design decision is made with the best interest of users and other stakeholders in
mind.

Implementation:
Implementation is the process of writing source code in a high-level
programming language, compiling it into object code, and then interpreting

BCA, 3rd Semester Page 17


OPERATING SYSTEM, (UNIT-1)

(executing) this object code by means of an interpreter. The purpose of an


operating system is to provide services to users while they run applications on
their computers.
The main function of an operating system is to control the execution of
programs. It also provides services such as memory management, interrupt
handling, and file system access facilities so that programs can be better utilized
by users or other devices attached to the system.
An operating system is a program or software that controls the computer’s
hardware and resources. It acts as an intermediary between applications, users,
and the computer’s hardware. It manages the activities of all programs running
on a computer without any user intervention.
The operating system performs many functions such as managing the
computer’s memory, enforcing security policies, and controlling peripheral
devices. It also provides a user interface that allows users to interact with their
computers.
The operating system is typically stored in ROM or flash memory so it can be run
when the computer is turned on. The first operating systems were designed to
control mainframe computers. They were very large and complex, consisting of
millions of lines of code and requiring several people to develop them.
Today, operating systems are much smaller and easier to use. They have been
designed to be modular so they can be customized by users or developers.

There are many different types of operating systems:


1. Graphical user interfaces (GUIs) like Microsoft Windows and Mac OS.
2. Command line interfaces like Linux or UNIX
3. Real-time operating systems that control industrial and scientific equipment
4. Embedded operating systems are designed to run on a single computer
system without needing an external display or keyboard.
An operating system is a program that controls the execution of computer

BCA, 3rd Semester Page 18


OPERATING SYSTEM, (UNIT-1)

programs and provides services to the user.


The design and implementation of an operating system is a complex process
that involves many different disciplines. The goal is to provide users with a
reliable, efficient, and convenient computing environment, so as to make their
work more efficient.

Different Approaches or Structures of Operating Systems


The structure of the OS depends mainly on how the various standard
components of the operating system are interconnected and melded into the
kernel.
A design known as an operating system enables user application programs to
communicate with the machine’s hardware. Given its complex design and need
to be easy to use and modify, the operating system should be constructed with
the utmost care. A straightforward way to do this is to supernaturally develop the
operating system. These parts must each have unique inputs, outputs, and
functionalities.
Because operating systems have complex structures, we want a structure that is
easy to understand so that we can adapt an operating system to meet our
specific needs. Similar to how we break down larger problems into smaller, more
manageable sub problems, building an operating system in pieces is simpler.
The strategy for integrating different operating system components within the
kernel can be thought of as an operating system structure.
Depending on this, we have the following structures in the operating system
1. Simple/Monolithic Structure
2. Micro-Kernel Structure
3. Hybrid-Kernel Structure
4. Exo-Kernel Structure
5. Layered Structure
6. Modular Structure
7. Virtual Machines

BCA, 3rd Semester Page 19


OPERATING SYSTEM, (UNIT-1)

Simple/Monolithic structure
Such operating systems do not have well-defined structures and are small,
simple, and limited. The interfaces and levels of functionality are not well
separated. MS-DOS is an example of such an operating system. In MS-DOS,
application programs are able to access the basic I/O routines. These types of
operating systems cause the entire system to crash if one of the user programs
fails.
Advantages of Simple/Monolithic structure
 It delivers better application performance because of the few interfaces
between the application program and the hardware.
 It is easy for kernel developers to develop such an operating system.
Disadvantages of Simple/Monolithic structure
 The structure is very complicated, as no clear boundaries exist between
modules.
 It does not enforce data hiding in the operating system.
Micro-kernel Structure
This structure designs the operating system by removing all non-essential
components from the kernel and implementing them as system and user
programs. This result in a smaller kernel called the micro-kernel. Advantages of
this structure are that all new services need to be added to user space and does
not require the kernel to be modified. Thus it is more secure and reliable as if a
service fails, then rest of the operating system remains untouched. Mac OS is an
example of this type of OS.
Advantages of Micro-kernel structure
 It makes the operating system portable to various platforms.
 As micro kernels are small so these can be tested effectively.
Disadvantages of Micro-kernel structure
 Increased level of inter module communication degrades system
performance.

BCA, 3rd Semester Page 20


OPERATING SYSTEM, (UNIT-1)

Hybrid-Kernel Structure
Hybrid-kernel structure is nothing but just a combination of both monolithic-
kernel structure and micro-kernel structure. Basically, it combines properties of
both monolithic and micro-kernel and make a more advance and helpful
approach. It implement speed and design of monolithic and modularity and
stability of micro-kernel structure.
Advantages of Hybrid-Kernel Structure
 It offers good performance as it implements the advantages of both
structure in it.
 It supports a wide range of hardware and applications.
 It provides better isolation and security by implementing micro-kernel
approach.
 It enhances overall system reliability by separating critical functions into
micro-kernel for debugging and maintenance.
Disadvantages of Hybrid-Kernel Structure
 It increases overall complexity of system by implementing both structure
(monolithic and micro) and making the system difficult to understand.
 The layer of communication between micro-kernel and other component
increases time complexity and decreases performance compared to
monolithic kernel.
Exo-Kernel Structure
Exokernel is an operating system developed at MIT to provide application-level
management of hardware resources. By separating resource management from
protection, the exokernel architecture aims to enable application-specific
customization. Due to its limited operability, exokernel size typically tends to be
minimal.
The OS will always have an impact on the functionality, performance, and scope
of the apps that are developed on it because it sits in between the software and
the hardware. The exokernel operating system makes an attempt to address this

BCA, 3rd Semester Page 21


OPERATING SYSTEM, (UNIT-1)

problem by rejecting the notion that an operating system must provide


abstractions upon which to base applications. The objective is to limit developers
use of abstractions as little as possible while still giving them freedom.
Advantages of Exo-kernel
 Support for improved application control.
 Separates management from security.
 It improves the performance of the application.
 A more efficient use of hardware resources is made possible by accurate
resource allocation and revocation.
 It is simpler to test and create new operating systems.
 Each user-space program is allowed to use a custom memory
management system.

Disadvantages of Exo-kernel
 A decline in consistency
 Exokernel interfaces have a complex architecture.
Layered structure

An OS can be broken into pieces and retain much more control over the system.
In this structure, the OS is broken into a number of layers (levels). The bottom
layer (layer 0) is the hardware, and the topmost layer (layer N) is the user
interface. These layers are so designed that each layer uses the functions of the
lower-level layers. This simplifies the debugging process, if lower-level layers are
debugged and an error occurs during debugging, then the error must be on that
layer only, as the lower-level layers have already been debugged.
The main disadvantage of this structure is that at each layer, the data needs to
be modified and passed on which adds overhead to the system. Moreover,
careful planning of the layers is necessary, as a layer can use only lower-level
layers. UNIX is an example of this structure.
Advantages of Layered structure

BCA, 3rd Semester Page 22


OPERATING SYSTEM, (UNIT-1)

 Layering makes it easier to enhance the operating system, as the


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’s performance is degraded as compared to
simple structure.
 It requires careful planning for designing the layers, as the higher layers
use the functionalities of only the lower layers.
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 a set of core components and other
services are added as dynamically loadable modules to the kernel either during
runtime 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 a layered
structure as a module can call any other module.
VMs (virtual machines)

Based on our needs, a virtual machine abstracts the hardware of our personal
computer, including the CPU, disc drives, RAM, and NIC (Network Interface
Card), into a variety of different execution contexts, giving us the impression that
each execution environment is a different computer. An illustration of it is a
virtual box.
An operating system enables us to run multiple processes concurrently while
making it appear as though each one is using a different processor and virtual
memory by using CPU scheduling and virtual memory techniques.

Let’s discuss few important questions and answers.


Q.1: What is the purpose of System Calls?
The purpose of the system calls is to allow user-level applications access

BCA, 3rd Semester Page 23


OPERATING SYSTEM, (UNIT-1)

of the services provided by the kernel. The user apps do not have the privilege to
perform operations, so they make system calls which further requests a kernel to
provide a specific service.
Q.2: How do device management System Calls work?
Device management system calls work by allowing a certain process or a
device interact and get access to other hardware resources and perform various
operations.
Q.3: What is user mode and kernel mode?
User mode and kernel modes are two different privilege modes of a
Computer System that separates the execution of operations by the user
applications and the kernel on hardware. This separation provides security,
stability, and a level of control over system resources.
Q.4: What happens when a System Call is executed?
When a system call is executed, a context switch occurs and the computer
system switches from user mode to kernel mode and now the kernel performs
the desired operation.
Q.5: What is a software interrupt?
A software interrupt is a mechanism through which the OS performs a
context switch and transition from user mode to kernel mode. A software
interrupt use is not limited only to the system calls but it can also be made when
a high priority task is required to be executed by the CPU.
Q.6: What is a Microkernel?
A microkernel is an operating system structure that aims to keep the kernel
as small and lightweight as possible. It provides only essential services, such as
process scheduling and inter-process communication, while moving most non-
essential services, like device drivers, into user space.
Q.7: What is a Hybrid Kernel?
A hybrid kernel combines features of both monolithic and microkernels. It
includes a small kernel that handles essential services and basic hardware

BCA, 3rd Semester Page 24


OPERATING SYSTEM, (UNIT-1)

interactions, while additional services, such as file systems and device drivers,
run in kernel mode but outside the core kernel.
Q.8 What is a Virtualization-based Kernel?
A virtualization-based kernel, also known as a hypervisor, is an operating
system structure that enables the execution of multiple operating systems
concurrently on the same hardware. It provides virtualized environments for
guest operating systems and manages their interactions with the underlying
hardware.

BCA, 3rd Semester Page 25

You might also like