Download presentation
Presentation is loading. Please wait.
1
Computer System Overview
Book: Operating Systems , Internals and Design Principles, 7th Edition by William Stallings
2
What is Operating System?
An operating system exploits the hardware resources of one or more processors to provide the set of services to system users It also manages secondary memory and I/O devices on behalf of its users
3
Basic Elements of a Computer
These components are interconnected to achieve the main functionality of the computer, which is to execute programs. Processor also known as Central Processing Unit. Controls the operation of computer and data processing function Main Memory: Store data and programs Volatile (when system shut down, the contents of memory are lost) refer to as primary or real memory.
4
Contd… I/O modules System Bus
move data between computer and external environment. External environment may consists of variety of devices including secondary memory devices (e.g. disks). System Bus provide for communication among processor, main memory, and I/O modules.
6
Instruction Execution
A program to be executed consists of set of instructions stored in memory. Instruction Processing consists of two steps: Processor Read/fetch instruction from main memory. (called fetch stage) Executes each instruction (may involve several operations depend on the nature of the instruction).(called execute stage) Program execution halts only if Processor is turned off Some sort of unrecoverable error occur Program instruction that halts the processor is encountered.
7
Instruction Cycle
8
Contd… At the beginning of each instruction cycle
Processor fetch instruction from main memory. (Program Counter holds the address of the address of the next instruction to be fetched, after fetching the instruction, processor increments the PC). The fetched instruction is loaded into instruction register (IR). The instruction contains the bits that specify the action the processor is to take. Processor interprets the instruction and perform the required action.
9
Actions In general, the actions fall into four categories:
Processor-memory data transfer between processor and memory. Processor-I/O data transfer to or from peripheral device by transferring between processor and I/O module. Data Processing processor may perform arithmetic or logic operations on data. Control alter the sequence of execution
11
Example of Program Execution
12
Interrupt Virtually all computers provide a mechanism by which other modules may interrupt the normal sequencing of the processor. Provided primarily as a way to improve processor utilization. Suppose that the processor is transferring data to a printer using the instruction cycle scheme. After each write operation, the processor may pause and remain idle until the printer catches up. The length of this pause may be on the order of many thousands or even millions of instruction cycle, which is wasteful use of processor. Allows the processor to execute other instructions while an I/O operation is in progress
13
Classes of Interrupt
17
Interrupt Handler A program that determines nature of the interrupt and performs whatever actions are needed. According to last example, the handler determine which I/O module generated the interrupt and may branch to a program that will write more data out to that I/O module. Control is transferred to this program Generally part of the operating system. When interrupt handler routine is completed, the processor can resume the execution of the user program at the point of interruption.
18
Interrupt Cycle Processor checks for interrupts
If no interrupts fetch the next instruction for the current program If an interrupt is pending, suspend execution of the current program, and execute the interrupt handler
19
Instruction Cycle with Interrupt Stage
20
Interrupt Processing An interrupt triggers a number of events, both in the processor hardware and software.
23
Multiple Interrupt One or more interrupt can occur while an interrupt is being processed. For example, a program can receive data from communication line and printer results at the same time.
24
Multiple Interrupts: Sequential Order
Disable interrupts so processor can complete task Interrupts remain pending or we can say ignore interrupt until the processor enables interrupts If an interrupt occurs when user program is executing, then interrupt are disabled immediately. After interrupt handler routine completes, the processor checks for additional interrupts Simple Interrupt handle in strict sequential order. Drawback: it does not take into account relative priority
25
Multiple Interrupts: Priorities
Higher priority interrupts cause lower-priority interrupts to wait Causes a lower-priority interrupt handler to be interrupted Example when input arrives from communication line, it needs to be absorbed quickly to make room for more input
26
Multiple Interrupts
27
Example Consider a system with three I/O devices: a printer, disk and communication line: with increasing priorities of 2,4 and 5 respectively.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.