0% found this document useful (0 votes)
3 views23 pages

Operating System Basic

An Operating System (OS) serves as an interface between users and computer hardware, managing essential tasks such as file, memory, and process management. It can be classified into various types, including Batch, Time-Sharing, and Real-Time Operating Systems, each with distinct advantages and disadvantages. Key functions of an OS include process management, I/O device management, security management, and network management, among others.

Uploaded by

Ayaan shakoor
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views23 pages

Operating System Basic

An Operating System (OS) serves as an interface between users and computer hardware, managing essential tasks such as file, memory, and process management. It can be classified into various types, including Batch, Time-Sharing, and Real-Time Operating Systems, each with distinct advantages and disadvantages. Key functions of an OS include process management, I/O device management, security management, and network management, among others.

Uploaded by

Ayaan shakoor
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

OPERATING SYSTEM

What is Operating System?


An Operating System (OS) is an interface between a computer user and computer hardware.
An operating system is a software which performs all the basic tasks like file management,
memory management, process management, handling input and output, and controlling
peripheral devices such as disk drives and printers.
Generally, a Computer System consists of the following components:
Computer Users are the users who use the overall computer system.
Application Softwares are the softwares which users use directly to perform different
activities. These softwares are simple and easy to use like Browsers, Word, Excel,
different Editors, Games etc. These are usually written in high-level languages, such as
Python, Java and C++.
System Softwares are the softwares which are more complex in nature and they are more
near to computer hardware. These software are usually written in low-level languages like
assembly language and includes Operating Systems (Microsoft Windows, macOS, and
Linux), Compiler, and Assembler etc.
Computer Hardware includes Monitor, Keyboard, CPU, Disks, Memory, etc.

If we consider a Computer Hardware is body of the Computer System, then we can say
an Operating System is its soul which brings it alive ie. operational. We can never use a
Computer System if it does not have an Operating System installed on it.

Operating System - Examples


There are plenty of Operating Systems available in the market which include paid and unpaid
(Open Source). Following are the examples of the few most popular Operating Systems:
Windows: This is one of the most popular and commercial operating systems developed
and marketed by Microsoft. It has different versions in the market like Windows 8,
Windows 10 etc and most of them are paid.
Linux This is a Unix based and the most loved operating system first released on
September 17, 1991 by Linus Torvalds. Today, it has 30+ variants available like Fedora,
OpenSUSE, CentOS, UBuntu etc. Most of them are available free of charges though you
can have their enterprise versions by paying a nominal license fee.
MacOS This is again a kind of Unix operating system developed and marketed by Apple
Inc. since 2001.
iOS This is a mobile operating system created and developed by Apple Inc. exclusively for
its mobile devices like iPhone and iPad etc.
Android This is a mobile Operating System based on a modified version of the Linux kernel
and other open source software, designed primarily for touchscreen mobile devices such
as smartphones and tablets.
Operating System - Functions
To brief, Following are some of important functions of an operating System which we will look in
more detail in upcoming chapters:
Process Management
I/O Device Management
File Management
Network Management
Main Memory Management
Secondary Storage Management
Security Management
Command Interpreter System
Control over system performance
Job Accounting
Error Detection and Correction
Coordination between other software and users
Many more other important tasks

Layered Structure
Layered Structure is a type of system structure in which the different services of the operating
system are split into various layers, where each layer has a specific well-defined task to perform.
It was created to improve the pre-existing structures like the Monolithic structure ( UNIX ) and
the Simple structure ( MS-DOS ).
Example – The Windows NT operating system uses this layered approach as a part of it.

Design Analysis :
The whole Operating System is separated into several layers ( from 0 to n ) as the diagram
shows. Each of the layers must have its own specific function to perform. There are some rules
in the implementation of the layers as follows.
1. The outermost layer must be the User Interface layer.
2. The innermost layer must be the Hardware layer.
3. A particular layer can access all the layers present below it but it cannot access the layers
present above it. That is layer n-1 can access all the layers from n-2 to 0 but it cannot
access the nth layer.
Thus if the user layer wants to interact with the hardware layer, the response will be traveled
through all the layers from n-1 to 1. Each layer must be designed and implemented such that it
will need only the services provided by the layers below it.

Thus if the user layer wants to interact with the hardware layer, the response will be traveled
through all the layers from n-1 to 1. Each layer must be designed and implemented such that it
will need only the services provided by the layers below it.
Advantages :
There are several advantages to this design :
Modularity :
This design promotes modularity as each layer performs only the tasks it is scheduled to perform.
Easy debugging :
As the layers are discrete so it is very easy to debug. Suppose an error occurs in the CPU
scheduling layer, so the developer can only search that particular layer to debug, unlike the
Monolithic system in which all the services are present together.
Easy update :
A modification made in a particular layer will not affect the other layers.
No direct access to hardware :
The hardware layer is the innermost layer present in the design. So a user can use the services of
hardware but cannot directly modify or access it, unlike the Simple system in which the user had
direct access to the hardware.
Abstraction :
Every layer is concerned with its own functions. So the functions and implementations of the other
layers are abstract to it.
Disadvantages :
Though this system has several advantages over the Monolithic and Simple design, there are also
some disadvantages as follows.
[Link] and careful implementation :
As a layer can access the services of the layers below it, so the arrangement of the layers must be
done carefully. For example, the backing storage layer uses the services of the memory
management layer. So it must be kept below the memory management layer. Thus with great
modularity comes complex implementation.
[Link] in execution :
If a layer wants to interact with another layer, it sends a request that has to travel through all the
layers present in between the two interacting layers. Thus it increases response time, unlike the
Monolithic system which is faster than this. Thus an increase in the number of layers may lead to a
very inefficient design.
SYSTEM COMPONENTS
An Operating system is an interface between users and the hardware of a computer system. It
is a system software that is viewed as an organized collection of software consisting of
procedures and functions, providing an environment for the execution of programs. The
operating system manages resources of system software and computer hardware resources. It
allows computing resources to be used in an efficient way. Programs interact with computer
hardware with the help of operating system. A user can interact with the operating system by
making system calls or using OS commands.
Important Components of the Operating System:
Process management
Files management
Command Interpreter
System calls
Signals
Network management
Security management
I/O device management
Secondary storage management
Main memory management
Process Management :
A process is a program in execution. It consists of the followings:

Executable program
Program’s data
Stack and stack pointer
Program counter and other CPU registers
Details of opened files
A process can be suspended temporarily and the execution of another process can be taken up. A
suspended process can be restarted later. Before suspending a process, its details are saved in a
table called the process table so that it can be executed later on. An operating system supports
two system calls to manage processes Create and Kill –
Create a system call used to create a new process.
Kill system call used to delete an existing process.
A process can create a number of child processes. Processes can communicate among
themselves either using shared memory or by message-passing techniques. Two processes
running on two different computers can communicate by sending messages over a network.

Command Interpreter :
There are several ways for users to interface with the operating system. One of the approaches to user
interaction with the operating system is through commands. Command interpreter provides a
command-line interface. It allows the user to enter a command on the command line prompt (cmd). The
command interpreter accepts and executes the commands entered by a user. For example, a shell is a
command interpreter under UNIX. The commands to be executed are implemented in two ways:

The command interpreter itself contains code to be executed.


The command is implemented through a system file. The necessary system file is loaded into
memory and executed.
System Calls :
System calls provide an interface to the services made by an operating system. The user interacts with
the operating system programs through System calls. These calls are normally made available as
library functions in high-level languages such as C, Java, Python etc. It provides a level of abstraction
as the user is not aware of the implementation or execution of the call made. Details of the operating
system is hidden from the user. Different hardware and software services can be availed through
system calls.
System calls are available for the following operations:
Process Management
Memory Management
File Operations
Input / Output Operations
Signals :Signals are used in the operating systems to notify a process that a particular event has
occurred. Signals are the software or hardware interrupts that suspend the current execution of the
task. Signals are also used for inter-process communication. A signal follows the following pattern :
A signal is generated by the occurrence of a particular event it can be the clicking of the mouse,
the execution of the program successfully or an error notifying, etc.
A generated signal is delivered to a process for further execution.
Once delivered, the signal must be handled.
A signal can be synchronous and asynchronous which is handled by a default handler or by the
user-defined handler.
The signal causes temporarily suspends the current task it was processing, saves its registers on
the stack, and starts running a special signal handling procedure, where the signal is assigned to it.
Network Management :In today’s digital world, the complexity of networks and services has
created modern challenges for IT professionals and users. Network management is a set of
processes and procedures that help organizations to optimize their computer networks. Mainly, it
ensures that users have the best possible experience while using network applications and services.
Network management is a fundamental concept of computer networks. Network Management
Systems is a software application that provides network administrators with information on
components in their networks. It ensures the quality of service and availability of network resources.
It also examines the operations of a network, reconstructs its network configuration, modifies it for
improving performance of tasks.
Security Management:The security mechanisms in an operating system ensure that authorized
programs have access to resources, and unauthorized programs have no access to restricted
resources. Security management refers to the various processes where the user changes the file,
memory, CPU, and other hardware resources that should have authorization from the operating
system.
I/O Device Management :The I/O device management component is an I/O manager that hides the
details of hardware devices and manages the main memory for devices using cache and spooling.
This component provides a buffer cache and general device driver code that allows the system to
manage the main memory and the hardware devices connected to it. It also provides and manages
custom drivers for particular hardware devices.
The purpose of the I/O system is to hide the details of hardware devices from the application
programmer. An I/O device management component allows highly efficient resource utilization while
minimizing errors and making programming easy on the entire range of devices available in their
systems.
Secondary Storage Management : Broadly, the secondary storage area is any space, where data
is stored permanently and the user can retrieve it easily. Your computer’s hard drive is the primary
location for your files and programs. Other spaces, such as CD-ROM/DVD drives, flash memory
cards, and networked devices, also provide secondary storage for data on the computer. The
computer’s main memory (RAM) is a volatile storage device in which all programs reside, it provides
only temporary storage space for performing tasks. Secondary storage refers to the media devices
other than RAM (e.g. CDs, DVDs, or hard disks) that provide additional space for permanent storing
of data and software programs which is also called non-volatile storage.
Main memory management :Main memory is a flexible and volatile type of storage device. It is a
large sequence of bytes and addresses used to store volatile data. Main memory is also called
Random Access Memory (RAM), which is the fastest computer storage available on PCs. It is costly
and low in terms of storage as compared to secondary storage devices. Whenever computer
programs are executed, it is temporarily stored in the main memory for execution. Later, the user
can permanently store the data or program in the secondary storage device.
CLASSIFICATION OF OPERATING SYSTEM

An Operating System performs all the basic tasks like managing files, processes, and
memory. Thus operating system acts as the manager of all the resources, i.e. resource
manager. Thus, the operating system becomes an interface between user and machine.
Types of Operating Systems: Some widely used operating systems are as follows-

1. Batch Operating System –


This type of operating system does not interact with the computer directly. There is an
operator which takes similar jobs having the same requirement and group them into
batches. It is the responsibility of the operator to sort jobs with similar needs.

Advantages of Batch Operating System:


It is very difficult to guess or know the time required for any job to complete. Processors of the
batch systems know how long the job would be when it is in queue
Multiple users can share the batch systems
The idle time for the batch system is very less
It is easy to manage large work repeatedly in batch systems
Disadvantages of Batch Operating System:
The computer operators should be well known with batch systems
Batch systems are hard to debug
It is sometimes costly
The other jobs will have to wait for an unknown time if any job fails
Examples of Batch based Operating System: Payroll System, Bank Statements, etc.
2. Time-Sharing Operating Systems –
Each task is given some time to execute so that all the tasks work smoothly. Each user gets the
time of CPU as they use a single system. These systems are also known as Multitasking Systems.
The task can be from a single user or different users also. The time that each task gets to execute
is called quantum. After this time interval is over OS switches over to the next task.

Advantages of Time-Sharing OS:


Each task gets an equal opportunity
Fewer chances of duplication of software
CPU idle time can be reduced
Resource Sharing: Time-sharing systems allow multiple users to share hardware resources
such as the CPU, memory, and peripherals, reducing the cost of hardware and increasing
efficiency.
Improved Productivity: Time-sharing allows users to work concurrently, thereby reducing the
waiting time for their turn to use the computer. This increased productivity translates to more
work getting done in less time.
Improved User Experience: Time-sharing provides an interactive environment that allows users
to communicate with the computer in real-time, providing a better user experience than batch
processing.
Disadvantages of Time-Sharing OS:
Reliability problem
One must have to take care of the security and integrity of user programs and data
Data communication problem
High Overhead: Time-sharing systems have a higher overhead than other operating systems
due to the need for scheduling, context switching, and other overheads that come with
supporting multiple users.
Complexity: Time-sharing systems are complex and require advanced software to manage
multiple users simultaneously. This complexity increases the chance of bugs and errors.
Security Risks: With multiple users sharing resources, the risk of security breaches increases.
Time-sharing systems require careful management of user access, authentication, and
authorization to ensure the security of data and software.
Examples of Time-Sharing OS with explanation:
IBM VM/CMS: IBM VM/CMS is a time-sharing operating system that was first introduced in 1972.
It is still in use today, providing a virtual machine environment that allows multiple users to run
their own instances of operating systems and applications.
TSO (Time Sharing Option): TSO is a time-sharing operating system that was first introduced in
the 1960s by IBM for the IBM System/360 mainframe computer. It allowed multiple users to
access the same computer simultaneously, running their own applications.
Windows Terminal Services: Windows Terminal Services is a time-sharing operating system
that allows multiple users to access a Windows server remotely. Users can run their own
applications and access shared resources, such as printers and network storage, in real-time.

Real-Time Operating System –


These types of OSs serve real-time systems. The time interval required to process and respond to
inputs is very small. This time interval is called response time.
Real-time systems are used when there are time requirements that are very strict like missile
systems, air traffic control systems, robots, etc.
Two types of Real-Time Operating System which are as follows:
Hard Real-Time Systems:
These OSs are meant for applications where time constraints are very strict and even the
shortest possible delay is not acceptable. These systems are built for saving life like automatic
parachutes or airbags which are required to be readily available in case of any accident. Virtual
memory is rarely found in these systems.
Soft Real-Time Systems:
These OSs are for applications where time-constraint is less strict.
Advantages of RTOS:
Maximum Consumption: Maximum utilization of devices and system, thus more output from all
the resources
Task Shifting: The time assigned for shifting tasks in these systems are very less. For
example, in older systems, it takes about 10 microseconds in shifting one task to another, and
in the latest systems, it takes 3 microseconds.
Focus on Application: Focus on running applications and less importance to applications which
are in the queue.
Real-time operating system in the embedded system: Since the size of programs are small,
RTOS can also be used in embedded systems like in transport and others.
Error Free: These types of systems are error-free.
Memory Allocation: Memory allocation is best managed in these types of systems.
Disadvantages of RTOS:
Limited Tasks: Very few tasks run at the same time and their concentration is very less on few
applications to avoid errors.
Use heavy system resources: Sometimes the system resources are not so good and they are
expensive as well.
Complex Algorithms: The algorithms are very complex and difficult for the designer to write on.
Device driver and interrupt signals: It needs specific device drivers and interrupts signals to
respond earliest to interrupts.
Thread Priority: It is not good to set thread priority as these systems are very less prone to
switching tasks.
Interactive operating systems
Interactive operating systems are computers that accept human inputs. Users give commands or some data
to the computers by typing or by gestures. Some examples of interactive systems include MS Word and
Spreadsheets, etc. They facilitate interactive behavior. Mac and Windows OS are some examples of
interactive operating systems.
What is an Interactive Operating System?
An interactive operative system is an operating system that allows the execution of interactive programs.
All PC operating systems are interactive operating systems only.
An interactive operating system gives permission to the user to interact directly with the computer. In an
Interactive operating system, the user enters some command into the system and the work of the system
is to execute it.
Programs that allow users to enter some data or commands are known as Interactive Operating Systems.
Some commonly used examples of Interactive operating systems include Word Processors and
Spreadsheet Applications.
A non-interactive program can be defined as one that once started continues without the need for human
interaction. A compiler can be an example of a non-interactive program.
Properties of Interactive Operating System:
1. Batch Processing: It is defined as the process of gathering programs and data together in a batch before
performing them. The job of the operating system is to define the jobs as a single unit by using some
already defined sequence of commands or data, etc.
2. Before they are performed or carried out, these are stored in the memory of the system and their
processing depends on a FIFO basis. The operating system releases the memory and then copies the
output into an output spool for later printing when the job is finished. Its use is that it basically improves the
system performance because a new job begins only when the old one is completed without any
interference from the user. One disadvantage is that there is a small chance that the jobs will enter an
infinite loop. Debugging is also somewhat difficult with batch processing.
3. Multitasking: The CPU can execute many tasks simultaneously by switching between them. This is
known as Time- Sharing System and also it has a very fast response time. They switch so Fastly that the
users can very easily interact with each running program.
4. Multiprogramming: Multiprogramming happens when the memory of the system stores way too many
processes. The job of the operating system here is that runs these processes in parallel on the same
processor. Multiple processes share the CPU, thus increasing CPU utilization. Now, the CPU only
performs one job at a particular time while the rest wait for the processor to be assigned to them. The
operating system takes care of the fact that the CPU is never idle by using its memory management
programs so that it can monitor the state of all system resources and active programs. One advantage of
this is that it gives the user the feeling that the CPU is working on multiple programs simultaneously.
5. Distributive Environment: A distributive environment consists of many independent processors. The job
of the operating system here is that distribute computation logic among the physical processors and also
at the same time manage communication between them. Each processor has its own local memory, so
they do not share a memory.
6. Interactivity: Interactivity is defined as the power of a user to interact with the system. The main job of the
operating system here is that it basically provides an interface for interacting with the system, manages I/O
devices, and also ensures a fast response time.
7. Real-Time System: Dedicated embedded systems are real-time systems. The main job of the operating
system here is that reads and react to sensor data and then provide a response in a fixed time period,
therefore, ensuring good performance.
[Link]: Spooling is defined as the process of pushing the data from different I/O jobs into
a buffer or somewhere in the memory so that any device can access the data when it is ready.
The operating system here handles the I/O device data spooling because the devices have
different data access rates in order to maintain the spooling buffer. Now the job of the buffer
here is that acts like a waiting station for the data to rest while the devices which are slower can
catch up.
Example of an Interactive Operating System:
Some examples of Interactive operating systems are as follows:
[Link] Operating System
[Link] Operating System
Advantages of Interactive Operating System:
The advantages of an Interactive Operating System are as follows:
Usability: An operating system is designed to perform something and the interactiveness
allows the user to manage the tasks more or less in real-time.
Security: Simple security policy enhancement. In non-interactive systems, the user virtually
always knows what their programs will do during their lifetime, thus allowing us to forecast
and correct the bugs.
Disadvantages of Interactive Operating System:
Tough to design: Depending on the target device, interactivity might be proved challenging
to design because the user must be prepared for every input. What about having many
inputs? The state of a program can alternate at any particular time, all the programs should
be handled in some way, and also it doesn’t always work out properly.
Multiprocessor Systems
A Multiprocessor is a computer system with two or more central processing units (CPUs) share
full access to a common RAM. The main objective of using a multiprocessor is to boost the
system’s execution speed, with other objectives being fault tolerance and application matching.
There are two types of multiprocessors, one is called shared memory multiprocessor and
another is distributed memory multiprocessor. In shared memory multiprocessors, all the CPUs
shares the common memory but in a distributed memory multiprocessor, every CPU has its
own private memory.

Applications of Multiprocessor –
1. As a uniprocessor, such as single instruction, single data stream (SISD).
2. As a multiprocessor, such as single instruction, multiple data stream (SIMD), which is
usually used for vector processing.
3. Multiple series of instructions in a single perspective, such as multiple instruction,
single data stream (MISD), which is used for describing hyper-threading or pipelined
processors.
4. Inside a single system for executing multiple, individual series of instructions in
multiple perspectives, such as multiple instruction, multiple data stream (MIMD).
Benefits of using a Multiprocessor –
Enhanced performance.
Multiple applications.
Multi-tasking inside an application.
High throughput and responsiveness.
Hardware sharing among CPUs.
Types of Multiprocessors
There are mainly two types of multiprocessors i.e. symmetric and asymmetric
multiprocessors. Details about them are as follows −
Symmetric Multiprocessors
In these types of systems, each processor contains a similar copy of the operating system
and they all communicate with each other. All the processors are in a peer to peer
relationship i.e. no master - slave relationship exists between them.
An example of the symmetric multiprocessing system is the Encore version of Unix for the
Multimax Computer.
Asymmetric Multiprocessors
In asymmetric systems, each processor is given a predefined task. There is a master
processor that gives instruction to all the other processors. Asymmetric multiprocessor
system contains a master slave relationship.
Asymmetric multiprocessor was the only type of multiprocessor available before symmetric
multiprocessors were created. Now also, this is the cheaper option.
Advantages of Multiprocessor Systems
There are multiple advantages to multiprocessor systems. Some of these are −
More reliable Systems
In a multiprocessor system, even if one processor fails, the system will not halt. This ability to
continue working despite hardware failure is known as graceful degradation. For example: If
there are 5 processors in a multiprocessor system and one of them fails, then also 4
processors are still working. So the system only becomes slower and does not ground to a
halt.
Enhanced Throughput
If multiple processors are working in tandem, then the throughput of the system increases i.e.
number of processes getting executed per unit of time increase. If there are N processors
then the throughput increases by an amount just under N.
More Economic Systems
Multiprocessor systems are cheaper than single processor systems in the long run because
they share the data storage, peripheral devices, power supplies etc. If there are multiple
processes that share data, it is better to schedule them on multiprocessor systems with
shared data than have different computer systems with multiple copies of the data.
Disadvantages of Multiprocessor Systems
There are some disadvantages as well to multiprocessor systems. Some of these are:
Increased Expense
Even though multiprocessor systems are cheaper in the long run than using multiple
computer systems, still they are quite expensive. It is much cheaper to buy a simple single
processor system than a multiprocessor system.
Complicated Operating System Required
There are multiple processors in a multiprocessor system that share peripherals, memory etc.
So, it is much more complicated to schedule processes and impart resources to
[Link] in single processor systems. Hence, a more complex and complicated
operating system is required in multiprocessor systems.
Large Main Memory Required
All the processors in the multiprocessor system share the memory. So a much larger pool of
memory is required as compared to single processor systems.
Multiuser Operating System

An operating system is software that acts as an interface between the user and the
computer hardware which does multiple functions such as memory management; file
management and processor management. The operating system should have to meet
the requirements of all its users in a balanced way so that if any problem would arise
with a user, it does not affect any other user in the chain.
In a multiuser operating system, multiple numbers of users can access different
resources of a computer at the same time. The access is provided using a network that
consists of various personal computers attached to a mainframe computer system. A
multi-user operating system allows the permission of multiple users for accessing a
single machine at a time. The various personal computers can send and receive
information to the mainframe computer system. Thus, the mainframe computer acts as
the server and other personal computers act as clients for that server.
Components of the multi-user operating system:
1. Memory: Consists of main memory (RAM). Main memory is determined as an
important part of the operating system because it specifies how many programs
may be executed simultaneously. The system can correct data that is present in
the main memory, therefore every program that is executed must be copied from
physical storage.
2. The types of physical storage:
Hard disk: Hard disk can hold a huge amount of data and also determines how
many programs can be run at a single time.
Floppy disk: It is more inexpensive, but it is potable
Optical disks: They use a laser to read and write data. They can hold large data
and portable
Tapes: They are expensive but they can hold a huge amount of data.
3. Kernel: This component is embedded in the computer system’s main memory and
may interact directly with the system’s hardware. The multi-user operating system
uses the kernel component at a low level, it is written in a low-level language.
4. Processor: The core of the computer is called the central processing unit (CPU).
5. Device handler: The device handler’s primary goal is to provide all requests from
the whole device request queue. The device handler operates in continuous cycle
mode, first discarding the I/O request block from the queue side. The concept that
is behind the handler is a queue where we follow the first in first out (FIFO)
principle.
6. Spooler: Simultaneously peripheral output on line. The spooler runs all computer
processes and outputs the results at the same time.
7. User interface: Create a simple environment for all users for using the computer
system. It is the point of communication between users and hardware (or) software.
The main frame is one of the systems which works on the concepts of multi-user
programming concept. It is widely used in banks, to store bank account and
transaction details. This mainframe helps in various ways: security and scalability.
Types of Multi-user Operating Systems:
The multi-user operating systems is of the following types:
1. Distributed System
2. Time sliced system
3. Multiprocessor system

Distributed system:
The distributed operating system also known as distributed computing is a collection of
multiple computers located on different computers. Communicate and coordinate their
actions by passing messages to one another from any system. These all systems
emulate a single coherent system to the end user. The end user will communicate with
them with the help of the network. This system is divided in a way that multiple
requests can be handled and in turn, the individual request can be satisfied eventually.
Examples: Electronic banking, Mobile apps
Time-sliced system:
It is the system where each user talk is allocated to a short span of cpu time. A small
time duration is allotted to every task. CPU time is divided into small time slices, and
one time is assigned to each other. The decision to run the next piece of the job is
decided by the schedule. This schedule executes the run instructions that need to be
executed. The user can take turns and thus the operating system will handle the user’s
request among the users who are connected. This feature is not applicable in the single-
user operating system. They use the mainframe system concurrently
Example: Mainframe, a partial exam of the time-sliced system.
Multi-processor system:
It involves multiple processors at a time. Enhance the overall performance. If one
processor fails other continues working. Example: Spreadsheets, Music player
Features:
The multi-user operating system has the following features:
Resource sharing: This maps to time slicing, multiple peripherals such as printers
can be shared different files or data.
Time-sharing
Background sharing
Invisibility: Many functions of multi-user operating systems are invisible to the user.
Advantages:
It helps in the sharing of data and information among different users.
It also helps in the sharing of hardware resources such as printers.
It avoids disruption if any one computer fails it does not affect any other computer
present on that network.
Users can share their work with other users.
The multi-user operating system is very helpful in economic improvement.
Backing up data can be done in the multi-user operating system.
The services of the multi-user operating systems are very stable and systematic.
Disadvantages:
It requires expensive hardware to set up a mainframe computer
When multiple users log on or work on the same system it reduces the overall
performance of the system.
Information is shared with the public so privacy becomes a concern here.
Operating System Services

It is 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.
Services of Operating System
1. Program Execution
2. Input Output Operations
3. File Management
4. Error Handling
5. Resource Management
6. Communication between Processes
7. Networking
8. System utilities
9. User Interface
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.

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.
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.
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.
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.
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.

Security and Protection:


In an operating system, protection is a mechanism that controls the access of the process,
programs, or users over any resources of the computer system. The operating system
ensures that all access to system resources must be monitored and controlled. It also
ensures that the external resources or peripherals must be protected from invalid access. It
provides authentication by using usernames and passwords.
Reentrant Kernel: In kernel mode, a reentrant kernel allows processes (or, more
precisely, their corresponding kernel threads) to give up the CPU. They have no effect
on other processes entering kernel mode. Multiple processor systems may be scheduled
together in the case of single-processor systems.
Example:

A disc read is an example of this. When a user program requests a disc read, the
scheduler will delegate the CPU to another process (kernel thread) until the disc
controller issues an interrupt indicating that the data is accessible and our thread can be
resumed. This process can still access I/O, such as user input, which requires kernel
functions. The system remains responsive, and the amount of CPU time wasted as a
result of IO delays is reduced. The original function (whatever requested data) would be
blocked in a non-reentrant kernel until the disc read was completed.
If a computer program or routine can be safely called again before its previous
invocation has been completed, it is said to be reentrant (i.e it can be safely executed
concurrently). A computer program or routine that is reentrant:

There cannot be any non-constant data that is static (or global).


The address must not be returned to static (or global) non-constant data.
It must only work with the data provided by the caller.
Locks should not be used to protect singleton resources, a variable that is only
referenced once
It must not change its own code (unless executing in its own unique thread storage).
Non-reentrant computer programs or routines must not be called.
Non-reentrant functions can still be executed by reentrant kernels if locks are used to
ensure that only one process can run the non-reentrant function. Even though the
current process is operating in kernel mode, hardware interrupts can suspend it
(allowing things like Ctrl+c to cease execution).
Kernel Control Path: A set of instructions that the kernel executes in order to handle a
system call. Normally, instructions are executed in order, but some activities force the
CPU to interleave control routes. In user mode, the following system call is made: The
scheduler chooses a new process to run and switches it on. On behalf of two separate
processes, two control pathways are executed.
Microkernel
The microkernel is a type of kernel that permits the customization of the OS. It is privileged
and provides low-level address space management as well as Inter-Process
Communication (IPC). Furthermore, OS functions like the virtual memory manager, file
system, and CPU scheduler are built on top of the microkernel. Every service has its
address space to make them secure. Moreover, every application has its address space.
As a result, there is protection between applications, OS Services, and the kernel.
When an application requests a service from the OS services, the OS services
communicate with one another in order to provide the requested service to the application.
Inter-Process Communication (IPC) can assist in establishing this communication. Overall,
microkernel-based operating systems offer a high level of extensibility. It is also possible to
customize the operating system's services to meet the needs of the application.
Advantages and Disadvantages of Microkernel
There are various advantages and disadvantages of the microkernel. Some of the
advantages and disadvantages of the microkernel are as follows:
Advantages
1. These are modular, and several modules may be modified, reloaded, replaced without
modifying the kernel.
2. The architecture of the microkernel is small and isolated, but it may work better.
3. The Microkernel system is a versatile technique in which the APIs implemented by
several servers may coexist.
4. The system can be expanded more easily because it may be added to the system
application without interrupting the kernel.
5. It adds new features without recompiling.
6. When compared to monolithic systems, there are fewer system crashes.
Disadvantages
1. A context switch is required in the microkernel when the drivers are run as processes.
2. The microkernel system performance might be variable and cause issues.
3. Microkernel services are more expensive than in a traditional monolithic system
Monolithic Kernel
The monolithic kernel manages the system's resources between the system application
and the system hardware. Unlike the microkernel, user and kernel services are run in the
same address space. It increases the kernel size and also increases the size of the OS.
The monolithic kernel offers CPU scheduling, device management, file management,
memory management, process management, and other OS services via the system calls.
All of these components, including file management and memory management, are
located within the kernel. The user and kernel services use the same address space,
resulting in a fast-executing operating system. One drawback of this kernel is that if
anyone process or service of the system fails, the complete system crashes. The entire
operating system must be modified to add a new service to a monolithic kernel.
Advantages and Disadvantages of Monolithic Kernel
There are various advantages and disadvantages of the monolithic kernel. Some of the
advantages and disadvantages of the monolithic kernel are as follows:
Advantages
The monolithic kernel runs quickly because of memory management, file management,
process scheduling, etc.
All of the components may interact directly with each other's and also with the kernel.
It is a single huge process that executes completely within a single address space.
Its structures are easy and simple. The kernel contains all of the components required for
processing.
Disadvantages
1. If the user needs to add a new service, the user requires to modify the complete operating
system.
2. It isn't easy to port code written in the monolithic operating system.
3. If any of the services fails, the entire system fails.

You might also like