Chapter_1_intro
Chapter_1_intro
I/O
Processor Modules
Main System
Memory Bus
Processor
Referred to as the
Central Processing
Unit (CPU)
•communications equipment
•terminals
System bus
▪ Provides communication among
processors, main memory,
and I/O modules.
Computer system architecture
Input unit
• It provides data and instructions
to the computer system.
• Commonly used input devices
are keyboard, mouse, magnetic
tape etc.
• Input unit performs following
tasks:
– Accept the data and
instructions from the outside
environment.
– Convert it into machine
language.
– Supply the converted data to
computer system.
Output unit
• It connects the internal
system of a computer to the
external environment.
• It provides the results of any
computation, or instructions
to the outside world.
• Some output devices are
printers, monitor etc.
Storage unit (Memory unit)
• This unit holds the data and
instructions.
• It also stores the
intermediate results before
these are sent to the output
devices.
• It also stores the data for
later use.
• The storage unit of a
computer system can be
divided into two categories:
1. Primary Storage
2. Secondary Storage
Primary Storage
• This memory is used to store
the data which is being
currently executed.
• It is used for temporary
storage of data.
• The data is lost, when the
computer is switched off.
• RAM is used as primary
storage memory.
Secondary Storage
• The secondary memory is
slower and cheaper than
primary memory.
• It is used for permanent
storage of data.
• Commonly used secondary
memory devices are hard
disk, CD etc.
CPU (Central Processing Unit)
• The Arithmetic Logical Unit
and Control Unit are together
known as CPU.
• CPU is the brain of computer
system. It performs following
tasks:
– performs all operations.
– takes all decisions.
– controls all the units of
computer.
ALU (Arithmetic Logical Unit)
• All the calculations are
performed in ALU of the
computer system.
• The ALU can perform basic
operations such as addition,
subtraction, division,
multiplication etc.
• Whenever calculations are
required, the control unit
transfers the data from
storage unit to ALU.
• When the operations are
done, the result is transferred
back to the storage unit.
CU (Control Unit)
• It controls all other units of
the computer.
• It controls the flow of data
and instructions to and from
the storage unit to ALU.
• Thus it is also known as
central nervous system of the
computer.
What is Operating System (OS)?
▪ A Computer System consists of various hardwares such as
•Examples
•of Operating System
Where OS lies? (Interaction of OS & Hardware)
Operating System
Hardware
7+9–6*4/2=4
P1 P2 P3 P4
20
3 4 1 2
OS as Resource Manager
▪ It is the job of OS to allocate these resources to the various
applications so that:
• Deadlock are detected, resolved and avoided.
OS as Resource Manager (Cont…)
▪ Resource manager – sharing resources in two different ways:
1. In time sharing/multiplexing (i.e CPU)
OS as Resource Manager (Cont…)
▪ Resource manager – sharing resources in two different ways
2. In space sharing/multiplexing. (i.e Memory)
Main Memory
Objectives / Goals of Operating System
▪ Make the computer system convenient to use in an efficient
manner.
▪ Hide the details of the hardware resources from the users.
▪ Provide users a convenient interface to use the computer system.
▪ Act as an intermediary between the hardware and its users,
making it easier for the users to access and use other resources.
▪ Manage the resources of a computer system.
▪ Keep track of who is using which resource, granting resource
requests, and mediating conflicting requests from different
programs and users.
▪ Provide efficient and fair sharing of resources among users and
programs.
History of OS (First generation)
▪ First generation (1945-1955)
• Vacuum tubes and plug-boards were used in these systems.
Vacuum tubes
Plug board
History of OS (Second generation)
▪ Second generation (1955-1965)
• Transistors were used in these systems
• The machine that are produced are called mainframes.
• Batch systems was used for processing.
Programmers 1401
bringreads
cards batch
to 1401
Operator
of jobscarries
onto 7094
tape
inputdoes
Operator
tapecomputing
to 7094 1401
carries output prints
tape output
to 1401
History of OS (Third generation)
▪ Third generation (1965-1980)
• Integrated circuits (IC's) were used in place of transistors in these
computers.
• It provided multiprogramming (the ability to have several
programs in memory at once, each in its own memory partition).
History of OS (Fourth generation)
▪ Fourth generation (1980-present)
• Personal Computers
• LSI (Large Scale Integration) circuits, chips containing thousands
of transistors are used in these systems.
Services / Functions / Tasks of OS
P1
P2
Services / Functions / Tasks of OS
5. Controlled access to file
• In case of file access, OS provides a directory hierarchy for easy
access and management of file.
• OS provides various file handling commands using which user can
easily read, write and modify file.
Services / Functions / Tasks of OS
6. Communication
• In multitasking environment, the processes need to communicate
with each other and to exchange their information.
• Operating system performs the communication among various
types of processes in the form of shared memory.
Services / Functions / Tasks of OS
7. Error detection and response
• 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.
Services / Functions / Tasks of OS
8. Accounting
• Keeping a track of which users are using how much and what
kinds of computer resources can be used for accounting or simply
for accumulating usage statistics.
• Usage statistics is used to reconfigure the system to improve
computing services.
Services / Functions / Tasks of OS
9. Protection & Security
• Protection involves ensuring that all accesses to system resources
is controlled.
• To make a system secure, the user needs to authenticate himself
or herself to the system.
Services / Functions / Tasks of OS (Revision)
1. Program development
2. Program execution
3. Access to I/O devices
4. Memory management
5. Controlled access to file
6. Communication
7. Error detection and response
8. Accounting
9. Protection & Security
Types of OS
1. Mainframe operating systems
• OS found in room sized computers which are still found in major
corporate data centres.
• They offer three kinds of services:
1) Batch OS – processes routine jobs without any interactive user
presents i.e. claim processing in insurance
2) Transaction processing – handles large numbers of small
processes i.e. cheque processing at banks
3) Timesharing – allows multiple remote users to run their jobs at
once i.e. querying a database, airline booking system
• Examples: OS/390, OS/360.
Types of OS
1. Mainframe operating systems
• OS found in room sized computers which are still found in major
corporate data centres.
• They offer three kinds of services:
1) Batch OS – processes routine jobs without any interactive user
presents i.e. claim processing in insurance
2) Transaction processing – handles large numbers of small
processes i.e. cheque processing at banks
3) Timesharing – allows multiple remote users to run their jobs
at once i.e. querying a database, airline booking system
• Examples: OS/390, OS/360.
Types of OS (Cont…)
2. Server operating systems
• This OS runs on servers which are very large PC, workstations or
even mainframes.
• They serve multiple users at once over a network and allow the
users to share hardware & software resources.
• It provides print services, file service or web service.
• It handles the incoming requests from clients.
• Examples: Solaris, FreeBSD, and Linux and Windows Server 200x.
Types of OS (Cont…)
3. Multiprocessor operating systems
• A computer system consist two or more CPUs is called
multiprocessor.
• It is also called parallel computers, multicomputer or
multiprocessor.
• They need special OS or some variations on server OS with special
features for communication, connectivity and consistency.
• Examples: Windows and Linux.
Types of OS (Cont…)
4. Personal computer operating systems
• The operating systems installed on our personal computer and
laptops are personal OS.
• Job of this OS is to provide good support to single user.
• This OS is widely used for word processing, spreadsheet and
internet access.
• Examples: Linux, Windows vista and Macintosh.
Types of OS (Cont…)
5. Handhelds computer operating systems
• A handheld computer or PDA (Personal Digital Assistant) is small
computer that fit in a Pocket and perform small number of
functions such as electronic address book, memo pad.
• The OS runs on these devices are handheld OS.
• These OS also provides ability to handle telephony, digital
photography and other functions.
• Examples: Symbian OS, Palm OS.
Types of OS (Cont…)
6. Embedded operating systems
• This OS is installed in ATMs, printers, calculators and washing
machine.
• It runs on the computer that control devices.
• It neither allow to download new software nor accept user
installed software. So there is no need for protection.
• Examples: QNX, VxWorks.
Types of OS (Cont…)
7. Sensor node operating systems
• Network of tiny sensor nodes are being developed for numerous
purpose.
• Each nodes are tiny computers with a CPU, RAM, ROM and one
or more environmental sensors.
• The OS installed in these nodes are sensor node OS.
• They communicate with each other and with base station using
wireless communication.
• These sensor network are used to protect area of building, detect
fires in forest, measure temperature.
• Examples: TinyOS.
Types of OS (Cont…)
8. Real time operating systems
• These systems having time as a key parameter.
• Real time OS has well defined fixed time constraints.
• Processing must be done within defined time constraints
otherwise system fails.
• Two types of real time OS:
1. Hard real time – missing an occasional deadline can cause
any permanent damage. Many of these are found in industrial
process control, car engine control system.
2. Soft real time – missing an occasional deadline does not
cause any permanent damage. Used in digital audio,
multimedia system.
• Examples: e-Cos.
Types of OS (Cont…)
9. Smart card operating systems
• Smallest OS run on smart cards which are credit card sized
devices containing CPU chip.
• These OS are installed on electronic payments cards such as debit
card, credit card etc.
• They have limited processing power.
• Some smart cards are Java oriented. ROM on smart card holds an
interpreter for the JVM – small program.
Types of OS (Revision)
1. Mainframe operating systems
2. Server operating systems
3. Multiprocessor operating systems
4. Personal computer operating systems
5. Handhelds computer operating systems
6. Embedded operating systems
7. Sensor node operating systems
8. Real time operating systems
9. Smart card operating systems
System calls
▪ The interface between OS and user program is defined by the set of
system calls that OS provides.
▪ System calls vary from OS to OS.
▪ Example: In Unix Read system call is
• count=read(fd, &buffer, nbytes)
• fd is a file descriptor.
– When a file is opened, permissions are checked.
– If access is allowed, a number (fd) is returned.
– Then file can be read/written.
• nbytes is number of bytes to read
• buffer is where read deposits (stores) the data
System calls (Cont…)
Return to caller Library
Trap to the kernel proced
5 Put code for read in register ure
6 10
read
User Call to library proc
4
space Increment SP 11
Kernel 7 8
Sys call
Dispatch
handler
space
System Calls (Cont…)
System Calls (Cont…)
Operating system structures
1. Monolithic systems
2. Layered systems
3. Microkernel
4. Client-server model
5. Virtual machines
• VM/370
• Virtual machines rediscovered
• The java virtual machine
6. Exokernels
Monolithic systems
▪ The entire OS runs as a single program in kernel mode.
▪ OS is written as a collection of procedures, linked together into a
single large executable binary program.
▪ Each procedure has well defined interface in terms of parameter
and results, and each one is free to call any other one.
▪ Virtual machine monitor run on the bare hardware and does the
multiprogramming.
▪ Each virtual machine is identical to the true hardware; each one
can run any OS (may be different) that will run directly on the
bare hardware.
▪ On VM/370, some run OS/360 while the others run single user
interactive system called CMS (Conversational Monitor System)
for interactive time sharing users.
VM/370 (Cont…)
▪ Companies can run their mail servers, web servers, FTP servers
and other servers on the same machine without having a crash of
one server bring down the rest.
▪ Web hosting company offers virtual machines for rent, where a
single physical machine can run many virtual machines; each one
appears to be a complete machine.
▪ Customers who rent a virtual machine can run any OS or software.
Virtual Machines Rediscovered (Cont…)
Multiprocessing Multitasking
Multiprogramming
Multiprogramming v/s Multiprocessing v/s Multitasking
Multiprogramming Multiprocessing Multitasking
The concurrent residency The availability of more The execution of more
of more than one than one processor per than one task
program in the main system, which can simultaneously is called as
memory is called as execute several set of multitasking.
multiprogramming. instructions in parallel is
called as multiprocessing.
Number of processor: one Number of processor: Number of processor: one
more than one
One process is executed More than one process One by one job is being
at a time. can be executed at a time. executed at a time.
Time Sharing Operating System
• A time sharing operating system allows
many users to share the computer
resources simultaneously.
• In other words, time sharing refers to the
allocation of computer resources in time
slots to several programs simultaneously.
• For example a mainframe computer that
has many users logged on to it.
• Each user uses the resources of the
mainframe i.e. memory, CPU etc.
Parallel Processing Operating System
• Parallel Processing Operating Systems are Multiprocessing
designed to speed up the execution of
programs by dividing the program into
multiple fragments and processing these
fragments simultaneously.
• Such systems are multiprocessor systems.
• Parallel systems deal with the
simultaneous use of multiple computer
resources that can include a single
computer with multiple processors.
Distributed Operating System
• Distributed Operating System is a
model where distributed
applications are running on
multiple computers linked by
communications.
• A distributed operating system is an
extension of the network operating
system that supports higher levels
of communication and integration
of the machines on the network.
Questions asked in GTU
1. What is Kernel? Differentiate between Monolithic Kernel and
Micro Kernel.
2. Explain different service/functions provided by operating system.
3. Discuss role of OS as a resource manager.
4. Explain the features of Time sharing system.
5. What is operating system? Give the view of OS as a resource
manager.
6. What is system call? Explain steps for system call execution.
7. Write different types of system call.
8. List out types of operating system and explain batch OS and time
sharing OS in brief.