0% found this document useful (0 votes)
7 views

Operating System Unit 1

An operating system (OS) is a program that manages application programs and provides an interface for users and programs to interact with hardware. It includes various types such as batch, time-sharing, distributed, and real-time operating systems, each serving different purposes and environments. Key functions of an OS include program execution, I/O operations, file system manipulation, communication, error handling, resource management, and protection.

Uploaded by

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

Operating System Unit 1

An operating system (OS) is a program that manages application programs and provides an interface for users and programs to interact with hardware. It includes various types such as batch, time-sharing, distributed, and real-time operating systems, each serving different purposes and environments. Key functions of an OS include program execution, I/O operations, file system manipulation, communication, error handling, resource management, and protection.

Uploaded by

servicesdell1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

OPERATING SYSTEM UNIT 1

Definition of operating system:


n operating system (OS) is the program that, after being initially loaded
into the computer by a boot program, manages all of the other
application programs in a computer. The application programs make
use of the operating system by making requests for services through a
defined application program interface (API).

Types of operating system:

Types of operating systems


 Batch operating systems. The batch operating system does not have a direct link
with the computer. ...
 Time-sharing or multitasking operating systems. ...
 Distributed operating systems. ...
 Network operating systems. ...
 Real-time operating systems. ...
 Mobile operating systems. ...
 Microsoft Windows. ...
 Apple iOS.

What is real time operating system :


Real-time operating systems (RTOS) are used in environments where a large
number of events, mostly external to the computer system, must be accepted
and processed in a short time or within certain deadlines. such applications are
industrial control, telephone switching equipment, flight control, and real-time
simulations. With an RTOS, the processing time is measured in tenths of
seconds. This system is time-bound and has a fixed deadline. The processing
in this type of system must occur within the specified constraints. Otherwise,
This will lead to system failure.
Examples of the real-time operating systems: Airline traffic control systems,
Command Control Systems, Airlines reservation system, Heart Pacemaker,
Network Multimedia Systems, Robot e
System components:

A system component is a process, program, utility, or another part of a computer's


operating system that helps to manage different areas of the computer. While similar to a
computer program, a system component is not something an end-user directly interacts with
when using a computer
System services:

An Operating System provides services to both the users and to the


programs.

 It provides programs an environment to execute.


 It provides users the services to execute the programs in a
convenient manner.
Following are a few common services provided by an operating system −

 Program execution
 I/O operations
 File System manipulation
 Communication
 Error Detection
 Resource Allocation
 Protection

Program execution
Operating systems handle many kinds of activities from user programs to
system programs like printer spooler, name servers, file server, etc. Each of
these activities is encapsulated as a process.
A process includes the complete execution context (code to execute, data to
manipulate, registers, OS resources in use). Following are the major activities
of an operating system with respect to program management −

 Loads a program into memory.


 Executes the program.
 Handles program's execution.
 Provides a mechanism for process synchronization.
 Provides a mechanism for process communication.
 Provides a mechanism for deadlock handling.
I/O Operation
An I/O subsystem comprises of I/O devices and their corresponding driver
software. Drivers hide the peculiarities of specific hardware devices from the
users.
An Operating System manages the communication between user and device
drivers.

 I/O operation means read or write operation with any file or any
specific I/O device.
 Operating system provides the access to the required I/O device
when required.

File system manipulation


A file represents a collection of related information. Computers can store
files on the disk (secondary storage), for long-term storage purpose.
Examples of storage media include magnetic tape, magnetic disk and optical
disk drives like CD, DVD. Each of these media has its own properties like
speed, capacity, data transfer rate and data access methods.
A file system is normally organized into directories for easy navigation and
usage. These directories may contain files and other directions. Following are
the major activities of an operating system with respect to file management

 Program needs to read a file or write a file.


 The operating system gives the permission to the program for
operation on file.
 Permission varies from read-only, read-write, denied and so on.
 Operating System provides an interface to the user to
create/delete files.
 Operating System provides an interface to the user to
create/delete directories.
 Operating System provides an interface to create the backup of
file system.

Communication
In case of distributed systems which are a collection of processors that do
not share memory, peripheral devices, or a clock, the operating system
manages communications between all the processes. Multiple processes
communicate with one another through communication lines in the network.
The OS handles routing and connection strategies, and the problems of
contention and security. Following are the major activities of an operating
system with respect to communication −

 Two processes often require data to be transferred between them


 Both the processes can be on one computer or on different
computers, but are connected through a computer network.
 Communication may be implemented by two methods, either by
Shared Memory or by Message Passing.

Error handling
Errors can occur anytime and anywhere. An error may occur in CPU, in I/O
devices or in the memory hardware. Following are the major activities of an
operating system with respect to error handling −

 The OS constantly checks for possible errors.


 The OS takes an appropriate action to ensure correct and
consistent computing.

Resource Management
In case of multi-user or multi-tasking environment, resources such as main
memory, CPU cycles and files storage are to be allocated to each user or job.
Following are the major activities of an operating system with respect to
resource management −

 The OS manages all kinds of resources using schedulers.


 CPU scheduling algorithms are used for better utilization of CPU.

Protection
Considering a computer system having multiple users and concurrent
execution of multiple processes, the various processes must be protected
from each other's activities.
Protection refers to a mechanism or a way to control the access of programs,
processes, or users to the resources defined by a computer system.
Following are the major activities of an operating system with respect to
protection −
 The OS ensures that all access to system resources is controlled.
 The OS ensures that external I/O devices are protected from
invalid access attempts.
 The OS provides authentication features for each user by means
of passwords.

System Calls:
In computing, a system call is the programmatic way in which a computer
program requests a service from the kernel of the operating system it is
executed on. A system call is a way for programs to interact with the
operating system. A computer program makes a system call when it makes a
request to the operating system’s kernel. System call provides the services of
the operating system to the user programs via Application Program
Interface(API). It provides an interface between a process and 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.
Services Provided by System Calls :
1. Process creation and management
2. Main memory management
3. File Access, Directory and File system management
4. Device handling(I/O)
5. Protection
6. Networking, etc.
Types of System Calls : There are 5 different categories of system calls

1. Process control: end, abort, create, terminate, allocate and
free memory.
2. File management: create, open, close, delete, read file etc.
3. Device management
4. Information maintenance
5. Communication
Examples of Windows and Unix System Calls –
Windows Unix
CreateProcess() fork()
ExitProcess() exit()
Process Control WaitForSingleObject() wait()

File Manipulation CreateFile() open()


ReadFile() read()
WriteFile() write()
CloseHandle() close()

SetConsoleMode() ioctl()
ReadConsole() read()
Device Manipulation WriteConsole() write()

GetCurrentProcessID() getpid()
SetTimer() alarm()
Information Maintenance Sleep() sleep()

CreatePipe() pipe()
CreateFileMapping() shmget()
Communication MapViewOfFile() mmap()

SetFileSecurity() chmod()
InitlializeSecurityDescriptor() umask()
Protection SetSecurityDescriptorGroup() chown()

System programs:
What are system programs with example?
System software is software designed to provide a platform for other software.
Examples of system software include operating systems (OS) like macOS, Linux,
Android and Microsoft Windows, computational science software, game engines,
search engines, industrial automation, and software as a service applications.

System structure:

What is system structure?


A system consists of something more than structure: it is a structure with certain
properties. When a structure is understood from the standpoint of its properties, it is
understood as a system. We speak of the "solar system" and not the solar structure.
Structure is an extremely abstract and formal concept.

An operating system is a construct that allows the user application programs


to interact with the system hardware. Since the operating system is such a
complex structure, it should be created with utmost care so it can be used
and modified easily. An easy way to do this is to create the operating
system in parts. Each of these parts should be well defined with clear inputs,
outputs and functions.

Simple Structure
There are many operating systems that have a rather simple structure.
These started as small systems and rapidly expanded much further than
their scope. A common example of this is MS-DOS. It was designed simply
for a niche amount for people. There was no indication that it would become
so popular.
An image to illustrate the structure of MS-DOS is as follows −

It is better that operating systems have a modular structure, unlike MS-DOS.


That would lead to greater control over the computer system and its various
applications. The modular structure would also allow the programmers to
hide information as required and implement internal routines as they see fit
without changing the outer specifications.

Layered Structure
One way to achieve modularity in the operating system is the layered
approach. In this, the bottom layer is the hardware and the topmost layer is
the user interface.
An image demonstrating the layered approach is as follows −
As seen from the image, each upper layer is built on the bottom layer. All
the layers hide some structures, operations etc from their upper layers.
One problem with the layered structure is that each layer needs to be
carefully defined. This is necessary because the upper layers can only use
the functionalities of the layers below them.

What is meant by virtual machines?


A Virtual Machine (VM) is a compute resource that uses software instead of a
physical computer to run programs and deploy apps. One or more virtual “guest”
machines run on a physical “host” machine.

System design and implementation:


An operating system is a construct that allows the user application programs
to interact with the system hardware. Operating system by itself does not
provide any function but it provides an atmosphere in which different
applications and programs can do useful work.
There are many problems that can occur while designing and implementing
an operating system. These are covered in operating system design and
implementation.

Operating System Design Goals


It is quite complicated to define all the goals and specifications of the
operating system while designing it.The design changes depending on the
type of the operating system i.e if it is batch system, time shared system,
single user system, multi user system, distributed system etc.
There are basically two types of goals while designing an operating system.
These are −

User Goals
The operating system should be convenient, easy to use, reliable, safe and
fast according to the users. However, these specifications are not very
useful as there is no set method to achieve these goals.

System Goals
The operating system should be easy to design, implement and maintain.
These are specifications required by those who create, maintain and operate
the operating system. But there is not specific method to achieve these
goals as well.
Operating System Mechanisms and Policies
There is no specific way to design an operating system as it is a highly
creative task. However, there are general software principles that are
applicable to all operating systems.
A subtle difference between mechanism and policy is that mechanism shows
how to do something and policy shows what to do. Policies may change over
time and this would lead to changes in mechanism. So, it is better to have a
general mechanism that would require few changes even when a policy
change occurs.
For example - If the mechanism and policy are independent, then few
changes are required in mechanism if policy changes. If a policy favours I/O
intensive processes over CPU intensive processes, then a policy change to
preference of CPU intensive processes will not change the mechanism.

Operating System Implementation


The operating system needs to be implemented after it is designed. Earlier
they were written in assembly language but now higher level languages are
used. The first system not written in assembly language was the Master
Control Program (MCP) for Burroughs Computers.

Advantages of Higher Level Language


There are multiple advantages to implementing an operating system using a
higher level language such as: the code is written more fast, it is compact
and also easier to debug and understand. Also, the operating system can be
easily moved from one hardware to another if it is written in a high level
language.

Disadvantages of Higher Level Language


Using high level language for implementing an operating system leads to a
loss in speed and increase in storage requirements. However in modern
systems only a small amount of code is needed for high performance, such
as the CPU scheduler and memory manager. Also, the bottleneck routines in
the system can be replaced by assembly language equivalents if required.

System generation:
The First Generation ( 1945 - 1955 ): Vacuum Tubes
and Plugboards
Digital computers were not constructed until the second world war.
Calculating engines with mechanical relays were built at that time. However,
the mechanical relays were very slow and were later replaced with vacuum
tubes. These machines were enormous but were still very slow.
These early computers were designed, built and maintained by a single
group of people. Programming languages were unknown and there were no
operating systems so all the programming was done in machine language.
All the problems were simple numerical calculations.
By the 1950’s punch cards were introduced and this improved the computer
system. Instead of using plugboards, programs were written on cards and
read into the system.

The Second Generation ( 1955 - 1965 ): Transistors


and Batch Systems
Transistors led to the development of the computer systems that could be
manufactured and sold to paying customers. These machines were known
as mainframes and were locked in air-conditioned computer rooms with staff
to operate them.
The Batch System was introduced to reduce the wasted time in the
computer. A tray full of jobs was collected in the input room and read into
the magnetic tape. After that, the tape was rewound and mounted on a tape
drive. Then the batch operating system was loaded in which read the first
job from the tape and ran it. The output was written on the second tape.
After the whole batch was done, the input and output tapes were removed
and the output tape was printed.

The Third Generation ( 1965 - 1980 ): Integrated


Circuits and Multiprogramming
Until the 1960’s, there were two types of computer systems i.e the scientific
and the commercial computers. These were combined by IBM in the
System/360. This used integrated circuits and provided a major price and
performance advantage over the second generation systems.
The third generation operating systems also introduced multiprogramming.
This meant that the processor was not idle while a job was completing its I/O
operation. Another job was scheduled on the processor so that its time
would not be wasted.

The Fourth Generation ( 1980 - Present ): Personal


Computers
Personal Computers were easy to create with the development of large-
scale integrated circuits. These were chips containing thousands of
transistors on a square centimeter of silicon. Because of these,
microcomputers were much cheaper than minicomputers and that made it
possible for a single individual to own one of them.
The advent of personal computers also led to the growth of networks. This
created network operating systems and distributed operating systems. The
users were aware of a network while using a network operating system and
could log in to remote machines and copy files from one machine to
another.

You might also like