Module 2 Flashcards
Computer System Architecture
System Bus (Memory Controller -> Memory) -> CPU -> Disk Controller -> Printer Controller -> Tape-drive Controller
Execution Sequence
Fetch -> Decode -> Execute - > Write results -> PC -> Repeat
____ and ____ execute concurrently
I/O devices, CPU
each _____ has a local buffer
device controller
_____ moves data from/to main memory to/from the local
buffers
CPU
_______ interrupts CPU on completion of I/O
device controller
is a signal to the processor indicating an event that needs immediate attention
interrupt
Interrupt handling process:
- The processor stops current execution
- Saves state/context
- Transfers control to an interrupt handler
- Resumes execution after handling
transfers control to the interrupt service routine
Interrupt
segments of code that determine
action to be taken for each type of interrupt
Interrupt Service Routine
contains the address of service routines
Interrupt vector
software generated interrupt caused either by an error or a
user request
Trap
Types of interrupt
Polling
Vectored interrupt system
refers to the process by which a program or system continuously checks the status of a device or
resource at regular intervals to determine if it requires attention.
Polling
is a mechanism in computer systems where interrupts are handled using a specific address (vector) associated with the interrupt source
Vectored interrupt system
Incoming interrupts are disabled while another interrupt is
being processed to prevent a _____
lost interrupt
2 I/O Structures
Synchronous I/O
Asynchronous I/O
- wait instruction idles CPU until next interrupt
- no simultaneous I/O processing, at most one outstanding I/O request at a time
Synchronous I/O
after I/O is initiated, control returns to user program without waiting for I/O completion.
Asynchronous I/O
holds type, address and state for
each device
Device Status table
Used for high speed I/O devices
able to transmit information at
close to memory speeds
Direct Memory Access (DMA)
3 Storage Structure
Main memory
Secondary storage
Tertiary Storage
only large storage media that the CPU can access directly
Main memory
extension of main memory that has
large nonvolatile storage capacity
Secondary storage
rigid metal or glass platters covered with magnetic recording material.
Magnetic disks
examples are Tape drives and Cloud backups
Tertiary Storage
Storage systems are organized in a hierarchy based on:
Speed
Cost
Volatility
process of copying information into faster storage system; main memory can be viewed as fast
cache for secondary storage
Caching
Storage Device Hierarchy
registers -> cache -> main memory -> electronic disks -> magnetic disk -> optical disk -> magnetic tape
4 Hardware Protection
Dual Mode Operation
I/O Protection
Memory Protection
CPU Protection
Sharing system resources requires operating system to ensure that an incorrect program cannot cause other programs to execute incorrectly
Dual-mode operation
two modes of operation
User mode
Monitor mode (supervisor/kernel/system mode)
execution done on behalf of a user
User mode
execution done on behalf of operating system
Monitor mode (supervisor/kernel/system mode)
These instructions are used for system-critical operations
and are restricted to prevent unauthorized access by user
programs.
Privilege Instruction
Examples of Privileged Instructions
Interrupt Handling
Modifying System Control Registers
Changing CPU Mod
Must ensure that a user program could never gain
control of the computer in monitor mode, for e.g. a user
program that as part of its execution, stores a new
address in the interrupt vector
I/O Protection
Must provide memory protection at
least for the interrupt vector and the interrupt service routines
Memory Protection
interrupts computer after specified period to ensure that OS maintains control
Timer
Given the I/O instructions are privileged, how do users
perform I/O?
Via system calls
the method used by a process to request action by the operating system
system calls
Interface between running
program and the OS.
System Calls
Operating Systems: How are they organized?
Simple
Layered
Microkernel
Modular
Only one or two levels of code
Simple
Lower levels independent of upper levels
Layered
OS built from many user-level processes
Microkernel
Core kernel with Dynamically loadable modules
Modular
4 Types of Kernel
Monolithic Kernel
Microkernel
Hybrid Kernel
Exokernel
Entire OS runs as a single program in kernel mode (Example: Linux, Unix)
Monolithic Kernel
Only essential functions (process management, memory management) are in the kernel, while others run as separate user-space services (Example: Minix, QNX)
Microkernel
Combines elements of monolithic and microkernels. (Example: Windows NT, macOS)
Hybrid Kernel
Minimally manages resources, allowing applications to control hardware directly.
(Example: MIT Exokernel)
Exokernel
provides a lot of functionality in little space.–Not divided into modules, Interfaces and levels of
functionality are not well separated
MS-DOS
limited structuring, has 2 separable parts
-Systems programs
-Kernel
UNIX
Moves as much from the kernel into “user” space
Microkernel Structure