Material Type: Notes;
Class: Concepts and Facilities of Operating Systems for Computer Scientists;
Subject: Computer Science;
University: North Carolina State University;
Term: Unknown 1989;
Download Lecture Notes on Exceptions and Interrupts | CSC 246 and more Study notes Computer Science in PDF only on Docsity!
Exceptions and InterruptsExceptions and Interrupts
(continued)(continued)
November 17November 17
CSC201 Section 002
Fall, 2000
Device Priorities Device Priorities
Some devices are
More important than others
Or, need attention more quickly
Low-priority interrupts should not be able to interrupt ISRs for high- priority interrupts
The Pentium only has one interrupt request line; how indicate priority? - The Interrupt Controller does this for the CPU
How Priorities Can Be How Priorities Can Be
AccomplishedAccomplished
Can disable interrupts for any specific device
There are 16 interrupt request lines (signals)
IRQ0 priority > IRQ1 priority > ....
Can disable interrupts on any individual interrupt request line
Example Interrupt Process Example Interrupt Process
A program is executing
The user presses a key on the keyboard
The keyboard generates an interrupt request signal to the Interrupt Controller, using IRQ
The Interrupt Controller generates an interrupt request to the processor, and waits for an acknowledgment
When the CPU finishes the current instruction and fetches the next one, it checks whether there is any interrupt pending
The CPU
acknowledges the interrupt
saves task state
clears (disables) the interrupt flag
Memory Privilege Levels Memory Privilege Levels
The Pentium has 4 memory privilege levels: 0 (highest) to 3(lowest) - The operating system runs at level 0, application processes at level 3 - Other levels for device drivers etc.
"Privileged memory" = areas that should not be read or written directly by user programs
Sections (segments) of memory are protected by privilege level - A memory reference (read or write) first compares the required privilege level at the address to the process's privilege level - If the process's priority isn't high enough, an exception is generated
Instructions are also protected by privilege level
Some instructions are designed to specifically modify operating system data structures - Should not be executed by user processes; could overwrite the operating system!
When an instruction is fetched, the required privilege level is compared to the process's privilege level - If not high enough, an exception is generated