���Operating Systems
Department of BCA
Loyola college of arts and science
Mettala
Chapter 1:
Introduction
OS Notes by Dr. Naveen Choudhary
What is an Operating System?
OS Notes by Dr. Naveen Choudhary
computer and the computer hardware.
prevent errors and improper use of the computer
Computer System Components
OS Notes by Dr. Naveen Choudhary
memory, I/O devices).
Abstract View of System Components
OS Notes by Dr. Naveen Choudhary
Operating System Definitions
OS Notes by Dr. Naveen Choudhary
being application programs).
Computer startup
OS Notes by Dr. Naveen Choudhary
firmware
Mainframe Systems
OS Notes by Dr. Naveen Choudhary
that’s why we needed Batch Systems
control from one job to another.
Memory Layout for a Simple Batch System
OS Notes by Dr. Naveen Choudhary
Multiprogrammed Batch Systems
Several jobs are kept in main memory at the same time, and the CPU is multiplexed among them.
Initially used punched cards 🡪 data ,
program and control cards
Spooling (simultaneous peripheral operation online )🡪 Introduction of disk technology
🡪So cards can be read into disk for later cpu reading & cpu o/p for printing can also be put on disk for later printing
🡪So spooling can help overlap the i/o of
one job with the computation of the other.
OS Notes by Dr. Naveen Choudhary
OS Features Needed for Multiprogramming
OS Notes by Dr. Naveen Choudhary
memory to several jobs.
disk to bring it to the memory
several jobs ready to run.
Time-Sharing Systems–Interactive Computing
OS Notes by Dr. Naveen Choudhary
disk.
Multiprogramming/multitasking
OS Notes by Dr. Naveen Choudhary
Desktop Systems
OS Notes by Dr. Naveen Choudhary
single user.
printers.
(Windows, MacOS, UNIX, Linux)
Parallel Systems
OS Notes by Dr. Naveen Choudhary
communication.
🗐 graceful degradation 🡪 fault tolerance
Parallel Systems (Cont.)
OS Notes by Dr. Naveen Choudhary
deterioration.
Multiprocessing Architecture
OS Notes by Dr. Naveen Choudhary
Distributed Systems
OS Notes by Dr. Naveen Choudhary
processors.
file transfer is possible)
Distributed Systems (cont)
OS Notes by Dr. Naveen Choudhary
General Structure of Client-Server
OS Notes by Dr. Naveen Choudhary
Real-Time Systems
OS Notes by Dr. Naveen Choudhary
Real-Time Systems (Cont.)
OS Notes by Dr. Naveen Choudhary
Chapter 2: Computer-System Structures
OS Notes by Dr. Naveen Choudhary
Computer-System Architecture
Bootstrap:(1) Initialize h/w - like cpu registers, device controllers, memory controllers etc ( 2 ) Loads o.s kernel into the primary memory and then transfers control to O.S
OS Notes by Dr. Naveen Choudhary
Computer-System Operation
OS Notes by Dr. Naveen Choudhary
type.
purpose registers
controller ( say for some read operation )
buffers
operation by causing an interrupt.
Common Functions of Interrupts
OS Notes by Dr. Naveen Choudhary
interrupted instruction.
an error or a user request.
Interrupt Handling
OS Notes by Dr. Naveen Choudhary
be taken for each type of interrupt
I/O Structure
OS Notes by Dr. Naveen Choudhary
that do not support interrupt structure
become true or false
simultaneous I/O processing.
waiting for I/O completion. 🡪 Asynchronous I/O
CPU to inform the CPU that it has finished it’s operation
Two I/O Methods
Synchronous
Asynchronous
OS Notes by Dr. Naveen Choudhary
Device-Status Table�The O.S also need to be able to keep track of many i/o requests at the same time. For this purpose the O.S uses a table containing an entry for each i/o device. Such table entry indicates the device type, address & status( not functioning, idle, busy)
First element in the queue : represents the request being processed
Other elements in the queue : represents the requests waiting in the
queue
OS Notes by Dr. Naveen Choudhary
Contd…
OS Notes by Dr. Naveen Choudhary
Direct Memory Access Structure
OS Notes by Dr. Naveen Choudhary
information at close to memory speeds.
one interrupt per byte.
Storage Structure
OS Notes by Dr. Naveen Choudhary
can access directly.
provides large nonvolatile storage capacity.
magnetic recording material
subdivided into sectors.
between the device and the computer.
Moving-Head Disk Mechanism
OS Notes by Dr. Naveen Choudhary
Magentic Tape
OS Notes by Dr. Naveen Choudhary
access
Storage Hierarchy
OS Notes by Dr. Naveen Choudhary
RAM
Storage-Device Hierarchy
As we go down the level : access time increases,
cost per bit decreases, block size increases
Magnetic disk and below : non volatile Electronic disk :nothing but large DRAM ARRAY
OS Notes by Dr. Naveen Choudhary
Caching
OS Notes by Dr. Naveen Choudhary
data.
🡪 uniprocessors systems : not a big problem
🡪 multiprocessor systems : big problem
🡪 cache coherence is generally a h/w issue and is
handled below the O. S. level
Migration of A From Disk to Register
OS Notes by Dr. Naveen Choudhary
Hardware Protection
OS Notes by Dr. Naveen Choudhary
Dual-Mode Operation
OS Notes by Dr. Naveen Choudhary
modes of operations.
🡪 Certain instruction can only be run in monitor mode
🡪 At system boot time, the h/w starts in monitor mode. The
o.s is then loaded and starts user processes in user mode
Dual-Mode Operation (Cont.)
current mode: monitor (0) or user (1).
monitor mode.
Interrupt/fault/trap
monitor
user
set user mode
Privileged instructions can be issued only in monitor mode.
OS Notes by Dr. Naveen Choudhary
I/O Protection
OS Notes by Dr. Naveen Choudhary
are privileged instructions.
Use of A System Call to Perform I/O
OS Notes by Dr. Naveen Choudhary
Memory Protection
Interrupt vector
Service routine address 1 |
SRA 2 |
SRA 3 |
SRA 4 |
|
Table (in Mem)
Memo
ry
Service
Routine
🡪User Program -🡪trap to SAR4 🡪 Take address from IVT & execute the service routine (this is required to be done in monitor mode)
🡪If user modifies SAR4 address and gives there the address of his program then he can run his program in monitor mode
OS Notes by Dr. Naveen Choudhary
Contd ..
OS Notes by Dr. Naveen Choudhary
address.
Use of A Base and Limit Register
OS Notes by Dr. Naveen Choudhary
Hardware Address Protection
300040
OS Notes by Dr. Naveen Choudhary
300040 +120900 = 420940
Hardware Protection
OS Notes by Dr. Naveen Choudhary
privileged instructions.
CPU Protection
infinite loop and so will held the CPU for ever.
ensure operating system maintains control.
OS Notes by Dr. Naveen Choudhary