UNIT 1 Operating System Concept
UNIT 1 Operating System Concept
The Operating System Tutorial is divided into various parts based on its
functions such as Process Management, Process Synchronization, Deadlocks
and File Management.
Definitions
1
OPERATING SYSTEM CONCEPT
An operating system is a program that acts as an interface between the user and
the computer hardware and controls the execution of all kinds of programs.
Following is another definition taken from Wikipedia:
An operating system (OS) is system software that manages computer hardware,
software resources, and provides common services for computer programs.
Architecture
2
OPERATING SYSTEM CONCEPT
3
OPERATING SYSTEM CONCEPT
The operating system is a system program that serves as an interface between the
computing system and the end-user. Operating systems create an environment
where the user can run any programs or communicate with software or
applications in a comfortable and well-organized way.
4
OPERATING SYSTEM CONCEPT
5
OPERATING SYSTEM CONCEPT
Types of Operating System
1. Batch Operating System
2. Time-Sharing Operating System
3. Embedded Operating System
4. Multiprogramming Operating System
5. Network Operating System
6. Distributed Operating System
7. Multiprocessing Operating System
8. Real-Time Operating System
6
OPERATING SYSTEM CONCEPT
8
OPERATING SYSTEM CONCEPT
It is the type of network operating system that allows the users to access
resources, functions, and applications through a common server or centre hub of
the
resources.
The client
workstation
can access
all resources
that exist in
the central
hub of the
9
OPERATING SYSTEM CONCEPT
network. Multiple clients can access and share different types of the resource over
the network from different locations.
With the ease of a distributed system, the programmer or developer can easily
access any operating system and resource to execute the computational tasks and
achieve a common goal. It is the extension of a network operating system that
facilitates a high degree of connectivity to communicate with other users over the
network.
10
OPERATING SYSTEM CONCEPT
11
OPERATING SYSTEM CONCEPT
o These types of OS are used with those required to complete critical tasks
within the defined time limit. If the response time is high, it is not accepted
by the system or may face serious issues like a system failure. In a hard
real-time system, the secondary storage is either limited or missing, so this
system stored data in the ROM.
o Sof Real – Time System
A soft real-time system is a less restrictive system that can accept software
and hardware resources delays by the operating system. In a soft real-time
system, a critical task prioritizes less important tasks, and that priority
retains active until completion of the task. Also, a time limit is set for a
specific job, which enables short time delays for further tasks that are
acceptable. For example, computer audio or video, virtual reality,
reservation system, projects like undersea, etc.
When the first electronic computer was developed in 1940, it was created without
any operating system. In early times, users have full access to the computer
machine and write a program for each task in absolute machine language. The
programmer can perform and solve only simple mathematical calculations during
the computer generation, and this calculation does not require an operating
system.
The first operating system (OS) was created in the early 1950s and was known
as GMOS. General Motors has developed OS for the IBM computer. The
second-generation operating system was based on a single stream batch
processing system because it collects all similar jobs in groups or batches and
then submits the jobs to the operating system using a punch card to complete all
jobs in a machine. At each completion of jobs (either normally or abnormally),
control transfer to the operating system that is cleaned after completing one job
and then continues to read and initiates the next job in a punch card. After that,
new machines were called mainframes, which were very big and used by
professional operators.
12
OPERATING SYSTEM CONCEPT
The Third Generation (1965 - 1980)
During the late 1960s, operating system designers were very capable of
developing a new operating system that could simultaneously perform multiple
tasks in a single computer program called multiprogramming. The introduction
of multiprogramming plays a very important role in developing operating
systems that allow a CPU to be busy every time by performing different tasks on
a computer at the same time. During the third generation, there was a new
development of minicomputer's phenomenal growth starting in 1961 with the
DEC PDP-1. These PDP's leads to the creation of personal computers in the
fourth generation.
A major factor related to creating personal computers was the birth of Microsoft
and the Windows operating system. Microsoft created the first window operating
system in 1975. After introducing the Microsoft Windows OS, Bill Gates and
Paul Allen had the vision to take personal computers to the next level.
Therefore, they introduced the MS-DOS in 1981; however, it was very difficult
for the person to understand its cryptic commands. Today, Windows has become
the most popular and most commonly used operating system technology. And
then, Windows released various operating systems such as Windows 95,
Windows 98, Windows XP and the latest operating system, Windows 7.
Currently, most Windows users use the Windows 10 operating system.
13
OPERATING SYSTEM CONCEPT
o It is used to create interaction between the users and the computer
application or hardware.
o The performance of the computer system is based on the CPU.
o The response time and throughput time of any process or program are fast.
o It can share different resources like fax, printer, etc.
o It also offers a forum for various types of applications like system and web
application.
14
OPERATING SYSTEM CONCEPT
Operating System provides the user with an easy-to-work user interface, so the
15
OPERATING SYSTEM CONCEPT
user doesn’t have to learn a different UI every time and can focus on the content
and be productive as quickly as possible. Operating System provides templates,
and UI components to make the working of a computer, really easy for the user.
• Multitasking:
Operating System manages memory and allows multiple programs to
run in their own space and even communicate with each other through
shared memory. Multitasking gives users a good experience as they
can perform several tasks on a computer at a time.
• Processor Management:
This deals with the management of the Central Processing Unit (CPU).
The operating system takes care of the allotment of CPU time to
different processes. When a process finishes its CPU processing after
executing for the allotted time period, this is called scheduling.
There is various type of scheduling techniques that are used by the
operating systems:
• Context Switching:
• In most multitasking OSs, multiple running processes on the system
may need a change of state in execution. Even if there are multiple
processes being executed at any one point in time, only one task is
executed in the foreground, while the others are put in the background.
• So, the process that is in the foreground is determined by the priority-
based scheduling, and the OS saves the execution state of the previous
process before switching to the current one. This is known as context
16
OPERATING SYSTEM CONCEPT
switching.
• Device Management:
Buffering:
In this technique, input and output data are temporarily stored in Input
Buffer and Output Buffer. Once the signal for input or output is sent
to or from the CPU respectively, the operating system through the
device controller moves the data from the input device to the input
buffer and from the output buffer to the output device. In the case of
input, if the buffer is full, the operating system sends a signal to the
program which processes the data stored in the buffer. When the buffer
becomes empty, the program informs the operating system which
reloads the buffer and the input operation continues.
Example: printer
Memory management:
17
OPERATING SYSTEM CONCEPT
In a computer, both the CPU and the I/O devices interact with the memory.
When a program needs to be executed it is loaded onto the main memory till the
execution is completed. Thereafter that memory space is freed and is available
for other programs. The common memory management techniques used by the
operating system are Partitioning and Virtual Memory.
• Partitioning:
The total memory is divided into various partitions of the same size or
different sizes. This helps to accommodate a number of programs in
the memory. The partition can be fixed i.e., remains the same for all
the programs in the memory or variable i.e., memory is allocated when
a program is loaded onto the memory. The latter approach causes less
wastage of memory but in due course of time, it may become
fragmented.
• Virtual Memory:
• File Management:
The operating system manages the files, folders, and directory systems
on a computer. Any data on a computer is stored in the form of files
and the operating system keeps the information about all of them using
the File Allocation Table (FAT), or a data structure called an anode in
Linux.
The FAT stores general information about files like filename, type
(text or binary), size, starting address, and access mode
(sequential/indexed sequential/direct/relative). The file manager of the
operating system helps to create, edit, copy, allocate memory to the
files and also updates the FAT. The operating system also takes care
that files are opened with proper access rights to read or edit them.
18
OPERATING SYSTEM CONCEPT
1.3. Single User & Multi User Operating System
Single User Operating System
The operating system is responsible for handling many different tasks and is
typically one of the most important programs used on a computer. It manages
memory usage and other resources, hardware connectivity and the proper
execution of other applications. A single task operating system can only run one
program or application at a time. So, it is not as useful for a computer or other
device intended to run multiple programs at once.
Even though this type of operating system can connect to other computers
through a network, it is still only being used by a single user. As long as the
19
OPERATING SYSTEM CONCEPT
computer only has one monitor, keyboard and other input devices, then it is a
single-user system.
Single user operating system can be classified into two parts, such as:
20
OPERATING SYSTEM CONCEPT
o Time-saving.
o High productivity in less time frame.
o Less memory is used for performing multiple tasks.
Single user operating system provides the following features to the user, such as:
21
OPERATING SYSTEM CONCEPT
The main goal of developing a multi-user operating system is to use it for time-
sharing and batch processing on mainframe systems. This multi-user operating
system is now often used in large organizations, the government sector,
educational institutions like large universities, and on servers' side such as Ubuntu
Server or Windows Server. These servers allow several users to access the
operating system, kernel, and hardware at the same time.
It is usually responsible for handling memory and processing for other running
programs, identifying and using system hardware, and efficiently handling user
interaction and data requests. It's especially important for an operating system, a
multi-user operating system because several users rely on the system to function
properly at the same time.
Memory
The physical memory present inside the system is where storage occurs. It is also
known as Random Access Memory (RAM). The system may rectify the data
that is present in the main memory. So, every executed program should be copied
from physical storage like a hard disk. Main memory is determined as an
important part of OS because it specifies how many programs may be executed
simultaneously.
Kernel
A multi-user operating system makes use of the Kernel component, which is built
in a low-level language. This component is embedded in the computer system's
main memory and may interact directly with the system's H/W.
Processor
The CPU (Central Processing Unit) of the computer is sometimes known as the
computer's brain. In large machines, the CPU would necessitate more ICS. On
smaller computers, the CPU is mapped in a single chip known as a
microprocessor.
22
OPERATING SYSTEM CONCEPT
User Interface
The user interface is the way of interaction between users and all software and
hardware processes. It enables the users to interact with the computer system in
a simple manner.
Device Handler
Each input and output device needs its device handler. The device handler's
primary goal is to provide all requests from the whole device request queue pool.
The device handler operates in continuous cycle mode, first discarding the I/O
request block from the queue side.
Spooler
There are various types of multi-user operating systems. Some of them are as
follows:
Distributed System
Time-Sliced Systems
It's a system in which each user's job gets a specific amount of CPU time. In other
words, each work is assigned to a specific time period. These time slices look too
small to the user's eyes. An internal component known as the 'Scheduler' decides
to run the next job. This scheduler determines and executes the job that must
perform based on the priority cycle.
Multiprocessor System
Multiple processors are used in this system, which helps to improve overall
performance. If one of the processors in this system fails, the other processor is
responsible for completing its assigned task.
23
OPERATING SYSTEM CONCEPT
The single master system is contained within the multi-user system. All network
users can access the master system anytime and from any place and open their
local version of the system. The local version is also known as a 'working model'.
All users can update, delete, and create new files on their local working model,
but this model will not be available to other users until it is saved to the master
system.
Resource Sharing
Several devices, like printers, fax machines, plotters, and hard drives, can be
shared in a multi-user operating system. Users can share their own documents
using this functionality. All users are given a small slice of CPU time under this
system.
Multi-Tasking
Background Processing
Background processing is a term that refers to when commands are not processed
but rather executed "in the background". Usually, other programs interact with
the system in real-time.
Time-Sharing
System
24
OPERATING SYSTEM CONCEPT
Invisibility
Various functions of the multi-user operating system are hidden from users. It is
due to factors such as the OS being instinctive or happening at the lower end,
such as disk formatting, etc.
There are various examples of multi-user operating systems. Some of them are as
follows:
Unix
IBM develops an operating system for use on mainframe systems. It's commonly
utilized in enterprise computing, where high-intensity I/O is required. For
example, Banking, Insurance, Aviation business, etc.
Shared Computing
A multi-user OS is a software that operates the servers that support most webmail
apps. A typical webmail application may require the utilization of hundreds of
computers. Each one runs a multi-user operating system capable of supporting
various users at the same time. Because these systems have millions, if not
billions, of users who constantly log on to check their messages, they require
operating systems that can handle a high number of users at once.
Advantages
25
OPERATING SYSTEM CONCEPT
1. A multi-user operating system can be used in the printing process to allow
multiple users to access the same printer, which a normal operating system
may not do.
2. On a single computer system, several users can access the same copy of a
document. For instance, if a PPT file is kept on one computer, other users
can see it on other systems.
3. Multi-user operating systems are very useful in offices and libraries
because they can efficiently handle printing jobs.
4. If one computer fails in its own network system, the entire system does not
come to a halt.
5. Airlines use multi-user operating systems for some of their functions.
6. The ticket reservation system uses a multi-user operating system.
7. Each user can access the same document on their own computer.
26
OPERATING SYSTEM CONCEPT
1.4. Elements Of an Operating System
An operating system is a large and complex system that can only be created by
partitioning into small parts. These pieces should be a well-defined part of the
system, carefully defining inputs, outputs, and functions.
Although Windows, Mac, UNIX, Linux, and other OS do not have the same
structure, most operating systems share similar OS system components, such as
file, memory, process, I/O device management.
1. Process Management
2. File Management
3. Network Management
4. Main Memory Management
5. Secondary Storage Management
6. I/O Device Management
7. Security Management
8. Command Interpreter System
Operating system components help you get the correct computing by detecting
CPU and memory hardware errors.
27
OPERATING SYSTEM CONCEPT
Process Management
For example, when you use a search engine like Chrome, there is a process
running for that browser program.
The execution of a process must be sequential so, at least one instruction should
be executed on behalf of the process.
Here are the following functions of process management in the operating system,
such as:
28
OPERATING SYSTEM CONCEPT
File Management
The operating system has the following important activities in connection with
file management:
Network Management
29
OPERATING SYSTEM CONCEPT
Main memory is a large array of storage or bytes, which has an address. The
memory management process is conducted by using a sequence of reads or writes
of specific memory addresses.
30
OPERATING SYSTEM CONCEPT
It should be mapped to absolute addresses and loaded inside the memory to
execute a program. The selection of a memory management method depends on
several factors.
However, it is mainly based on the hardware design of the system. Each algorithm
requires corresponding hardware support. Main memory offers fast storage that
can be accessed directly by the CPU. It is costly and hence has a lower storage
capacity. However, for a program to be executed, it must be in the main memory.
Secondary-Storage Management
Today modern computers use hard drives/SSD as the primary storage of both
programs and data. However, the secondary storage management also works with
storage devices, such as USB flash drives and CD/DVD drives. Programs like
assemblers and compilers are stored on the disk until it is loaded into memory,
and then use the disk is used as a source and destination for processing.
Here are some major functions of secondary storage management in the operating
system:
o Storage allocation
o Free space management
o Disk scheduling
One of the important uses of an operating system that helps to hide the variations
of specific hardware devices from the user.
32
OPERATING SYSTEM CONCEPT
Functions of I/O management
The I/O management system offers the following functions, such as:
Security Management
33
OPERATING SYSTEM CONCEPT
For example, memory addressing hardware helps to confirm that a process can
be executed within its own address space. The time ensures that no process has
control of the CPU without renouncing it. Lastly, no process is allowed to do its
own I/O to protect, which helps you to keep the integrity of the various peripheral
devices.
34
OPERATING SYSTEM CONCEPT
Its function is quite simple, get the next command statement, and execute it. The
command statements deal with process management, I/O handling, secondary
storage management, main memory management, file system access, protection,
and networking.
35
OPERATING SYSTEM CONCEPT
• For example − It is easier to deal with photos, emails, songs, and Web
pages than with the details of these files on disks.
• The diagram given below shows the functioning of OS as an extended
machine –
36
OPERATING SYSTEM CONCEPT
37