top of page

[Blog 001] Operating System 01

Computer Startup

  1. A bootstrap program is loaded at power-up or reboot.

  2. Typically stored in ROM or EEPROM, generally known as firmware.

  3. Initializes all aspects of the system.

  4. Loads operating system kernel and starts execution.

Computer System Organization

  1. Computer-system operation: One or more CPUs, device controllers connect through a common bus providing access to shared memory.

  2. We want the I/O devices and the CPU to be able to execute concurrently: The CPU shouldn’t have to wait for the MUCH slower I/O device

  3. The I/O device signals an interrupt when it is ready.

  4. When an interrupt occurs, the operating system must: ① Transfer control to the appropriate interrupt handler. ② Since there is more than one device, we use an interrupt vector.

Interrupts: Controllers vs. Handlers

  1. A device controller (hardware / firmware) is responsible for moving data between the media and its own local registers.

  2. An interrupt handler (software) is responsible for moving data between the controller registers and memory (so it can be accessed by the user program): Since there are multiple types of interrupts, there is a handler for each type..

Processing an Interrupt

  1. User program has control.

  2. I/O interrupt occurs. E.g. disk controller signals data read operation completed.

  3. User program no longer processed by the CPU: Current position saved (Program Counter), and interrupts are disabled.

  4. Control transferred to interrupt handler: CPU registers representing current state are saved.

  5. Data transferred from controller to memory or from memory to controller depending on whether input or output operation.

  6. CPU registers restored.

  7. Control returned to user program: ① Interrupts re-enabled. ② Saved Program Counter restored.

I/O Structure

  1. The CPU and device controllers operate in parallel.

  2. Two types of I/O operations: ① Synchronous: user program waits until I/O operation completes. ② asynchronous: user program allowed to continue while I/O operation is in progress.

  3. Asynchronicity is essential for multiprogramming.

  4. Asynchronous I/O for program A allows the CPU to transfer control to another program B until I/O for A is complete.

I/O Structure – Device Status Table

  1. A device status table keeps track of which devices are busy, what they are doing for which program, and which programs are waiting for access to devices.

I/O Structure – Direct Memory Access (DMA)

  1. Used for high-speed I/O devices able to transmit information at close to memory speeds.

  2. Device controller transfers blocks of data from buffer storage directly to main memory without CPU intervention.

  3. Only one interrupt is generated per block, rather than one per byte.




37 views0 comments

Comments


bottom of page