Unit 1
Unit 1
Unit-1
Contents of the Unit 1
Introduction :
Operating system and functions
Classification of Operating systems- Batch, Interactive, Time sharing, Real Time
System, Multiprocessor Systems, Multiuser Systems, Multiprocess Systems,
Multithreaded Systems,
Operating System Structure- Layered structure
System Components
Operating System services
Reentrant Kernels, Monolithic and Microkernel Systems.
Definition of Operating System
An operating system acts as an intermediary between the user of a computer and computer
hardware. The purpose of an operating system is to provide an environment in which a user can
execute programs in a convenient and efficient manner.
An operating system is software that manages computer hardware. The hardware must provide
appropriate mechanisms to ensure the correct operation of the computer system and to prevent user
programs from interfering with the proper operation of the system.
An operating system is a program that controls the execution of application programs and acts as
an interface between the user of a computer and the computer hardware.
A more common definition is that the operating system is the one program running at all times on
the computer (usually called the kernel), with all else being application programs.
An operating system is concerned with the allocation of resources and services, such as memory,
processors, devices, and information. The operating system correspondingly includes programs to
manage these resources, such as a traffic controller, a scheduler, a memory management module,
I/O programs, and a file system.
Conceptual view of a computer system
Position of the Operating System in our
System
Layered Structure of the Operating
System
The operating system is split into various layers In the layered operating system and each of the
layers have different functionalities.
Layering provides a distinct advantage in an operating system. All the layers can be defined
separately and interact with each other as required.
Layers in Layered Operating System
There are six layers in the layered operating system.
Hardware (Layer 1)
This layer interacts with the system hardware and coordinates with all the peripheral devices used such as
printer, mouse, keyboard, scanner etc. The hardware layer is the lowest layer in the layered operating
system architecture.
CPU Scheduling (Layer 2)
This layer deals with scheduling the processes for the CPU. There are many scheduling queues that are
used to handle processes. When the processes enter the system, they are put into the job queue. The
processes that are ready to execute in the main memory are kept in the ready queue.
Memory Management (Layer 3)
Memory management deals with memory and the moving of processes from disk to primary memory for
execution and back again. This is handled by the third layer of the operating system.
Process Management (Layer 4)
This layer is responsible for managing the processes i.e assigning the processor to a process at a time. This
is known as process scheduling. The different algorithms used for process scheduling are FCFS (first come
first served), SJF (shortest job first), priority scheduling, round-robin scheduling etc.
I/O Buffer (Layer 5)
I/O devices are very important in the computer systems. They provide users with the means of interacting
with the system. This layer handles the buffers for the I/O devices and makes sure that they work correctly.
User Programs (Layer 6)
This is the highest layer in the layered operating system. This layer deals with the many user programs and
applications that run in an operating system such as word processors, games, browsers etc.
Functions of Operating System
Main functions of Operating System:
Process management:- Process management helps OS to create and delete processes. It also provides
mechanisms for synchronization and communication among processes.
Memory management:- Memory management module performs the task of allocation and de-allocation of
memory space to programs in need of this resources.
File management:- It manages all the file-related activities such as organization storage, retrieval, naming,
sharing, and protection of files.
Device Management: Device management keeps tracks of all devices. This module also responsible for this task
is known as the I/O controller. It also performs the task of allocation and de-allocation of the devices.
I/O System Management: One of the main objects of any OS is to hide the peculiarities of that hardware devices
from the user.
Secondary-Storage Management: Systems have several levels of storage which includes primary storage,
secondary storage, and cache storage. Instructions and data must be stored in primary storage or cache so that a
running program can reference it.
Security:- Security module protects the data and information of a computer system against malware threat and
authorized access.
Command interpretation: This module is interpreting commands given by the and acting system resources to
process that commands.
Networking: A distributed system is a group of processors which do not share memory, hardware devices, or a
clock. The processors communicate with one another through the network.
Job accounting: Keeping track of time & resource used by various job and users.
Communication management: Coordination and assignment of compilers, interpreters, and another software
resource of the various users of the computer systems.
Components of Operating Systems
An operating system is a large and complex system that can only be created by partitioning into
small pieces. These pieces should be a well-defined portion of the system, which carefully defined
inputs, outputs, and functions.
File Management
Process Management
I/O Device Management
Network Management
Main Memory management
Secondary-Storage Management
Security Management
1. File Management
A file is a set of related information which is should define by its creator. It commonly represents
programs, both source and object forms, and data. Data files can be numeric, alphabetic, or
alphanumeric.
Function of file management in OS:
The operating system has the following important given activities in connections with file management:
File and directory creation and deletion.
For manipulating files and directories.
Mapping files onto secondary storage.
Backup files on stable storage media.
2. Process Management
The process management component is a procedure for managing the many processes that are
running simultaneously on the operating system. Every software application program has one or more
processes associated with them when they are running.
For example, when you use a browser like Google Chrome, there is a process running for that
browser program. The OS also has many processes running, which performing various functions.
All these processes should be managed by process management, which keeps processes for running
efficiently. It also uses memory allocated to them and shutting them down when needed.
The execution of a process must be sequential so, at least one instruction should be executed on
behalf of the process.
Functions of process management in OS:
7. Security Management
The various processes in an operating system need to be secured from each other's activities. For that purpose, various
mechanisms can be used to ensure that those processes which want to operate files, memory CPU, and other hardware
resources should have proper authorization from the operating system.
Services of Operating System
An Operating System supplies different kinds of services to both the users and to the programs as
well. It also provides application programs (that run within an Operating system) an environment to
execute it freely. It provides users the services run various programs in a convenient manner.
Advantage Disadvantage
* Avoids duplication of software. * Problem of reliability
* Reduces CPU idle time. * Problem of data communication.
Advantage Disadvantage
• Centralized servers are highly • tfigh cost of buying and
stable. running a server.
• Security is server managed. • Dependency on a central
• Upgrades to new technologies location for most operations.
and hardware can be easily • Regular maintenance and
integrated into the system. updates are required.
• Remote access to servers is
possible f r o m different
locations and types of systems.
Real Time operating System
• A r e a l - t i me system is defined as a
data processing system in which
the t i me interval required to
process and respond to inputs is so
small t h a t i t controls the
environment.
• The t i me taken by the system to
respond to an input and display of
required updated information is
termed as the response time.
• So in this method, the response
t i me is very less as compared to
online processing
• Real-time systems are used when there are
rigid t i me requirements on the operation of a
processor or the flow of data and r e a l - t i m e
systems can be used as a control device in a
dedicated application.
Advantages-
User has the option of controlling his job from its submission to
completion.
Delay time can be reduced by terminating jobs taking long time
Disadvantages-
User interaction can affect other job that are running on current
system.
Extra resources and involved in interactive system.
Multithreading Operation System
A thread is a path which is followed during a program’s execution. Majority of programs written now
a days run as a single thread. Lets say, for example a program is not capable of reading
keystrokes while making drawings. These tasks cannot be executed by the program at the same
time. This problem can be solved through multitasking so that two or more tasks can be executed
simultaneously.
The concept of multi-threading needs proper understanding of these two terms – a process and
a thread. A process is a program being executed. A process can be further divided into
independent units known as threads.
A thread is like a small light-weight process within a process. Or we can say a collection of threads
is what is known as a process.
Kernel in OS
Kernel in Operating System
Kernel is the core part of an operating system which manages system resources. It also acts like a bridge
between application and hardware of the computer. It is one of the first programs loaded on start-up.
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.
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.
Kernel mode and User mode of CPU operation
The CPU can execute certain instruction only when it is in the kernel mode. These
instruction are called privilege instruction. They allow implementation of special
operation whose execution by the user program could interface with the functioning of
operating system or activity of another user program. For example, instruction for
managing memory protection.
Objectives of Kernel
Microkernel is one of the classification of the kernel. Being a kernel it manages all system resources. But
in a microkernel, the user services and kernel services are implemented in different address space. The
user services are kept in user address space, and kernel services are kept under kernel address space,
thus also reduces the size of kernel and size of operating system as well.
Microkernel Architecture –
Since kernel is the core part of the operating system, so it is meant for handling the most important
services only. Thus in this architecture only the most important services are inside kernel and rest of the
OS services are present inside system application program. Thus users are able to interact with those not-
so important services within the system application. And the microkernel is solely responsible for the
most important services of operating system they are named as follows:
Inter process-Communication
Memory Management
CPU-Scheduling
Example :
Mach, L4, AmigaOS, Minix, K42 etc
Advantage :
It is more stable.
Disadvantage :
There are lots of system calls and context switches.
2. Monolithic Kernel –
Monolithic Kernel is another classification of Kernel. Like microkernel this one also manages system
resources between application and hardware, but user services and kernel services are implemented
under same address space. It increases the size of the kernel, thus increases size of operating
system as well.
This kernel provides CPU scheduling, memory management, file management and other
operating system functions through system calls. As both services are implemented under same
address space, this makes operating system execution faster.
Example :
Unix, Linux, Open VMS, XTS-400 etc
Advantage :
It has good performance.
Disadvantage :It has dependencies between
system component and lines of code in millions.
3. Hybrid Kernel –
It is the combination of both monolithic kernel and mircrokernel. It has speed and design of
monolithic kernel and modularity and stability of microkernel.
Example :
Windows NT, Netware, BeOS etc.
Advantage :
It combines both monolithic kernel and microkernel.
Disadvantage :
It is still similar to monolithic kernel.
4. Reentrant Kernel-
A re-entrant kernel enables processes (or, to be more precise, their corresponding kernel threads)
to give away the CPU while in kernel mode. They do not hinder other processes from also entering
kernel mode. In the case of single processor systems multiple may be scheduled together
An example of this case is a disk read. User program issues a system call for a disk read the
scheduler will assign the CPU to another process (kernel thread) until an interrupt from the disk
controller indicates that the data is available and our thread can be resumed. This process can still
access I/O (which needs kernel functions), like user input. The system stays responsive and CPU
time waste due to IO wait is reduced.
In a non reentrant kernel, the original function (whatever requested data) would be blocked until the
disk read was complete
Difference Between Microkernel and Monolithic
Kernel
Assignment No 1
Q1. How are network computers different from the traditional personal
computers?
Q2. What are the main difference between the operating system for
mainframe computers and personal computers?
Q3. What is the main advantage of the microkernel approach to system
design?
Q4. Define the following:
Batch
Interactive
Time Sharing
Q5. Identify the several advantages and disadvantages of the open-source
operating system?
Sources of Contents
1. Silberschatz, Galvin and Gagne, “Operating Systems Concepts”, Wiley
2. https://www.w3schools.in/
3. https://www.geeksforgeeks.org/
4. https://www.guru99.com/
5. https://www.tutorialspoint.com/