Download as pdf or txt
Download as pdf or txt
You are on page 1of 23

OPERATING SYSTEM

B.Tech. (IT), V Semester

Dept. Of Information Technology, SMIT


TEXT BOOK
1.Operating System Concepts, A. Silberschatz and P.B.Galvin & G.Gagne,
2001,Addison Wesley
REFERENCE BOOKS

1.Operating System: Internals and Design Principles, William Stallings,


2009, Pearson Education
2.Operating Systems: Design and Implementation, A.S Tanenbaum, 2006,
Pearson Education
3.Operating System: Concept and Design, Milan Milenkovic, 1992, McGraw
Hill
Contents

 Introduction to Operating Systems, Computer System


Structures, Operating System Structures
 Process, CPU Scheduling, Process Synchronization
 Deadlock Handling
 Memory Management
 File System, I/O System
 Distributed System

Chapter-1 3
Chapter1: Introduction
What is an Operating System?
• It is a program that acts as an intermediary between a user of a
computer and the computer hardware.
Goals:
• An operating system executes user programs and makes easier
solving the user problems.
• It makes the computer system convenient to use.
• Uses the computer hardware in an efficient manner.

Chapter-1 4
Structure of a Computer System
A Computer system can be divided into four components:

Fig-1.1: Components of an computer system( Abstract View) [1]


Chapter-1 5
Structure of a Computer System
 Hardware – provides basic computing resources
-CPU, memory, I/O devices
 Operating system
-Controls and coordinates use of hardware among various applications and
users
 Application programs – define the ways in which the system resources are
used to solve the computing problems of the users
-Word processors, compilers, web browsers, database systems, video games
 Users
-People, machines, other computers

Chapter-1 6
User View:

• Normally, for PC, users want convenience, ease of use and good
performance. But does not bother about resource utilization.
• But shared computer such as mainframe or minicomputer must keep
all users happy by giving access to all. The operating system is
designed to maximize resource utilization.
• Users of dedicate systems such as workstations have dedicated
resources but frequently use shared resources from servers.
• Handheld computers are resource poor, optimized for usability and
battery life.
• Some computers have little or no user interface, such as embedded
computers in devices and automobiles.
Chapter-1 7
System View:

 OS is a resource allocator
-Manages all resources.
-Decides between conflicting requests for efficient and fair resource use.
 OS is a control program
-Controls execution of programs to prevent errors and improper use of
the computer.

Chapter-1 8
 No universally accepted definition about what is part of an operating
system.
 A more common definition is that Operating system is the one
program running at all times on the computer usually called the
kernel.
 Everything else is either a system program (ships with the operating
system) , or an application program.
 Operating system= kernel +System program+ Application program

Chapter-1 9
How a computer starts?
 Bootstrap program is loaded at power-up or reboot
-Typically stored in ROM or EPROM, generally known as firmware
-Initializes all aspects of system
-Loads operating system kernel and starts execution

Chapter-1 10
Types of Computer Systems
 Mainframe systems
-Batch Systems
-Time Sharing Systems
 Desktop Systems
 Multiprocessor Systems or Parallel Systems
 Distributed Systems
 Real Time Systems

Chapter-1 11
Mainframe Systems
• Mainframe Computer systems were the first computers used to tackle many commercial and scientific
applications.
• A mainframe is simply a very large computer. The term Mainframe comes from the way the machine is
build up: all units (processing, communication etc.) are placed into a frame. Thus the main computer is
build into a frame, therefore: Mainframe
• Because of the sheer development costs, mainframes are typically manufactured by large companies such
as IBM, Amdahl, Hitachi.

Fig:1.2 ENIAC[2]
Chapter-1 12
Mainframe Systems contd..

Growth of mainframe systems-


-Batch systems
-Time Shared Systems
Simple Batch Systems:
Early computers were (physically) enormously large machines run from a console.
Input devices: card readers and tape drives.
Output devices: line printers, tape drives, and card punches.
The users of such systems prepared a job—which consisted of the program, the data, and
some-control information about the nature of the job (control cards)—and submitted it to the
computer operator. The job would usually be in the form of punch cards. At some later time
(perhaps minutes, hours, or days), the output appeared. The output consisted of the result of the
program, as well as a-dump of memory and registers in case of program error.
Chapter-1 13
Simple Batch System contd..
• Reduce setup time by batching jobs with similar requirements
• The programmers would leave their programs with the operator. The operator
would sort programs into batches with similar requirements and, as the computer,
became available, would run each batch. The output from each job would be sent
back to the appropriate programmer.

Fig-1.3: Memory layout of a


Chapter-1 simple batch system[1] 14
Simple Batch System contd..
Issues:
Long turn around time
Low CPU utilization due to slow I/O.

Chapter-1 15
Simple Batch System contd..
Solutions to speed up I/O:
 Offline Processing
Load jobs into memory from tapes, card reading and line printing are done offline.

 Spooling (simultaneous Peripheral Operation On-line)


Use disk (random access device) as large storage for reading as many input files as
possible and storing output files until output devices are ready to accept them.
Allows overlap - I/O of one job with computation of another. The spooler may be reading
the input of one job while printing the output of a different job. During this time, still
another job (or jobs) may be executed, reading their "cards" from disk and "printing" their
output lines onto the disk.
Introduces notion of a job pool that allows OS choose next job to run so as to increase
CPU utilization.

Chapter-1 16
Multiprogrammed Batched Systems
• Multiprogramming increases CPU utilization by organizing jobs such that the
CPU always has one to execute.
• The operating system keeps several jobs in memory at a time as shown in Fig-1.4.
The operating system picks and begins to execute one of the jobs in the memory.
• When the job may have to wait for some tasks, such as a tape to be mounted, or
an I/O operation to complete, the operating system simply switches to and
executes another job.
• When that job needs to wait, the CPU is switched to another job, and so on.
Eventually, the first job finishes waiting and gets the CPU back. As long as there
is always some job to execute, the CPU will never be idle.

Chapter-1 17
Multiprogrammed Batched Systems
• Multiprogrammed operating systems are fairly
sophisticated. All the jobs that enter the system are
kept in the job pool. This pool consists of all
processes residing on mass storage awaiting
allocation of main memory.
• If several jobs are ready to be brought into memory,
and there is not enough room for all of them, then the
system must choose among them. Making this
decision is called job scheduling.
• Requires memory management, CPU scheduling.
Fig-1.4: Memory layout for a
multiprogramming system.

Chapter-1 18
Issues with the batched systems??

Chapter-1 19
Time-Sharing Systems
• The idea of time sharing was demonstrated as early as 1960, but since time-shared
systems are difficult and expensive to build, they did not become common until the early
1970s.
• Time sharing, or multitasking, is a logical extension of multiprogramming. Multiple jobs
are executed by the CPU switching between them, but the switches occur so frequently.
• Users may interact with each program while it is running.
• Jobs queued for execution in FIFO order.
• Each job runs for a time quantum. A timer device interrupts after a quantum (time slice).
• Interrupted job is returned to end of FIFO and Next job is taken from head of FIFO
• Control card interpreter replaced by command language interpreter

Chapter-1 20
Time-Sharing Systems
• An interactive computer system provides on-line communication between the
user and the system. The user gives instructions to the operating system or to a
program directly, and receives an immediate response.
• Usually, a keyboard is used to provide input, and a display screen (such as a
cathode-ray tube (CRT), or monitor) is used to provide output. When the operating
system finishes the execution of one command, it seeks the next "control
statement" not from a card reader, but rather from the user's keyboard.
• Time-sharing systems were developed to provide interactive use of a
computer system at a reasonable cost. A time-shared operating system uses
CPU scheduling and multiprogramming to provide each user with a small
portion of a time-shared computer.

Chapter-1 21
Time-Sharing Systems
• A time-shared operating system allows the many users to share the computer
simultaneously. Since each action or command in a time-shared system tends to be
short, only a little CPU time is needed for each user. As the system switches
rapidly from one user to the next, each user is given the impression that
she/he has own computer, whereas actually one computer is being shared
among many users.
• Many computer systems that were designed as primarily batch systems have been
modified to create a time-sharing subsystem. For example, IBM's OS/360, a batch
system, was modified to support the Time-Sharing Option (TSO).
• Design of a Time-sharing operating systems are even more complex than are
multi-programmed operating systems.
• Time Sharing OS need to deal with virtual memory, file systems, disk
management, concurrent execution, job synchronization and communication.
Chapter-1 22
Reference
1. A. Silberschatz, P.B.Galvin & G.Gagne, Operating System
Concepts, 2001,Addison Wesley
2. https://www.thocp.net/hardware/mainframe.htm

Chapter-1 23

You might also like