0% found this document useful (0 votes)
26 views28 pages

Os Unit-I

Uploaded by

Bindu
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)
26 views28 pages

Os Unit-I

Uploaded by

Bindu
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
You are on page 1/ 28

OPERATING SYSTEMS-R18

UNIT - I

Operating System – Introduction (Need, Advantages, Disadvantages),


Structures/Types – (Simple Batch, Multi programmed, Time-shared,
Parallel, Distributed Systems, Real-Time Systems), Personal Computer
and System components, Operating System services, Generations of
OS, System Calls.

INTRODUCTION TO OPERATING SYSTEMS

Operating System can be defined as an interface between user and the


hardware. It provides an environment to the user so that, the user can perform
its task in convenient and efficient way.

An operating system is a type of software without which you cannot operate


or run a computer. It acts as an intermediary or translation system between
computer hardware and application programs installed on the computer.

An operating system is a well-organized collection of programs that manages


the computer hardware. It is a type of system software that is responsible for
the smooth functioning of the computer system.

An Operating System provides an interaction between the users and computer


hardware. A user is a person sitting at the computer terminal concerned about
the application rather than the architecture of the computer. The user never
interacts with the hardware directly. To get the services of the hardware, he
must request through the operating system.

The operating system is a primary resource manager. It manages the


hardware, including processors, memory, Input-Output devices, and
communication devices.

The following points indicate the need for the operating system:

1. More than one program runs at a time in a computer, and all of them
require your computer's CPU and memory. The operating system
manages resources for all those programs. That is why the operating
system is required.
2. Multitasking is a very critical feature of the OS. With its help, we can
run many programs simultaneously.
3. The operating system provides a platform to run any application
program in the computer.
4. It helps the user in file management. Through this, the user can save
the data according to his needs.
5. You use your mouse to open the application and click on the menu. All
this is possible due to the modern operating system. This operating
system allows you to do this with the help of GUI (Graphical user
interface).
6. The operating system creates a communication link between the user
and the computer, allowing the user to run any application program
and obtain the required output properly.
7. It is almost impossible for a user to use a computer system without
an operating system.

What is Computer?

A computer is a programmable electronic device that accepts raw data as input


and processes it with a set of instructions (a program) to produce the result as
output. It renders output just after performing mathematical and logical
operations and can save the output for future use. It can process numerical as
well as non-numerical calculations.

What is a PC?
The PC is a general-purpose, cost-effective computer that stands for the personal
computer. It is When Ed Roberts introduced the MITS Altair 8800, he coined the term PC.
Alternatively, it is referred to as a single-user computer and a desktop that is designed to
be used by a single end-user. All PCs depend on the microprocessor technology that makes
it capable for PC makers to set the whole CPU (central processing unit) on a single chip.

PC contains a keyboard, mouse, monitor, and system unit. Most of the personal computers
have an Internet or a network connection, including ports for connecting peripheral devices
like external hard drives, scanners, printers, digital cameras, and more.

Personal computers are used to create spreadsheets, write papers, play games, track our
finances, account, run databases, and many other tasks. Also, at home, it is widely used for
playing PC games, multimedia entertainment, accessing the Internet and more. If your PC
is connected to the Internet, you can use it for communicating with friends via instant
messaging programs, browsing the Web, checking e-mail, and downloading data or files.
It is normal for a personal computer to create a network by connecting more than one PC
together, even though they are designed to use as single-user systems.

A personal computer can be a laptop computer, a microcomputer, a handheld PC, a


desktop computer, or a tablet PC. Additionally, without PCs, life can be difficult as it has
become such an integral part of our lives.

Personal Computer:

Personal computer operating system provides a good interface to a single user.

Personal computer operating systems are widely used for word processing,
spreadsheets, and Internet access.

Personal computer operating system is made only for personal.

You can say that your laptops, computer systems, tablets etc. are your
personal computers and the operating system such as windows 7, windows 10,
android, etc. are your personal computer operating system.
Operating System Components:

The Operating System is divided into various parts based on its


functions such as:

1. Process Management

2. Memory Management

3. File Management

4. Input/Output Management

Memory Management: The operating system handles the responsibility of


storing any data, system programs, and user programs in memory. This
function of the operating system is called memory management.

File Management: The operating system is helpful in making changes in the


stored files and in replacing them. It also plays an important role in transferring
various files to a device.
Processor Management: The processor is the execution of a program that
accomplishes the specified work in that program. It can be defined as an
execution unit where a program runs.

Input/output Management: What output will come from the input given by
the user, the operating system runs this program. This management involves
coordinating various input and output devices. It assigns the functions of those
devices where one or more applications are executed.

Job Priority: The work of job priority is creation and promotion. It determines
what action should be done first in a computer system.

Advantages of Operating System

o It is helpful to monitor and regulate resources.

o It can easily operate since it has a basic graphical user interface to


communicate with your device.

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.

Disadvantage of the Operating System

o It allows only a few tasks that can run at the same time.
o If any error occurred in the operating system; the stored data can be
destroyed.

o It is a very difficult task or works for the OS to provide entire security


from the viruses because any threat or virus can occur at any time in a
system.

o An unknown user can easily use any system without the permission of
the original user.

o The cost of operating system costs is very high.

Generations of Operating System


The First Generation (1940 to early 1950s)

When the first electronic computer was developed in 1940, it was created without any
operating system.

The Second Generation (1955 - 1965)- batch processor

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 Third Generation (1965 - 1980) 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 Fourth Generation (1980 - Present Day)

The fourth generation of operating systems is related to the development of the personal
computer. 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
Types of Operating Systems

What is Batch Operating System?

Batch processing was very popular in the 1970s. The jobs were executed in
batches. People used to have a single computer known as a mainframe. Users
using batch operating systems do not interact directly with the computer. Each
user prepares their job using an offline device like a punch card and submitting
it to the computer operator. Jobs with similar requirements are grouped and
executed as a group to speed up processing.

The batch operating system grouped jobs that perform similar functions. These
job groups are treated as a batch and executed simultaneously. A computer
system with this operating system performs the following batch processing
activities:

1. A job is a single unit that consists of a present sequence of commands,


data, and programs.

2. Processing takes place in the order in which they are received, i.e., first
come, first serve.

3. These jobs are stored in memory and executed without the need for
manual information.
4. When a job is successfully run, the operating system releases its
memory.

There are mainly two types of the batch operating system. These are as follows:

1. Simple Batched System

2. Multi-programmed batched system

Simple Batched System

The user did not directly interact with the computer system for job execution
in a simple batch operating system. However, the user was required to prepare
a job that included the program, control information, and data on the nature of
the job on control cards. The job was then submitted to the computer operator,
who was usually in the form of a punch card. The output appeared after some
time that could take days, hours, and minutes.

Multi-programmed batched system

Multi-programming is an important feature of job scheduling. Generally, a


single user could not maintain all the input/output devices, and CPU always
buys. In the multi-programmed batched system, jobs are grouped so that the
CPU only executes one job at a time to improve CPU utilization. The operating
system maintains various jobs in memory at a time. The operating system
selects one job and begins executing it in memory. Finally, the job must wait
for a task to complete. In a multiprogramming system, do not sit idle because
the operating system switches to another task. When a job is in the wait state,
and the current job is completed, the CPU is returned.

How does Batch Operating System work?

The operating system keeps the number of jobs in memory and performs them
one at a time. Jobs are processed in a first-come, first-served manner. Each
job set is defined as a batch. When a task is finished, its memory is freed, and
the work's output is transferred into an output spool for later printing or
processing. User interaction is limited in the batch operating system. When the
system takes the task from the user, user is free.

Role of Batch Operating System

A batch operating system's primary role is to execute jobs in batches


automatically. The main task of a batch processing system is done by
the 'Batch Monitor', which is located at the low end of the main memory. This
technique was made possible by the development of hard disk drives and card
readers.

Characteristics of Batch Operating System

1. The CPU executes the jobs in the same sequence that they are sent to it
by the operator, which implies that the task sent to the CPU first will be
executed first. It's also known as the 'first come, first serve'

2. The word job refers to the command or instruction that the user and the
program should perform.

3. A batch operating system runs a set of user-supplied instructions


composed of distinct instructions and programs with several similarities.

4. When a task is successfully executed, the OS releases the memory space


held by that job.

5. The user does not interface directly with the operating system in a batch
operating system; rather, all instructions are sent to the operator.

6. The operator evaluates the user's instructions and creates a set of


instructions having similar properties.

Advantages

1. It isn't easy to forecast how long it will take to complete a job; only batch
system processors know how long it will take to finish the job in line.
2. This system can easily manage large jobs again and again.

3. The batch process can be divided into several stages to increase


processing speed.

4. When a process is finished, the next job from the job spool is run without
any user interaction.

5. CPU utilization gets improved.

Disadvantages

1. When a job fails once, it must be scheduled to be completed, and it may


take a long time to complete the task.

2. Computer operators must have full knowledge of batch systems.

3. The batch system is quite difficult to debug.

4. The computer system and the user have no direct interaction.

5. If a job enters an infinite loop, other jobs must wait for an unknown
period.

What is a Time-Sharing operating system?

A time-sharing operating system allows several users to use a computer system


from various locations simultaneously. An operating system is a program that
makes a connection between the user and the system hardware. The time-
sharing operating system is built on multiprogramming concepts, in which
multiple jobs are completed simultaneously by constantly switching between
them. Its switching is lightning quick, allowing users to interact with every
program because it runs without sharing the system.

Time-sharing systems use an interactive computer system to allow direct


interaction between the user and the system. The term 'interactive' refers to
the user's direct instructions to the system or program via an input device. The
results will be shown on the output devices by the system. The results are
generated faster, and the response time must be shorter than one second.
Advantages

There are various advantages of a time-sharing operating system. Some of


them are as follows:

1. It helps to reduce the CPU idle time.

2. It offers the benefits of a fast response.

3. It avoids the duplication of software.

4. Each job gets an equal opportunity.

Disadvantages

1. Data communication happens in the time-sharing operating system.

2. It has the problem of reliability.

Example:
What is a Real-Time operating system?

A real-time operating system (RTOS) is a special-purpose operating


system used in computers that has strict time constraints for any job to be
performed. It is employed mostly in those systems in which the results of the
computations are used to influence a process while it is executing. Whenever
an event external to the computer occurs, it is communicated to the computer
with the help of some sensor used to monitor the event. The sensor produces
the signal that is interpreted by the operating system as an interrupt. On
receiving an interrupt, the operating system invokes a specific process or a set
of processes to serve the interrupt.

Real-time systems are used when there are time requirements that are
very strict like missile systems, air traffic control systems, robots, etc.
 Types:
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 an accident. Virtual memory is rarely found in
these systems.
Soft Real-Time Systems:
These OSs are for applications where for time-constraint is less strict.
Applications of Real-time operating system (RTOS):

RTOS is used in real-time applications that must work within specific deadlines.
Following are the common areas of applications of Real-time operating systems
are given below.

o Real-time running structures are used inside the Radar gadget.


o Real-time running structures are utilized in Missile guidance.
o Real-time running structures are utilized in on line inventory trading.
o Real-time running structures are used inside the cell phone switching
gadget.
o Real-time running structures are used inside the Fuel injection gadget.
o Real-time running structures are used inside the Traffic manipulate
gadget.
o Real-time running structures are utilized in Autopilot travel simulators.
Types of Real-time operating system

Hard Real-Time operating system:

In Hard RTOS, all critical tasks must be completed within the specified time duration, i.e.,
within the given deadline. Not meeting the deadline would result in critical failures such as
damage to equipment or even loss of human life.

For Example,

Let's take an example of airbags provided by carmakers along with a handle in the driver's
seat. When the driver applies brakes at a particular instance, the airbags grow and prevent
the driver's head from hitting the handle. Had there been some delay even of milliseconds,
then it would have resulted in an accident.

Similarly, consider an on-stock trading software. If someone wants to sell a particular share,
the system must ensure that command is performed within a given critical time. Otherwise,
if the market falls abruptly, it may cause a huge loss to the trader.

Soft Real-Time operating system:

Soft RTOS accepts a few delays via the means of the Operating system. In this kind of RTOS,
there may be a closing date assigned for a particular job, but a delay for a small amount of
time is acceptable. So, cut off dates are treated softly via means of this kind of RTOS.

For Example, This type of system is used in Online Transaction systems and Livestock price
quotation Systems.

Firm Real-Time operating system:

In Firm RTOS additionally want to observe the deadlines. However, lacking a closing date
might not have a massive effect, however, may want to purposely undesired effects, like a
massive discount within the fine of a product.
For Example, this system is used in various forms of Multimedia applications.

Advantages of Real-time operating system:

The benefits of real-time operating system are as follows-:

o Easy to layout, develop and execute real-time applications under the real-time
operating system.
o The real-time working structures are extra compact, so those structures require
much less memory space.
o In a Real-time operating system, the maximum utilization of devices and systems.
o Focus on running applications and less importance to applications that are in the
queue.
o Since the size of programs is small, RTOS can also be embedded systems like in
transport and others.
o These types of systems are error-free.
o Memory allocation is best managed in these types of systems.

Disadvantages of Real-time operating system:

The disadvantages of real-time operating systems are as follows-

o Real-time operating systems have complicated layout principles and are very costly
to develop.
o Real-time operating systems are very complex and can consume critical CPU cycles.

Features Time-sharing Real-time Operating System

Definition A Time-sharing system allows A Real-time operating system


several users to use a computer completes a task within a
system from various locations specific time.
simultaneously.

Computer Users may share the resources Resources are allotted to a


Resources between the users. process for a fixed amount of
time before reallocating to
another process.

Switching A switching method/function is The switching method/function


available. is not available.

Modification Any modification may be possible Any modification may not be


the program in the program. possible in the program.

Response The response is generated within The user must get the response
the second. within the specified time
constraint.

Process It runs multiple applications It runs only a single application


deals simultaneously. simultaneously.

Basic Its focus is on responding quickly It focuses on completing a


to a request. computer task before the
deadline.

Distributed Operating System

The Distributed Operating system is not installed on a single machine, it is


divided into parts, and these parts are loaded on different machines. A part of
the distributed Operating system is installed on each machine to make their
communication possible.

These types of the operating system is a recent advancement in the world of


computer technology and are being widely accepted all over the world. Various
computers communicate with each other using a shared communication
network. Independent systems possess their own memory unit and CPU. These
are referred to as loosely coupled systems or distributed operating systems.

The major benefit of working with these types of operating system is that it is
always possible that one user can access the files or software which are not
actually present on his system, but some other system connected within this
network.
Advantages of Distributed Operating System

o The distributed operating system provides sharing of resources.


o Failure of one will not affect the other, as all systems are independent of
each other.
o Electronic mail increases the data exchange speed.
o Since resources are being shared, computation is highly fast.
o Load on host computer reduces
o Delay in data processing reduces
o Examples: AIX operating system for IBM, Solaris operating system for
SUN multiprocessor.

Disadvantages of Distributed Operating System

• Failure of the main network will stop the entire communication.


• These types of systems are not readily available as they are very
expensive. Not only that, but the underlying software is also highly
complex and not understood well yet

Example:
Parallel Operating System

 Parallel operating systems are a type of computer processing platform


that breaks large tasks into smaller pieces that are done at the same
time in different places and by different mechanisms. They are
sometimes also described as “multi-core” processors. This type of
system is usually very efficient at handling very large files and complex
numerical codes. It’s most seen in research locations where central
server systems are handling a lot of different jobs at once but can be
useful any time multiple computers are doing similar jobs and
connecting to shared infrastructures simultaneously.
 A parallel operating system works by dividing sets of calculations into
smaller parts and distributing them between the machines on a
network.

Advantages and Disadvantages:

• It saves time, allowing the execution of applications in a shorter time.


• Solve Larger Problems in a short point of time.
• It is much better suited for modeling, simulating, and understanding
complex, real-world problems.
• We can do things simultaneously by using multiple resources.

Disadvantages

 Power consumption is huge.


 It is a bit difficult but with proper understanding and practice, you are
good to go.

Network Operating System:

These systems run on a server and provide the capability to manage data,
users, security, applications, and other networking functions.

These types of operating systems allow shared access to files, printers,


security, applications, and other networking functions over a small private
network.

One more important aspect of Network Operating Systems is that all the
users are aware of all other users within the network, their individual
connections, etc. and that’s why these computers are popularly known
as tightly coupled systems.

 Advantages of Network Operating System:

• Highly stable centralized servers


• Security concerns are handled through servers
• New technologies and hardware up-gradation are easily integrated into
the system
• Server access is possible remotely from different locations and types of
systems

Examples of Network Operating systems are Microsoft Windows Server


2003, Microsoft Windows Server 2008, UNIX, Linux, Mac OS, etc.

 Disadvantages of Network Operating System:


• Servers are costly
• User must depend on a central location for most operations
• Maintenance and updates are required regularly

Multiprogramming OS

 A multiprogramming OS, in which multiple programs can run


simultaneously.
 Multiprogramming is the allocation of more than one concurrent
program on a computer system and its resources.
 Multiprogramming allows using the CPU effectively by allowing various
users to use the CPU and I/O devices effectively.
 Multiprogramming makes sure that the CPU always has something to
execute, thus increasing the CPU utilization.
 multi programming is the ability of an os to execute multiple programs
at the same time on single processor machine .one or more programs
reside in the main memory which are ready to execute.

Advantages:

1. It may help to run various jobs in a single application simultaneously.


2. Various users may use the multiprogramming system at once.
3. Short-time jobs are done quickly in comparison to long-time jobs.
4. It helps in improving CPU utilization and never gets idle.
5. The resources are utilized smartly.

Disadvantages

1. It is highly complicated.
2. The CPU scheduling is required.
3. Memory management is needed in the operating system because all
types of tasks are stored in the main memory.
4. The harder task is to handle all processes and tasks.

Operating system operations (modes):

To ensure the proper execution of the OS, there must be a differentiate


between the execution of OS code and user-defined code.

There are two modes of execution:

User mode

Kernel mode (Supervisor mode, system mode, priviliged mode)

A mode bit is added to the computer hardware to indicate the current mode:
kernel (0), user (1) The hardware allows privileged instructions to be executed
only in kernel mode.

• When the computer system is executing on behalf of a user


application, the system is in user mode.
• However, when a user application requests a service from the operating
system (via a system call), it must transition from user to kernel
mode to fulfill the request.
• At system boot time, the hardware starts in kernel mode.
• The operating system is then loaded and starts user applications in user
mode.
• Whenever a trap or interrupt occurs, the hardware switches from user
mode to kernel mode (that is, changes the state of the mode bit to 0).
• Thus, whenever the operating system gains control of the computer, it is
in kernel mode.
• The system always switches to user mode (by setting the mode bit to
1) before passing control to a user program.

User Mode vs Kernel Mode

User Mode is a restricted mode, Kernel Mode is the privileged mode,


which the application programs are which the computer enters when
executing and starts out. accessing hardware resources.

Modes

Kernel mode is the system mode,


User Mode is considered as the
master mode or the privileged
slave mode or the restricted mode.
mode.

Address Space

In User mode, a process gets their In Kernel Mode, processes get


own address space. single address space.

Interruptions

In Kernel Mode, if an interrupt


In User Mode, if an interrupt occurs,
occurs, the whole operating system
only one process fails.
might fail.

Restrictions

In user mode, there are restrictions In kernel mode, both user


to access kernel programs. Cannot programs and kernel programs can
access them directly. be accessed.

Components of OS: (Functions)


Process management involves various tasks like creation, scheduling,
termination of processes, and a deadlock. Process is a program that is
under execution, which is an important part of modern-day operating
systems.

The operating system is responsible for the following activities in connection


with process management:

 Creating and deleting both user and system processes

 Suspending and resuming processes

 Providing mechanisms for process synchronization

 Providing mechanisms for process communication

 Providing mechanisms for deadlock handling

Memory management: The task of subdividing the memory among different


processes is called memory management. Memory management is a
method in the operating system.

 Keeping track of which parts of memory are currently being used


and by whom
 Deciding which processes (or parts thereof) and data to move into
and out of memory

Allocating and deallocating memory space as needed

A file management system is used for file maintenance (or


management) operations. It is is a type of software that manages data
files in a computer system

 Creating and deleting files and directories

 Primitives to manipulate files and dirs

 Mapping files onto secondary storage

 Backup files onto stable (non-volatile) storage media.

Protection – any mechanism for controlling access of processes or users to


resources defined by the OS.
Security – defense of the system against internal and external attacks.

Scheduling- CPU Scheduling is a process of determining which process


will own CPU for execution while another process is on hold.

Operating System Services:

Operating-system services that provides functions helpful to the user:

 User interface
 Program execution
 I/O operations
 File-system manipulation
 Communications
 Error detection

System Calls

System calls provide the interface between a running program and the
operating system.

Types of System Calls:

 Process control

 File management

 Device management

 Information maintenance

 Communications

Examples of Windows and Unix System Calls


OS Structures:

 A monolithic operating system is an OS architecture in which the


entire operating system works in the kernel space. In contrast,
a layered operating system is an OS architecture that is divided
into a number of layers, each layer performing a specific
functionality.
 An operating system with different layers for handling system
software and user software is known as a layered operating
system.

Features Monolithic Layered Operating


System

Definition It is one in which the A layered operating


complete operating system that has
system operates in divided into multiple
the k layers, and each
layer serves as a
ernel space. specific task.
Number of levels There are mainly There are multiple
three layers in the layers in layered
monolithic operating operating systems.
system.

Monolithic OS

Important Questions (Previous Year Question Papers)

1. List out the types of operating system and explain batch OS and time-
sharing OS in brief.
2. Explain about the distributed operating system in brief. (It may be any
type, like Batch OS, Time-Sharing, Real Time, Network, Multiprogram,
Parallel, Mobile OS)
3. Explain the various system calls are used in OS
4. Explain about the structure of OS.
5. Explain about the services of operating system
6. Explain about the need of OS with examples
7. Explain about the components of OS with examples
8. Explain about the Operations of OS with examples

You might also like