Operating System Assignment 1
Operating System Assignment 1
Date: 28/01/2016
Basic Element
1. Processor
2. Main Memory
3. I/O Modules
4. System Bus Processor
Processor
Controls operation, performs data processing
Two internal registers Memory address resister (MAR) Memory buffer
register (MBR)
I/O address register
I/O buffer register
Main Memory
Volatile Data is typically lost when power is removed
Referred to as real memory or primary memory
Consists of a set of locations defined by sequentially numbers addresses
Containing either data or instructions
I/O Modules
Moves data between the computer and the external environment such as:
Storage (e.g. hard drive) Communications equipment Terminals
Specified by an I/O Address Register (I/OAR)
System Bus
Communication among processors, main memory, and I/O modules
Instruction Execution
A program consists of a set of instructions stored in memory
Two steps
Processor reads (fetches) instructions from memory
Processor executes each instruction
Basic Instruction Cycle
Interrupts
Interrupt the normal sequencing of the processor
Provided to improve processor utilization
Interrupt Cycle
After the execute cycle is completed, a test is made to determine if an interrupt was
enabled (e.g. so that another process can access the CPU)
6
continue the instruction cycle within the interrupt routineafter the interrupt
routine finishes, the PC-save-address is used to reset the value of PC and
program execution can continue
Memory Hierarchy
Major constraints in memory
Amount
Speed
Expense
7
Secondary Memory
Auxiliary memory
External
Nonvolatile
Used to store program and data files
Cache Memory
Invisible to the OS
8
Exploit the principle of locality with a small fast memory
I/O Techniques
When the processor encounters an instruction relating to I/O
it executes that instruction by issuing a command to the appropriate I/O
module.
Three techniques are possible for I/O operations:
Programmed I/O
Interrupt-driven I/O
Direct memory access (DMA)
Programmed I/O
The I/O module performs the requested action
9
but takes no further action to alert the processor.
As there are no interrupts, the processor must determine when the instruction
is complete
Interrupt-Driven I/O
Processor issues an I/O command to a module and then goes on to do some
other useful work.
The I/O module will then interrupt the processor to request service when it is
ready to exchange data with the processor. InterruptDriven I/O
10
11
Much more efficient.
Assignment Submitted By
Utsav Preet
CSE - B(2nd Year)