Operating System (IT 241)
Unit 1: Operating System Overview (4 hrs)
Prepared By: Manila Tiwari
1
Operating System: BIM 4th Sem
• Introduction of Operating System
Chapter 1 •
•
Two views of Operating System
Evolution of Operating System
• Objectives
Contents •
•
Types of Operating System
Function of Operating System
• System Call
• Handling System Calls
• Operating System Structures
• Kernel and its types
• Shell
• Open-source Operating System
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem 2
Introduction
• A computer system consists of hardware and software.
• A simple definition of Computer Hardware is “any physical parts or components
that contribute to a computer system that can be seen and touch”.
• A set of instructions, data or programs used to operate computers and execute
specific tasks is called software.
• Software tells the computer how the tasks are to be performed; hardware carries out
these tasks.
• Different sets of software can be loaded on the same hardware to perform different
kinds of tasks.
• For example, a user can use the same computer hardware for writing a report or for
running a payroll program.
Prepared By: Manila Tiwari 3
Operating System: BIM 4th Sem
Relation between Hardware and Software
• Software refers to the computer programs that are loaded into a computer system,
and hardware refers to all the visible devices, which are assembled together to build
a computer system.
• Even though hardware is the physical part of a computer, it is nothing unless it has
software to control it.
• Hardware and software then share a special relationship. If hardware is the 'heart' of
a computer system, software is its 'soul’.
• Both are complimentary to each other. Hardware is of no use without software and
software cannot be used without hardware.
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem
4
Types of Software
• Based on the kind of task they perform, software can be divided into two major groups:
System software
Application software
Fig: Types of Software
Prepared By: Manila Tiwari
5
Operating System: BIM 4th Sem
System Software
• System software is computer software designed to
operate the computer hardware to provide basic
functionality and to provide a platform for running
application software.
• It also provides the interface between the user and
component of the computer.
• Depending on the functionality, the system software can
be further divided into two major categories:
A. For system management and functionality
B. For developing software
Fig: System Software
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem 6
A. For system management and functionality
• It relates to the functioning of different components of the computer like processor, input and
output devices etc.
• It provides support for various services, as requested by the application software. It includes
operating system, device drivers and system utilities.
1. Operating System:
• It consists of programs, which controls, coordinates and supervises the activities of the various
components of a computer system.
• Its function is to provide link between the computer hardware and the user.
• It performs all internal management functions (disk access, memory management, task scheduling
and user interfacing) and ensures systematic functioning of a computer system.
• It provides an environment to run the programs.
• E.g., MS-DOS, windows, Unix, Linux, etc.
Prepared By: Manila Tiwari
7
Operating System: BIM 4th Sem
2. Device drivers:
• Device Driver is a software component that serves as an interface between the operating
system and the device controller.
• A device driver usually communicates with the hardware by means of the computer bus
to which the hardware is connected.
• It is essential that a computer have the correct device drivers for all its parts to keep the
system running efficiently.
• When first turning on a computer, the OS works with device drivers and the basic
input/output system (BIOS) to perform hardware tasks. Without a device driver, the OS
would not be able to communicate with the I/O device.
• For example, when we give a command to read data from the hard disk, the command is
sent to the hard disk driver and is translated to a form that the hard disk can understand.
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem 8
3. System Utilities:
• The Utility Software is system software that helps to maintain the proper and smooth functioning of
a Computer System.
• It assists the Operating System to manage, organize, maintain, and optimize the functioning of the
computer system.
• Utility Software performs certain tasks like virus detection, installation, and uninstallation, data
backup, deletion of unwanted files, etc.
• Some examples of system utilities are:
Anti-virus utility to scan computer for viruses.
Data Compression utility to compress the files.
Cryptographic utility to encrypt and decrypt files.
Disk Compression utility to compress contents of a disk for increasing the capacity of a disk.
Disk Cleaners to find files that have not been used for a long time. It helps the user to decide
what to delete when the hard disk is full.
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem
9
B. System software for developing application software
• It is required for the development and execution of application software.
• It provides services required for the development and execution of application
software.
• Some system software, which are required for the application software
development are described below:
1. Programming Language
2. Translator Software
3. Loader
4. Linker
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem
10
1. Programming languages:
• A Programming Language consists of a set of vocabulary and
grammatical rules, to express the computations and tasks that the
computer has to perform
• Programming languages are used to write a program, which controls
the behavior of computer, codify the algorithms precisely, or enables
the human-computer interface.
• Programming Language usually refers to high-level languages like
COBOL, BASIC, FORTRAN, C, C++, Java etc.
• Programming languages fall into three categories:
Machine Language is what the computer can understand but it is Fig: Programming Languages
difficult for the programmer to understand.
Assembly Language falls in between machine language and high-
level language. They are similar to machine language, but easier to
program in, because they allow the programmer to substitute
names for numbers.
High-level Language is easier to understand and use for the
programmer but difficult for the computer.
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem 11
2. Translator Software:
• Translator software is used to convert a program written in high-level language and assembly language
to a form that the computer can understand.
• Translator software converts a program written in assembly language, and high-level language to a
machine-level language program.
• The translated program is called the object code.
• There are three different kind of translator software:
1. Assembler: Assembler is a translator software which takes assembly code as input and produces machine
code as output.
2. Compiler: A program written in a high-level language has to be converted to a language that the computer
can understand, i.e. binary form. Compiler is the software that translates the program written in a high-level
language to machine language. The program written in high-level language is referred to as the source code
and compiled program is referred as the object code. Some languages that use a compiler are C, C++,
Pascal, and FORTRAN
3. Interpreter: The purpose of interpreter is similar to that of a compiler. The interpreter is used to convert the
high-level language program into computer-understandable form. Interpreter reads the source code line-by-
line, converts it into machine understandable form. Since interpreter interprets line-by-line, the interpreted
code runs slower than the compiled code. Some languages that use an interpreter are Matlab, Javascript, and
Python.
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem 12
3. Linker:
• The Assembler generates the object code of a source program and hands it over to the linker.
• The linker takes this object code and generates the executable code for the program, and hand
it over to the Loader.
• Sometimes the large programs are divided into the subprograms which are called modules.
Now when these modules are compiled and assembled, the object modules of the source
program are generated. The linker has the responsibility of combining/linking all the object
modules to generate a single executable file of the source program.
4. Loader:
• As the program that has to be executed currently must reside in the main memory of the
computer.
• It is the responsibility of the loader, a program in an operating system, to load the executable
file/module of a program, generated by the linker, to the main memory for execution.
• A loader moves the executable code to RAM and then it is executed by a CPU.
13
Application Software
• The software that a user uses for accomplishing a specific task is the application software.
Application software may be a single program or a set of programs.
• A set of programs that are written for a specific purpose and provide the required functionality is
called software package.
• There are two types of application software:
1. General Purpose Software
2. Specific Purpose Software
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem 14
1. General Purpose Software:
• General purpose software’s are designed to perform general tasks.
• Some of the general purpose application software are:
Word processing software: For writing letters, reports, documents etc. E.g. MS-Word
Spreadsheet software: Used for creating budgets, tables etc. E.g. MS-Excel
Presentation software: To make presentations, slides shows etc. E.g. MS-Powerpoint
Image processing software: For drawing, editing photos or images, manipulating graphics etc.
E.g. Adobe photoshop.
2. Specific purpose software:
• Specific purpose software are designed to perform specific [Link] type of application software
generally has one purpose to execute.
• Some of the specific purpose application software’s are:
Reservation system: It is used to store and retrieve information and conduct transaction related to
air travel, hotels, car rental or other activities.
Attendance system: It is used to track and optimize the presence of a person/ student in an
organization or school.
Billing system: It is used to perform the billing process.
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem 15
Operating System
• An OS (Operating System) is a collection of computer program that manages all the
other programs and the computer hardware.
• Its function is to provide link between the computer hardware and the user.
• The purpose of an operating system is to provide an environment in which a user can
execute programs.
• It stores files in an organized manner (namewise, datewise, sizewise,
ascending/descending order, folder) and coordinates the use of the computer hardware
such as keyboard and mouse.
• It performs all internal management functions (disk access, memory management, task
scheduling and user interfacing) and ensures systematic functioning of a computer system.
• An operating system is an important part of almost every computer system.
• A computer system can be divided roughly into four components: the hardware, the
operating system, the application programs and the users as shown in the figure below.
• Example of operating system: Windows, Linux, Unix, etc.
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem 16
• A computer’s operating system is a group of programs designed to serve two basic
purposes:
1. To control the allocation and use of the computing system’s resources among the
various users and tasks, and
2. To provide an interface between the computer hardware and the programmer that
simplifies and makes feasible the creation, coding, debugging, and maintenance of
application programs.
Fig: Operating System
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem 17
Two Views of Operating System
1. The Operating System as an Extended Machine
• The architecture of most computers at machine - language level is primitive and awkward
to program, especially for input output. So one of the major task of operating system is to
hide the hardware and present programs with nice, clean, consistent and user friendly.
• Thus, all we need is the program should hide the truth about hardware. To achieve it all
the operating system provides a variety of services that programs can instructions called
system calls.
• The operating system masks or hides the details of the Hardware form the programmers
and general users and provides a convenient interface for using the system.
• The program that hides the truth about the hardware from the user and presents a nice
simple view of named files that can be read and written is of course the operating system.
• In this view, the function of OS is to present the user with the equivalent of an extended
machine or virtual machine that is easier to program than underlying hardware.
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem 18
2. The Operating System as a Resource Manager
• The major function of any machine is how resources are managed.
• For example, we constructed system which provides all necessary banking
operations, Now, one of the user needs to deposit amount while another user
requires to print statement i.e. first user requires access to database while the
second one too requires to access database as well as printer.
• Users are interested in getting their job done quicker anyhow. But the problem
occurs with the system how to manage these requests.
• The process of managing all those requests/ resources is called resource
management and this is done by resource manager.
• Hardware provides basic computing resources CPU, memory, I/O devices, etc.
whereas operating system controls and coordinates the use of the hardware
among the users.
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem 19
Evolution of Computer Operating Systems
• Operating systems have been evolving through the years.
• The first true digital computer was designed by the English mathematician
Charles Babbage (1792–1871).
• Although Babbage spent most of his life and for tune trying to build his
‘‘analytical engine,’’ he never got it working properly because it was purely
mechanical, and the technology of his day could not produce the required
wheels, gears, and cogs to the high precision that he needed.
• Needless to say, the analytical engine did not have an operating system. As an
interesting historical aside, Babbage realized that he would need software for
his analytical engine, so he hired a young woman named Ada Lovelace, who
was the daughter of the famed British poet Lord Byron, as the world’s first
programmer. The programming language Ada® is named after her.
Prepared By: Manila Tiwari 20
Operating System: BIM 4th Sem
First Generation((1940 to 1956): Using Vacuum Tubes
• Hardware Technology: The first generation of computers used vacuum for circuitry and
magnetic drums for memory. The input to the computer was through punched cards and paper
tapes. The output was displayed as printouts
• Software Technology: The instructions were written in machine language. Machine language
uses 0s and 1s for coding of the instructions. The first generation computers could solve one
problem at a time
Second Generation(1956 to 1963): Using Transistors
• Hardware Technology: Transistor was used in place of vacuum tube, allowing computers to
become smaller, faster, cheaper and more energy-efficient than first generation. The second
generation computers used magnetic core technology for primary memory. They used magnetic
tapes and magnetic disks for secondary storage. The input was still through punched cards and
the output using printouts
• Software Technology: Second-generation computers moved from binary to assembly
languages(mnemonics). High-level programming languages were also being developed at this
time, such as early versions of COBOL(Common Business Oriented Language) and
Prepared By: Manila Tiwari
FORTRAN(Formula Translation). Operating th
System: BIM 4 Sem 21
Third Generation(1964 to 1971): Using Integrated Circuits
• Hardware Technology: The third generation computers used the Integrated
Circuit (IC) chips. In an IC chip, multiple transistors are placed on a silicon chip.
Silicon is a type of semiconductor. The use of IC chip increased the speed and the
efficiency of computer. The keyboard and monitor were used to interact with the
third generation computer, instead of the punched card and printouts
• Software Technology: The keyboard and the monitor were interfaced through the
operating system. Operating system allowed different applications to run at the
same time. High-level languages were used extensively for programming, instead
of machine language and assembly language.
Prepared By: Manila Tiwari
22
Operating System: BIM 4th Sem
Fourth Generation(1971 to present): Using Microprocessors
• Hardware Technology: Fourth generation computers were developed using
microprocessor technology which is a chip containing millions of transistors and
components designed with Large Scale Integration (LSI) and Very Large Scale
Integration (VLSI) technology, integrating millions of transistors on small silicon
chips. Semiconductor memory replaced magnetic core memory, allowing fast
random access. Secondary storage like magnetic disks became smaller in size and
larger in capacity and pointing devices like the mouse and handheld devices were
developed.
• Software Technology: During this generation, new operating systems like MS-
DOS and MS-Windows were developed, supporting Graphical User Interface
(GUI) for user-friendly interface that allows user to interact with the computer via
menus and icons. High-level programming languages are used for the writing of
programs.
Prepared By: Manila Tiwari
23
Operating System: BIM 4th Sem
Objectives of Operating System
• Operating system is system software that controls and coordinates the use of hardware among the
different application software and users. OS intermediates between the user of computer and the
computer hardware. The user gives a command and the OS translates the command into a form that the
machine can understand and execute.
• The main objectives of OS are as follows:
a. Convenient to use: One of the objectives is to make the computer system more convenient to
use in an efficient manner.
b. User Friendly: To make the computer system more interactive with a more convenient interface
for the users.
c. Easy Access: To provide easy access to users for using resources by acting as an intermediary
between the hardware and its users.
d. Management of Resources: For managing the resources of a computer in a better and faster
way.
e. Controls and Monitoring: By keeping track of who is using which resource, granting resource
requests, and mediating conflicting requests from different programs and users.
f. Fair Sharing of Resources: Providing efficient and fair sharing of resources between the users
and programs. Prepared By: Manila Tiwari
24
Operating System: BIM 4th Sem
Types of Operating System
OS are classified into different types depending on their capability of processing:
(1) Batch Operating System (2) Single user, (3) Multiuser, (4) Multitasking, (5) Multiprocessing, (6) Real
time, and (7) Distributed OS
a. Batch Operating System:
We cannot interact with the computer directly by using type of Operating System. There is an operator
which takes similar jobs having same requirement and group them into batches. Example: Payroll
System, Bank Statements.
Prepared By: Manila Tiwari
25
Operating System: BIM 4th Sem
b. Single User Single Tasking:
As the name implies, this operating system is designed to manage the computer so that one
user can effectively do one thing at a time. Operating system for Personal Computers (PC) are
single user OS. Some functions such as printing a document, and downloading images and
videos are performed in one given frame.
Example: MS-DOS, Palm OS (Used in Palm-held computers).
Advantages:
•Uses less area in memory
•Cost efficient
Disadvantage:
•Less Optimized
Prepared By: Manila Tiwari 26
Operating System: BIM 4th Sem
c. Single-user, Multi-tasking:
• It allows execution of more than one task or process concurrently. For this, the processor time is
divided amongst different tasks.
• This division of time is also called time sharing.
Example: Windows, Mac
Advantages:
•Time-saving
•High productivity in less time frame
Disadvantage:
•Require more space
•More complexity
Prepared By: Manila Tiwari
27
Operating System: BIM 4th Sem
d. Multi-user OS:
• A multi-user operating system allows many different users to take advantage of the computer's
resources simultaneously.
• This type of operating system is operated by computer network or internet
• Multi-user is used in computer networks that allow same data and applications to be accessed by
multiple users at the same time. The users can also communicate with each other.
• Linux, UNIX, and Windows 7 are examples of multiuser OS. Example: facebook
28
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem
e) Multiprocessing OS:
• These OS have two or more processors for a single running process.
• Processing takes place in parallel and is also called parallel processing.
• Each processor works on different parts of the same task, or, on two or more different tasks.
• Since execution takes place in parallel, they are used for high speed execution, and to increase the
power of computer.
Advantages
•It increases the system process.
•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.
Prepared By: Manila Tiwari 29
Operating System: BIM 4th Sem
f) Real-time operating system (RTOS):
• Real Time OS are designed to respond to an event within a predetermined time.
These operating systems are used to control processes.
• Processing is done within a time constraint. OS monitors the events that affect the
execution of process and respond accordingly.
• RTOS is used to control machinery, traffic control systems, scientific instruments and
industrial systems. RTOS can also be used in embedded systems like in transport and
others.
• A very important part of an RTOS is managing the resources of the computer so that
a particular operation executes in precisely the same amount of time every time it
occurs.
• Often embedded systems used in real time environments and use a real time operating
system to communicate with the hardware.
• RTOS processing time requirements are measured in milliseconds.
• LynxOS which uses Command line interface used in aerospace, military,
telecommunications, etc. is an example of real time OS. 30
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem
g) Distributed OS:
• These types of operating system is a recent advancement in the world of computer
technology and are being widely accepted all over the world and, that too, at a great pace.
• A distributed operating system manages a group of independent computers and makes them
appear to be a single computer.
• Various autonomous interconnected computers communicate with each other using a shared
communication network.
• The major benefit of working with these types of the operating system is that it is always
possible that one user can access the files or software which are not actually present on his
system but some other system connected within this network.
Prepared By: Manila Tiwari 31
Operating System: BIM 4th Sem
Advantages of Distributed Operating System
•Failure of one will not affect the other network communication, as all systems are
independent of each other.
•Electronic mail increases the data exchange speed.
•Since resources are being shared, computation is highly fast and durable.
•These systems are easily scalable as many systems can be easily added to the network.
•Delay in data processing reduces.
Disadvantages of Distributed Operating System
•Failure of the main network will stop the entire communication.
•These types of systems are not readily available as they are very expensive.
Prepared By: Manila Tiwari 32
Operating System: BIM 4th Sem
Functions of Operating System
The Functions of Operating System are:
1. Process Management
2. Memory Management
3. File Management
4. Device Management
5. Protection and Security
6. User Interface or Command Interpreter
A brief overview of functions of OS are
discussed below:
Fig: Function of OS
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem 33
1. Process Management
• A process is a program in a state of execution. It is a unit of work for the operating
system.
• A program becomes process when executable file loaded into memory.
• A process can be created, executed, and stopped. There are many processes can be
running the same program.
• All these processes compete for CPU and some other shared resources, and also need to
communicate with each other.
• Process Management manages the process from Main memory to CPU or terminate the
process.
• The operating system is responsible for the following activities in connection with
processes management:
1. The creation and deletion of both user and system processes.
2. The suspension and resumption of processes.
3. The provision of mechanisms for process synchronization.
4. The provision of mechanisms for deadlock handling.
Prepared By: Manila Tiwari 34
Operating System: BIM 4th Sem
2. Memory Management
• Memory is the important part of the computer system which is used to store the data
and information.
• Memory management manages the memory space of main memory.
• It allocate or deallocate the memory space of main memory.
• Main memory is large array of words or bytes where each word or bytes has its own
address.
• It provides fast storage and can be accessed directly by CPU whenever needed.
• For execution of program, it must be in main memory.
• The operating system is responsible for the following activities in connection with
memory management.
1. Keep track of which parts of memory are currently being used and by whom.
2. Decide which processes are to be loaded into memory when memory space
becomes available.
3. Allocate and deallocate memory space as needed.
Prepared By: Manila Tiwari 35
Operating System: BIM 4th Sem
3. File Management
• The file management function of the operating system involves handling the file
system which consists of two parts:-a set of files, and a directory structure.
• File is a collection of related information. Directory structure provides information
about the files stored on the secondary storage. Directory contains information about
all the files within it.
• The file management tasks include:-
Create and delete both files and directories,
Provide access to files,
Allocate space for files,
Keep back-up of files, and
Secure files.
Prepared By: Manila Tiwari
36
Operating System: BIM 4th Sem
4. Device Management
• OS manages and controls the devices attached to the computer. It handles the devices by
combining both hardware and software techniques.
• The device management tasks handled by OS are:-
Handling Input/Output
Communicate, control and monitor the device driver
• OS also provides various services related to I/O like I/O scheduling, buffering, spooling and
error handling.
• Scheduling of I/O requests involves ordering the requests to improve performance of the
system.
• Buffer is a memory area that stores the data, while it is being transferred between two devices
or between a device and an application.
• Spooling is a type of buffer that holds the jobs for a system until the system is ready to accept
the jobs.
Prepared By: Manila Tiwari
37
Operating System: BIM 4th Sem
5. Protection and Security
• OS protects the resources of system. User authentication, file attributes like read, write, encryption, and back-up
of data are used by OS to provide basic protection. Here are the primary functions related to protection and
security that operating systems perform:
[Link] Authentication:
The operating system ensures that only authorized users can access the system by requiring user authentication
through login credentials such as usernames and passwords.
[Link] Control:
Operating systems implement access control mechanisms to regulate user permissions and restrict access to
files, directories, and system resources. This helps prevent unauthorized access and ensures that users have
appropriate levels of access based on their roles.
[Link] Permissions:
The OS enforces file permissions, specifying who can read, write, or execute a file. This is a critical aspect of
access control and protects sensitive data from unauthorized modifications or access.
[Link]:
Many operating systems provide encryption features to secure data at rest and in transit. This helps protect
sensitive information from being intercepted or accessed by unauthorized parties.
[Link] and Network Security:
Operating systems often include firewall capabilities to monitor and control network traffic. Firewalls help
prevent unauthorized access and protect against network-based attacks.
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem
38
6. User Interface
• Operating system provides an interface between the computer user and the computer
hardware.
• Anything you interact with as a user is a part of user interface.
• The user interface is a set of commands or a graphical user interface via which the
user interacts with the applications and the hardware.
• A user interface (UI) refers to the part of an operating system, program, or device that
allows a user to enter and receive information.
• A text-based user interface displays text, and its commands are usually typed on a
command line using a keyboard. Example: Turbo C
• With a graphical user interface , the functions are carried out by means of a
pointing device. It is an user-friendly interface in which a user interacts with
graphical components such as icons, buttons, and menus. Example: Microsoft
windows
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem 39
Operating System Services
• Operating system is a software that acts as an intermediary between the user and
computer hardware.
• It is a program with the help of which we are able to run various applications.
• It is the one program that is running all the time. Every computer must have an
operating system to smoothly execute other programs.
• The OS coordinates the use of the hardware and application programs for various
users. It provides a platform for other application programs to work.
• The operating system is a set of special programs that run on a computer system
that allows it to work properly.
• It controls input-output devices, execution of programs, managing files, etc.
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem 40
Services of Operating System
1. Program execution
2. Input Output Operations
3. Communication between Process
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
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem 41
1. 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.
2. 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.
3. 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. Prepared By: Manila Tiwari
Operating System: BIM 4th Sem 42
4. 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.
5. 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.
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem 43
6. Process Management
Let’s understand the process management in unique way. Imagine, our kitchen stove as the
(CPU) where all cooking(execution) is really happen and chef as the (OS) who uses kitchen-
stove(CPU) to cook different dishes(program). The chef(OS) has to cook different
dishes(programs) so he ensure that any particular dish(program) does not take long
time(unnecessary time) and all dishes(programs) gets a chance to cooked(execution) .The
chef(OS) basically scheduled time for all dishes(programs) to run kitchen(all the system)
smoothly and thus cooked(execute) all the different dishes(programs) efficiently.
7. 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 respect our
secrets and provide us facility to keep it safe.
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem 44
8. 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.
9. 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 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.
10. 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.
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem 45
11. 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.
12. 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.
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem 46
System Calls
• In computing, 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.
• The kernel is the core part of the operating system that manages the system's resources
and provides essential services to other software programs. It acts as a bridge between
the hardware and software, handling tasks such as memory management, process
scheduling, and device drivers.
• 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 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. Prepared By: Manila Tiwari
Operating System: BIM 4th Sem 47
• A user program can interact with the operating system using a system call. A number of
services are requested by the program, and the OS responds by launching a number of
systems calls to fulfill the request. A system call can be written in high-level languages
like C or Pascal or in assembly language. If a high-level language is used, the operating
system may directly invoke system calls, which are predefined functions.
• A system call is a mechanism used by programs to request services from the operating
system (OS).
• 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.
• The figure below describes about the user mode and kernel mode in operating system:
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem 48
Whenever we use an application at that time by
default we are in user mode.
All the core functionalities and drivers work in
kernel mode.
The process get switched in between two modes
i.e. user mode and kernel mode.
Operating system works at kernel mode.
Suppose we are writing a C program, and in that
program suppose it is written that you have to
read a file and have to write something in that
file. Fig: System calls
Remember one thing that the file is stored in Hard Disk and hard disk is a hardware and all the
hardware are in control of kernel. So a user cannot directly access the hardware it have to take the
help of kernel.
To read that file we have to use system call. System call is a way to by which we can access the
kernel. We will use read() system call, it means that we want to read some data from any file.
After it the process gets shifted from user mode to kernel mode.
Now, we will read the file as we are now in the kernel mode. All the operations of read and write will
be completed here.
After that the process will get shifted to user mode again. The process have to shift to user mode
because we the user are working in user mode.
Prepared By: Manila Tiwari 49
Operating System: BIM 4th Sem
Why do you need system calls in Operating System?
There are various situations where you must require system calls in the operating
system. Following of the situations are as follows:
1. It is must require when a file system wants to create or delete a file.
2. Network connections require the system calls to sending and receiving data
packets.
3. If you want to read or write a file, you need to system calls.
4. If you want to access hardware devices, including a printer, scanner, you need a
system call.
5. System calls are used to create and manage new processes.
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem 50
Features of System Calls
1. 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.
2. 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.
3. 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.
4. 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.
5. 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.
6. 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.
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem 51
Example of common system calls includes:
• open(): Opens a file
• read(): Reads data from a file
• write(): Writes data to a file
• fork(): Creates a new process
• exec(): Executes a new program in the current process.
• exit(): Terminates the current process
• malloc(), free(): Allocates and deallocates memory dynamically.
Types of System Calls
There are commonly five types of system calls.
These are as follows:
1. Process Control
2. File Management
3. Device Management
4. Information Maintenance
5. Communication
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem 52
1. Process Control: Process control is the system call that is used to direct the
processes. Some process control examples include creating, load, abort, end,
execute, process, terminate the process, etc.
2. File Management: File management is a system call that is used to handle the
files. Some file management examples include creating files, delete files, open,
close, read, write, etc.
3. Device Management: Device management is a system call that is used to deal
with devices. Some examples of device management include read, device, write,
get device attributes, release device, etc.
4. Information Maintenance: Information maintenance is a system call that is
used to maintain information. There are some examples of information
maintenance, including getting system data, set time or date, get time or date, set
system data, etc.
5. Communication: Communication is a system call that is used for
communication. There are some examples of communication, including create,
delete communication connections, send, receive messages, etc.
Prepared By: Manila Tiwari 53
Operating System: BIM 4th Sem
Handling System Calls
Handling system calls is a fundamental function of an operating system kernel. Handling system
calls involves multiple steps to ensure that user-level requests for operating system services are
processed securely and efficiently. Here's a general overview of how system calls are handled:
a. System Call Invocation: When a program needs to request a service from the operating
system, it makes a system call. This is usually done through a library function (such as those in
the C standard library) that wraps the system call, providing a convenient interface for
programmers.
b. Switch to Kernel Mode: When a system call is invoked, the CPU switches from user mode to
kernel mode. This transition is crucial for security and protection. In user mode, programs have
limited access to system resources , but in kernel mode, the operating system has unrestricted
access to the hardware and can execute privileged instructions.
c. System Call Identification: The operating system must identify which system call the user
program is requesting. This is often done using a system call number, which is passed as
parameter when the system call is invoked. Each system call number corresponds to specific
kernel function. 54
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem
d. Parameter Validation: The kernel then validates the parameters passed by the user
program. This step is crucial for security and stability, as it ensures that all arguments are
within acceptable ranges and point to accessible memory locations. Invalid parameters can
lead to errors or crash the system or security vulnerabilities.
e. System Call Execution: After validation, the kernel executes the corresponding system
call handler. This handler is a function within the kernel that performs the requested
service, such as reading from a file, allocating memory, or creating a process. The
execution involves interacting with hardware devices, managing resources, or performing
necessary computations.
f. Result Generation: After executing the system call, the operating system generates the
result, which might include data read from a file, a status code, or a pointer to allocate
memory. The result is then passed back to the user program.
g. Switch Back to User Mode: Once the system call is executed, the operating system
switches the CPU back to the user mode. The user program continues its execution from
the point immediately after then passed back to the user program.
55
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem
h. Error Handling: If an error occurs during any step of the system call process (e.g., invalid
parameters, resource unavailability), the kernel generates an appropriate error code. This error
code is returned to the user program in place of a normal result. The user program can then
handle the error, typically by checking the return value and taking appropriate action (such as
retrying the operation or reporting the error to the user).
Example of a System Call Workflow
[Link]: A user program calls read(), which internally invokes a system call.
[Link] to Kernel Mode: The read library function executes a trap instruction.
[Link] Call Identification: The kernel identifies the system call number for read.
[Link] Validation: The kernel checks the validity of the file descriptor, buffer pointer,
and byte count.
[Link]: The kernel's read handler reads data from the file into the buffer.
[Link] Generation: The number of bytes read is stored in a register.
[Link] Back to User Mode: The CPU restores user mode and resumes execution of the user
program.
[Link] Handling: If, for example, the file descriptor is invalid, an error code (e.g., -1) is
returned instead, and error is set appropriately. 56
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem
Operating System Structures
• Operating System provides the medium for the user to communicate with the
computer hardware. System software is installed on top of the operating system.
• The operating system should be built with the utmost care because it is such a
complicated structure and should be simple to use and modify.
• Operating System structure is the basic model which is needed to implement
Operating Systems. There are many types of structures, each having its own
properties which are mentioned below:
1. Simple Structure
2. Layered Approach Structure
3. Monolithic Structure
4. Micro-kernel Structure
5. Virtual Machines
57
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem
1. Simple Structure
• It is the simplest Operating System Structure and is not well defined; It can
only be used for small and limited systems.
• In this structure, the interfaces and levels of functionality are well separated;
hence programs can access I/O routines which can cause unauthorized access
to I/O routines.
• 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 Structure:
• Because there are only a few interfaces and levels, it is simple to develop.
• Because there are fewer layers between the hardware and the applications, it
offers superior performance.
Disadvantages of Simple Structure:
Fig: MS-DOS structure
• The entire operating system breaks if just one user program malfunctions.
• Since the layers are interconnected, and in communication with one another,
there is no abstraction or data hiding.
• The operating system's operations are accessible to layers, which can result in
Prepared By: Manila Tiwari
data tampering and system failure. Operating System: BIM 4th Sem
58
2. 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 Simple Structure:
• 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, construction and system verification.
Disadvantages of Simple Structure:
• In this structure, the application’s performance is degraded as compared to
simple structure. Fig: Layered structure of OS
• It requires careful planning for designing the layers, as the higher layers 59
use the functionalities of only the lower layers.
Prepared By: Manila Tiwari
th
3. Monolithic Structure
• The Monolithic operating System in which
the kernel acts as a manager by managing all things
like file management, memory management, device
management, and operational processes of the
Operating System.
• The kernel is the heart of a computer operating
system (OS). Kernel delivers basic services to all
other elements of the System. It serves as the
primary interface between the Operating System and
the hardware. Linux is an example of this structure.
• In monolithic systems, kernels can directly access all
the resources of the operating System like physical
Fig: Monolithic system structure
hardware, exp Keyboard, Mouse etc.
• The monolithic kernel is another name for the
monolithic operating system. Batch processing
and time-sharing maximize the usability of a
processor by multiprogramming. Prepared By: Manila Tiwari 60
Operating System: BIM 4th Sem
• The monolithic kernel functions as a virtual machine by working on top of the
Operating System and controlling all hardware components.
• This is an outdated operating system that was used in banks to accomplish minor
activities such as batch processing and time-sharing, which enables many people at
various terminals to access the Operating System.
Advantages of Simple Structure:
• It is simple to design and implement because all operations are managed
by kernel only, and layering is not needed.
• As services such as memory management, file management, process scheduling,
etc., are implemented in the same address space, the execution of the
monolithic kernel is relatively fast as compared to normal systems. Using the same
address saves time for address allocation for new processes and makes it faster.
• Simple design and implementation.
Disadvantages of Simple Structure:
• If any service in the monolithic kernel fails, the entire System fails because, in address
space, the services are connected to each other and affect each other.
• Lack of modularity makes maintenance and extensions difficult.
• It is not flexible, and to introduce a new service
Prepared By: Manila Tiwari 61
Operating System: BIM 4th Sem
4. Microkernel 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 results in a smaller kernel called the micro-kernel.
• Advantages of this structure are that all new services need to be added to user space and does not
require the kernel to be modified.
• Thus it is more secure and reliable as if a service fails, then rest of the operating system remains
untouched.
• Mac OS is an example of this type of OS.
Advantages of Micro-kernel Structure
• It makes the operating system portable to
various platforms.
• As microkernels are small so these can be
tested effectively.
Disadvantages of Micro-kernel Structure
• Increased level of inter module
communication degrades system
performance. And The construction of a Fig: Microkernel structure
62
system is complicated. Prepared By: Manila Tiwari
Operating System: BIM 4th Sem
Kernel and its types
• 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.
63
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem
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.
Fig: Kernel in OS
Functions and Roles of a Kernel in an Operating System
A kernel of an OS is responsible for performing various functions and has control over the
system. Some main responsibilities of Kernel are given below:
a. Device Management: To perform various actions, processes require access to peripheral
devices such as a mouse, keyboard, etc., that are connected to the computer. A kernel is
responsible for controlling these devices using device drivers. Here, a device driver is a
computer program that helps or enables the OS to communicate with any hardware device.
A kernel maintains a list of all the available devices, and this list may be already known,
configured by the user, or detected by OS at runtime. 64
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem
b. Memory Management: The kernel has full control for accessing the computer's memory.
Each process requires some memory to work, and the kernel enables the processes to safely
access the memory. To allocate the memory, the first step is known as virtual addressing, which
is done by paging or segmentation. Virtual addressing is a process of providing virtual address
spaces to the processes. This prevents the application from crashing into each other.
c. Resource Management: One of the important functionalities of Kernel is to share the
resources between various processes. It must share the resources in a way that each process
uniformly accesses the resource. The kernel also provides a way for synchronization and inter-
process communication (IPC). It is responsible for context switching between processes.
d. Accessing Computer Resources: A kernel is responsible for accessing computer resources
such as RAM and I/O devices. RAM or Random-Access Memory is used to contain both data
and instructions. Each program needs to access the memory to execute and mostly wants more
memory than the available. For such a case, Kernel plays its role and decides which memory
each process will use and what to do if the required memory is not available.
The kernel also allocates the request from applications to use I/O devices such as keyboards,
microphones, printers, etc. Prepared By: Manila Tiwari
65
Operating System: BIM 4th Sem
Types of Kernel
There are mainly five types of Kernel, which are given below:
1. Monolithic Kernel:
• It is one of types of kernel where all operating system services operate in
kernel space.
• In a monolithic kernel, the same memory space is used to implement user
services and kernel services. It means, in this type of kernel, there is no
different memory used for user services and kernel services.
• As it uses the same memory space, the size of the kernel increases, increasing
the overall size of the OS. The execution of processes is also faster than other
kernel types as it does not use separate user and kernel space.
Example: Linux, Open VMS, XTS-400 etc.
66
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem
Advantage:
• The execution of processes is also faster as there is no separate user space and kernel space and
less software involved.
Disadvantage:
• If any service generates any error, it may crash down the whole system.
• These kernels are not portable, which means for each new architecture, they must be rewritten.
• Large in size and hence become difficult to manage.
• To add a new service, the complete operating system needs to be modified.
2. Micro Kernel
• A microkernel is also referred to as μK, and it is different from a traditional kernel or
Monolithic Kernel. In this, user services and kernel services are implemented into two
different address spaces: user space and kernel space. Since it uses different spaces for both
the services, so, the size of the microkernel is decreased, and which also reduces the size of
the OS.
• Microkernels are easier to manage and maintain as compared to monolithic kernels. Still, if
there will be a greater number of system calls and context switching, then it might reduce the
performance of the system by making it slow. 67
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem
• These kernels use a message passing system for handling the request from one server to
another server.
• Only some essential services are provided by microkernels, such as defining memory
address spaces, IPC(Interprocess Communication), and process management. Other services
such as networking are not provided by Kernel and handled by a user-space program known
as servers.
• Example : Mach, L4, AmigaOS, Minix, K42 etc.
Advantage:
• Microkernels can be managed easily.
• A new service can be easily added without modifying the whole OS.
• In a microkernel, if a kernel process crashes, it is still possible to prevent the whole system
from crashing.
Disadvantage:
• There is more requirement of software for interfacing, which reduces the system
performance.
• Process management is very complicated.
• The messaging bugs are difficult to fix.
Prepared By: Manila Tiwari
68
Operating System: BIM 4th Sem
3. Hybrid Kernel
• Hybrid kernels are also known as modular kernels, and it is the combination of both
monolithic kernel and microkernel. It has speed and design of monolithic kernel and modularity
and stability of microkernel.
• A hybrid kernel can be understood as the extended version of a microkernel with additional
properties of a monolithic kernel. These kernels are widely used in commercial OS, such as
different versions of MS Windows.
• Hybrid kernels allow to run some services such as network stack in kernel space to reduce the
performance compared to a traditional microkernel, but it still allows to run kernel code (such
as device drivers) as servers in user-space.
Example : Windows NT, Netware, BeOS etc.
Advantages:
• There is no requirement for a reboot for testing.
• Third-party technology can be integrated rapidly.
Disadvantages:
• There is a possibility of more bugs with more interfaces to pass through.
• It can be a confusing task to maintain the modules for some administrators, especially when
dealing with issues such as symbol differences. 69
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem
4. Exo Kernel
• Exokernel is still developing and is the experimental approach for designing OS.
• This type of kernel is different from other kernels as in this; resource protection is kept separated
from management, which allows us to perform application-specific customization.
Example : Nemesis, ExOS etc.
Advantages:
1. Flexibility: Exokernels offer the highest level of flexibility, allowing developers to customize and
optimize the operating system for their specific application needs.
2. Performance: Exokernels are designed to provide better performance than traditional kernels because
they eliminate unnecessary abstractions and allow applications to directly access hardware resources.
3. Security: Exokernels provide better security than traditional kernels because they allow for fine-
grained control over the allocation of system resources, such as memory and CPU time.
Disadvantages:
1. Complexity: Exokernels can be more complex to develop than traditional kernels because they
require greater attention to detail and careful consideration of system resource allocation.
2. Development Difficulty: Developing applications for exokernels can be more difficult than for
traditional kernels because applications must be written to directly access hardware resources.
3. Limited Support: Exokernels are still an emerging technology and may not have the same level of
support and resources as traditional kernels. 70
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem
5. Nano Kernel
• As the name suggests, in Nanokernel, the complete code of the kernel is very small,
which means the code executing in the privileged mode of the hardware is very small.
Here the term nano defines a kernel that supports a nanosecond clock resolution.
• It is the type of kernel that offers hardware abstraction but without system services.
Micro Kernel also does not have system services therefore the Micro Kernel and Nano
Kernel have become analogous.
Example : EROS etc.
Advantages:
• It provides hardware abstractions even with a very small size.
• Nanokernels are designed to be highly portable, allowing them to run on a wide range of
hardware architectures.
Disadvantages:
• Nanokernels provide only the most essential functions, making them unsuitable for more
complex applications that require a broader range of services.
• Because nanokernels provide only essential functionality, they can be more complex to
develop and maintain than other kernel types.
71
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem
The Shell
• A shell is a user interface that provides access to various services of an operating system. In
general, operating system shells use either a command-line interface (CLI) or graphical user
interface (GUI).As the name suggests, users interact with graphical user interfaces by
clicking on visual elements like windows, icons, and menus to execute tasks. Command
line interfaces, on the other hand, take text commands as inputs to perform different tasks.
a. Command-Line Shell
• A command line interface (CLI) is a computer program that runs on text-based inputs to
execute different tasks. Instead of pointing and clicking with a mouse, it receives single-line
commands that interact with system elements like file management.
• The command-line shell is what most of you imagine when you think of shell, where you
interact with the command-line interface.
• The command-line shell is way more powerful than the graphical shell, but the quality comes at
a price.
• They enable users to perform a wide range of tasks by chaining commands together in scripts.
• Example: Unix-like OS (including Linux and macOS) typically use shells such as Bash, Zsh, or
Fish. Windows OS use Command prompt or power shell.
72
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem
b. Graphical Shell
• GUI stands for Graphical User Interface. GUI permits users to use the graphics to interact
with an operating system.
• In the graphical user interface, menus are provided such as windows, scrollbars, buttons,
wizards, painting pictures, alternative icons, etc.
• In GUI, the information is shown or presented to the user in any form such as: plain text,
videos, images, etc.
• The graphical shell is way simpler and beginner-friendly, especially for new computer
users, and provides all the functionality like opening, closing, moving, and resizing
windows, as well as switching focus between windows in the graphical user interface
(GUI).
• The Windows OS, macOS, and Ubuntu, Pop!_OS, Manjaro are good examples of operating
systems that provide a GUI to the user for interacting with programs.
73
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem
73
Prepared By: Manila Tiwari 74
th
Difference between Shell and Kernel
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem 75
Open Source Operating System
• An open source operating system is a type of operating system whose source code is freely
available for anyone to view, modify, and distribute.
• This means that developers and users can view, modify and distribute the code for security,
make improvements, customize it to their needs, and share their changes with the
community.
• Different open source operating system available in market are as follows:
1. Linux
A family of open-source Unix-like operating systems based on the Linux kernel. Popular for its
robustness, security, and extensive customization. Common distributions include Ubuntu,
Fedora, and Debian.
2. GNU/Linux
A combination of the GNU operating system and the Linux kernel. Emphasizes free software
principles and is similar to Linux distributions, providing a complete operating system with
GNU tools.
76
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem
3. BSD UNIX
A family of Unix-like operating systems derived from the original Unix system at UC
Berkeley. Known for its advanced networking, security features, and permissive licensing.
Includes FreeBSD, OpenBSD, and NetBSD.
4. ReactOS
An open-source operating system designed to be binary-compatible with Microsoft Windows,
allowing it to run Windows applications and drivers. Still in alpha development stage.
5. Haiku
An open-source OS inspired by BeOS, aiming to offer a fast, efficient, and user-friendly
desktop experience, especially for multimedia applications. Compatible with BeOS software.
6. FreeDOS
An open-source operating system compatible with MS-DOS, used for running legacy DOS
applications and games. Simple command-line interface and suitable for modern hardware or
virtual machines.
77
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem
Open-source operating systems are in demand due to several key factors:
1. Cost-Effectiveness: They are usually free, eliminating licensing fees and reducing total
costs for updates and maintenance.
2. Security: Transparency allows anyone to review and fix vulnerabilities quickly, with
continuous monitoring by a large developer community.
3. Customization and Flexibility: Users can modify the source code to meet specific needs,
and there is a wide range of distributions for different uses.
4. Community Support: Strong, active communities provide support and contribute to rapid
development and frequent updates.
5. Innovation and Independence: Open-source projects can innovate quickly without
corporate constraints and avoid vendor lock-in.
6. Performance and Reliability: Known for efficiency and stability, especially in server
environments, and often designed to run well on older hardware.
7. Educational Value: Access to source code offers a valuable learning tool, and users can
gain experience by contributing to the projects.
8. Compliance and Auditing: Open-source code ensures compliance with standards and
avoids proprietary restrictions, allowing modifications without legal concerns.
78
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem
79
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem
Assignment 1 Deadline: 21th Asadh
1. What is an operating system? What are the two aspects of OS?
2. What are the different types of OS? Mention any four function of OS.
3. What is system call? How system calls are handled?
4. Differentiate between the Shell and Kernel.
5. Mention different open source operating system available in market.
80
Prepared By: Manila Tiwari
Operating System: BIM 4th Sem