Docsity

Computer-System Structures - Operating Systems, Distributed Computation - Lecture Slides, Slides of Operating Systems

Partial preview of the text

Download Computer-System Structures - Operating Systems, Distributed Computation - Lecture Slides and more Slides Operating Systems in PDF only on Docsity!

Computer-System Structures

General System Architecture and I/O

Input/Output Architecture

Interrupt Causes

  • Hardware : A device sends a signal through a

hard-wired port to signal that it needs

attention.

  • Software : A special instruction that generates

an interrupt

  • Terminology : A trap is a software-generated interrupt caused either by an error or a user request (like a system call)

What Happens on an Interrupt?

  • Interrupt causes the HARDWARE to transfer

control to the interrupt service routine (ISR)

  • Through the interrupt vector (usually), which contains the addresses of all the ISRs.
  • Interrupt architecture must save the address of

the interrupted instruction.

  • Need an instruction like
    • “JALR” (from LC2K)
    • “bl” and “blr” (from PPC)

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

Synchronous I/O Structure

  • After I/O starts, control returns to user program

only upon I/O completion.

  • Wait instruction idles the CPU until the next interrupt
  • Wait loop (contention for memory access).
  • At most one I/O request is outstanding at a time, no simultaneous I/O processing.

Two I/O Methods

Synchronous Asynchronous

Device-Status Table

Direct Memory Access (DMA)

  • Used for high-speed I/O devices able to

transmit information at close to memory

speeds.

  • Device controller transfers blocks of data from

buffer storage directly to main memory

without CPU intervention.

  • Only one interrupt is generated per block,

rather than the one interrupt per byte. Docsity.com

Storage Structure

  • Main memory
    • Only large storage media that the CPU can access directly.
  • Secondary storage
    • extension of main memory that provides large nonvolatile storage capacity.

Moving-Head Disk Mechanism

Storage Hierarchy

  • Storage systems organized in hierarchy.
    • Speed
    • Cost
    • Volatility
  • Caching
    • copying information into a faster storage system
    • main memory can be viewed as a last cache for secondary storage.

Caching

  • Use of high-speed memory to hold recently-

accessed data.

  • Requires a cache management policy.
  • Caching introduces another level in storage

hierarchy. This requires data that is

simultaneously stored in more than one level

to be consistent.

Migration of A From Disk to Register