archsupport-02 - Architectural Support for Operating...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
Architectural Support for Operating Systems
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Announcements Required textbook should be in Cornell store soon (perhaps this week)
Background image of page 2
Today’s material I/O subsystem and device drivers Interrupts and traps Protection, system calls and operating mode OS structure What happens when you boot a computer?
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Computer System Architecture Synchronizes memory access
Background image of page 4
I/O operations I/O devices and the CPU can execute concurrently. Each device controller is in charge of certain device type. May be more than one device per controller SCSI can manage up to 7 devices Each device controller has local buffer, special registers A device driver for every device controller Knows details of the controller Presents a uniform interface to the rest of OS
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Accessing I/O Devices Memory Mapped I/O I/O devices appear as regular memory to CPU Regular loads/stores used for accessing device This is more commonly used Programmed I/O Also called “channel” I/O CPU has separate bus for I/O devices Special instructions are required Which is better?
Background image of page 6
Polling I/O Each device controller typically has: Data-in register (for host to receive input from device) Data-out (for host to send output to device) Status register (read by host to determine device state) Control register (written by host to invoke command)
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Polling I/O handshaking: To write data to a device: 1. Host repeatedly reads busy bit in status register until clear 2. Host sets write bit in command register and writes output in data-out register 3. Host sets command-ready bit in control register 4. Controller notices command-ready bit , sets busy bit in status register 5. Controller reads command register , notices write bit : reads data-out register and performs I/O (magic) 6. Controller clears command-ready bit , clears the error bit (to indicate success) and clears the busy bit (to indicate it’s finished)
Background image of page 8
Polling I/O What’s the problem? CPU could spend most its time polling devices, while other jobs go undone. But devices can’t be left to their own devices for too long Limited buffer at device - could overflow if doesn’t get CPU service. Modern operating systems uses Interrupts to solve this dilemma. Interrupts: Notification from interface that device needs servicing Hardware: sends trigger on bus Software: uses a system call
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Interrupts CPU hardware has a interrupt-request line (a wire) it checks after processing each instruction. On receiving signal Save processing state Jump to interrupt handler routine at fixed address in memory Interrupt handler: Determine cause of interrupt. Do required processing.
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/19/2008 for the course CS 4410 taught by Professor Vollset during the Fall '07 term at Cornell University (Engineering School).

Page1 / 47

archsupport-02 - Architectural Support for Operating...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online