operating system overview. contents basic hardware elements
TRANSCRIPT
![Page 1: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/1.jpg)
OPERATING SYSTEM
OVERVIEW
![Page 2: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/2.jpg)
ContentsContents
Basic hardware elements
![Page 3: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/3.jpg)
Most I/O devices
are much slower than
the processor
InterruptsInterrupts
Interrupt request signal
Active waiting cycle
(polling)
![Page 4: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/4.jpg)
An interrupt cycle is added to the
instruction cycle (fecth and execute).
The processor checks to
see if an interrupt has
occured (interrupt signal)
Interrupt mechanismInterrupt mechanism
![Page 5: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/5.jpg)
interrupt handler
interrupt vector
Interrupt mechanismInterrupt mechanism
![Page 6: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/6.jpg)
CPU saves PS and PC (push) into the
control stack
CPU saves PS and PC (push) into the
control stack
CPU loads into PC and
PS the corresponding values from the
interrupt vector
CPU loads into PC and
PS the corresponding values from the
interrupt vector
Interrupt processingInterrupt processing
![Page 7: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/7.jpg)
iretiret
interrupt handler
execution
interrupt handler
execution
Interrupt processingInterrupt processing
![Page 8: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/8.jpg)
Interrupt enable/disable bit (PS register)Interrupt enable/disable bit (PS register)
Hardware priority
Hardware priority
STI (Set Interrupt) CLI (Clear
Interrupt)
STI (Set Interrupt) CLI (Clear
Interrupt)
Interrupt mechanismInterrupt mechanism
![Page 9: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/9.jpg)
main memorymain memory
i+1i+1 PS inth
1OOii1OO1OO
149149
15O15O iretiret
1OOO1OOO
12OO12OO
12O112O1
main memorymain memory
inthinth
progproginterruptinterrupt
11
22
33
interrupt vectorinterrupt vector
Interrupt processing
![Page 10: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/10.jpg)
PS prog
12O1
3824
PSPS
PCPC
SPSP
stack
main memory
38243824
39OO39OO
CPU completes execution
of the current instruction
CPU completes execution
of the current instruction
Interrupt processing
![Page 11: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/11.jpg)
interrupt signal has been acceptedinterrupt signal has been accepted
PS inth
1OO
3822
PSPS
PCPC
SPSP
stack
main memorymain memory
38243824
39OO39OO
12O1
PS prog
38233823
38223822
Interrupt processing
![Page 12: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/12.jpg)
PS inth
151
3822
PSPS
PCPC
SPSP
stack
main memorymain memory
38243824
39OO39OO
12O1
PS prog
38233823
38223822
iret executioniret execution
Interrupt processing
![Page 13: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/13.jpg)
stack
main memorymain memory
38243824
39OO39OO
PS prog
12O1
3824
PSPS
PCPC
SPSP
iret completed iret completed
Interrupt processing
![Page 14: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/14.jpg)
O.S.Components
ContentsContents
![Page 15: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/15.jpg)
Process Management
O.S. COMPONENTS
Main-Memory Management
Secondary-Memory
Management
![Page 16: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/16.jpg)
File Management
I/O-System Management
O.S. COMPONENTS
![Page 17: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/17.jpg)
Creating and deleting processes
Suspending and resuming processes
Provide mechanisms
for process interaction
Process management
![Page 18: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/18.jpg)
Keeping track of which
parts of memory
are currently being used
and by whom
Main memory management
![Page 19: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/19.jpg)
Deciding which processes are to be loaded
when memory becomes available
Main memory management
![Page 20: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/20.jpg)
Allocating and deallocating memory
space as needed
Main memory management
![Page 21: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/21.jpg)
Secondary memory
management
Free space management
Storage allocation
Disk scheduling
![Page 22: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/22.jpg)
I/O SYSTEM MANAGEMENT
The I/O subsystem
consists of
A memory-management component that
includes buffering and spooling
![Page 23: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/23.jpg)
A general device driver interface
Drivers for specific hardware devices
A general device driver interface
Drivers for specific hardware devices
I/O SYSTEM MANAGEMENT
The I/O subsystem
consists of
I/O SYSTEM MANAGEMENT
The I/O subsystem
consists of
![Page 24: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/24.jpg)
File management
Creating and deleting
files and directories
Supporting primitives
for manipulating file
and directory
![Page 25: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/25.jpg)
Mapping files
onto storage
Backing up files
on stable storage media
File management
![Page 26: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/26.jpg)
Protection systemsProtection systems
Mechanism for
controlling the access
of processes to system resources
![Page 27: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/27.jpg)
The mechanism must
provide means for specifying the
controls
to be imposed and means for enforcement
Protection systems
![Page 28: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/28.jpg)
The interface between users and O.S.
A program that reads
and interpretes control statements
The interface between users and O.S.
A program that reads
and interpretes control statements
Comand-Interpreter System
![Page 29: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/29.jpg)
Its main function: to get next command
statement
and execute it (shell)
Its main function: to get next command
statement
and execute it (shell)
Comand-Interpreter System
![Page 30: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/30.jpg)
System calls
ContentsContents
![Page 31: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/31.jpg)
Processes communicate
with the O.S. and request services to it by
making system calls
System Calls
![Page 32: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/32.jpg)
System calls provide
the interface between any process and O.S.
System Calls
![Page 33: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/33.jpg)
Process control
Examples of System CallExamples of System Call
Communications
Information management
Device manipulation
File manipulation
![Page 34: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/34.jpg)
Corresponding to
each system call
there is a library procedure
Corresponding to
each system call
there is a library procedure
![Page 35: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/35.jpg)
count= read (file, buffer, nbytes)
count returns the number of bytes actually read
C programC program
Example: read system callExample: read system call
![Page 36: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/36.jpg)
Library read
procedure
operating system
system call READ
INT
return from INT
register xregister x
x call parameters
load x
system call READ 2
3
1
![Page 37: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/37.jpg)
Puts the parameters of the system call in machine
registers
Puts the parameters of the system call in machine
registers
The library procedureThe library procedure
The control is returned to the caller by
returning the status code as a result
The control is returned to the caller by
returning the status code as a result
Issues a INT instruction to start the O.S.
Issues a INT instruction to start the O.S.
![Page 38: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/38.jpg)
directly via registers
in a memory block whose address is passed as a
parameter in a registry
into the stack (push, pop)
directly via registers
in a memory block whose address is passed as a
parameter in a registry
into the stack (push, pop)
Methods to pass parameters to operating systemMethods to pass parameters to operating system
![Page 39: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/39.jpg)
hardware
(CPU, memory, disks, terminals, …)
UNIX O.S.
(process management, memory management, file system,
I/O, ...)
standard library
(open, close, read, write, ..)
utility programs
(shell, compiler, …)
users
user mode
kernel mode
user int.
library
interface
system
call
interf.
![Page 40: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/40.jpg)
Dual mode of operationsDual mode of operations
user modeuser mode
Hardware control does not allow the execution of
privileged instructions
Hardware control does not allow the execution of
privileged instructions
Used for normal execution of user programs
Used for normal execution of user programs
![Page 41: OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements](https://reader035.vdocuments.us/reader035/viewer/2022062421/56649e565503460f94b4e74a/html5/thumbnails/41.jpg)
Used for the execution of O.S. functions as
required by system calls
Used for the execution of O.S. functions as
required by system calls
supervisor mode (kernel mode)supervisor mode (kernel mode)
All instructions can be executed
All instructions can be executed
Dual mode of operationsDual mode of operations