Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Hardware Support for Operating Systems, Study notes of Operating Systems

secondary storage. Storage-Device Hierarchy. Hardware Protection. Dual-Mode Operation. I/O Protection. Memory Protection. CPU Protection ...

Typology: Study notes

2021/2022

Uploaded on 09/07/2022

nabeel_kk
nabeel_kk 🇸🇦

4.6

(66)

1.3K documents

1 / 10

Toggle sidebar

Related documents


Partial preview of the text

Download Hardware Support for Operating Systems and more Study notes Operating Systems in PDF only on Docsity! 1 EE 469 Operating Systems Engineering Hardware Support for Operating Systems Spring 2001 David S. Ebert Computer-System Architecture Interrupts A mechanism for achieving coordination between concurrently operating units of a computer system, and for responding to specific conditions within a processor. A transfer of flow of control that is forced by the hardware. Trap - a software generated interrupt caused either by an error, or by a user program request that an OS service be performed. 2 Basic I/O and Computer-System Operation I/O devices and the CPU can execute concurrently. Each device controller is in charge of a particular device type. Each device controller has a local buffer and special purpose registers. CPU moves data from/to main memory to/from local buffers I/O is from the device to local buffer of controller. Device controller informs CPU that it has finished its operation by causing an interrupt. Common Functions of Interrupts Interrupts transfers control to the interrupt service routine generally, through the interrupt vector, which contains the addresses of all the service routines. Interrupt architecture must save the address of the interrupted instruction. Incoming interrupts are disabled (at this and lower priority levels) while the interrupt is being processed to prevent a lost interrupt. Interrupts are enabled after servicing current interrupt Modern operating systems are interrupt driven. Interrupt Handling The operating system preserves the state of the CPU by storing registers and the program counter. Determines which type of interrupt has occurred: • polling • vectored interrupt system Separate segments of code determine what action should be taken for each type of interrupt 5 Storage Hierarchy Storage systems organized in hierarchy. • Speed • cost • volatility Caching – copying information into faster storage system; main memory can be viewed as a cache for secondary storage. Storage-Device Hierarchy Hardware Protection Dual-Mode Operation I/O Protection Memory Protection CPU Protection 1 EE 469 Operating Systems Engineering Hardware Support for Operating Systems Spring 2001 David S. Ebert Computer-System Architecture Interrupts A mechanism for achieving coordination between concurrently operating units of a computer system, and for responding to specific conditions within a processor. A transfer of flow of control that is forced by the hardware. Trap - a software generated interrupt caused either by an error, or by a user program request that an OS service be performed. 2 Basic I/O and Computer-System Operation I/O devices and the CPU can execute concurrently. Each device controller is in charge of a particular device type. Each device controller has a local buffer and special purpose registers. CPU moves data from/to main memory to/from local buffers I/O is from the device to local buffer of controller. Device controller informs CPU that it has finished its operation by causing an interrupt. Common Functions of Interrupts Interrupts transfers control to the interrupt service routine generally, through the interrupt vector, which contains the addresses of all the service routines. Interrupt architecture must save the address of the interrupted instruction. Incoming interrupts are disabled (at this and lower priority levels) while the interrupt is being processed to prevent a lost interrupt. Interrupts are enabled after servicing current interrupt Modern operating systems are interrupt driven. Interrupt Handling The operating system preserves the state of the CPU by storing registers and the program counter. Determines which type of interrupt has occurred: • polling • vectored interrupt system Separate segments of code determine what action should be taken for each type of interrupt 5 Storage Hierarchy Storage systems organized in hierarchy. • Speed • cost • volatility Caching – copying information into faster storage system; main memory can be viewed as a cache for secondary storage. Storage-Device Hierarchy Hardware Protection Dual-Mode Operation I/O Protection Memory Protection CPU Protection 6 Dual-Mode Operation Sharing system resources requires operating system to ensure that an incorrect program cannot cause other programs to execute incorrectly. Provide hardware support to differentiate between at least two modes of operations. 1. User mode – execution done on behalf of a user. 2. Monitor mode (also supervisor mode, kernel mode or system mode) – execution done on behalf of operating system. Special system call instruction: generate an interrupt and switches to monitor mode (conversely, 1 to switch to user mode) Dual-Mode Operation (Cont.) Mode bit added to computer hardware to indicate the current mode: monitor (0) or user (1). When an interrupt or fault occurs hardware switches to monitor mode. Privileged instructions can be issued only in monitor mode. monitor user Interrupt/fault set user mode Types of Protection I/O Protection Memory Protection Cpu Protection 7 I/O Protection All I/O instructions are privileged instructions. Must ensure that a user program could never gain control of the computer in monitor mode (I.e., a user program that, as part of its execution, stores a new address in the interrupt vector). Memory Protection Must provide memory protection at least for the interrupt vector and the interrupt service routines. In order to have memory protection, add two registers that determine the range of legal addresses a program may access: • base register – holds the smallest legal physical memory address. • Limit register – contains the size of the range Memory outside the defined range is protected. A Base And A limit Register Define A Logical Address Space
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved