Get Started. It's Free
or sign up with your email address
Rocket clouds

1. I/O Calls

1.1. Synchronous I/O Structure

1.1.1. User program requests I/O, control returns to user program only upon I/O completion. CPU may be allocated to another process.

1.2. Asynchronous I/O Structure

1.2.1. After I/O starts, control returns to user program without waiting for I/O completion

2. Interrupt

2.1. Interrupt Handling

2.1.1. Interrupt handling is a very important part of the OS.

2.1.2. The operating system must preserve the state of the CPU by storing all registers.

2.1.3. Determine which type of interrupt has occurred: polling - ask each device if it caused the interrupt. vectored interrupt system - device identifies itself when it causes the interrupt.

2.1.4. Separate segments of code determine what action should be taken for each type of interrupt.

2.2. Hardware Interrupts

2.2.1. I/O devices use Asynchronous Hardware Interrupts (i.e. caused by outside world and may happen at any time).

2.2.2. Transfers control to the interrupt service routine, through the interrupt vector, which contains the addresses of all the service routines.

2.2.3. CPU must save the address of the interrupted instruction.

3. Storage Structure

3.1. Main memory - only large storage media that the CPU can access directly.

3.2. Secondary storage - extension of main memory that provides large non-volatile storage capacity.

3.3. Magnetic disks -Disk surface is logically divided into tracks, which are subdivided into sectors. -The disk controller determines the logical interaction between the device and the computer.

4. Storage Hierarchy

4.1. Storage systems can be organized in a hierarchy: -SPEED -COST -VOLATILITY

4.2. Caching - copying information into faster storage system; main memory can be viewed as a fast cache for secondary memory.

4.3. Most programs make accesses to memory which are localised in time i.e. the program spends a lot of time executing short sections of

5. Dual-Mode Operation

5.1. -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.

5.1.1. User mode - execution done on behalf of a user. Monitor mode (also supervisor mode or system mode) - execution done on behalf of operating system.

5.1.2. Certain Privileged instructions can be issued only in monitor mode. Some CPUs have more complex protection mechanisms with many levels of protection (sometimes called rings).

5.2. I/O Protection

5.2.1. All I/O instructions are privileged instructions.

5.2.2. Must ensure that a user program could never gain control of the computer in monitor mode

5.3. Memory Protection

5.3.1. Must provide memory protection at least for the interrupt vector and the interrupt service routines.

5.3.2. 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.

5.3.3. Memory outside the defined range is protected.

5.4. CPU Protection - how does the OS stay in control ???

5.4.1. Timer - interrupts computer after specified period to ensure operating system maintains control. Timer is decremented every clock tick. When timer reaches the value 0, an interrupt occurs.

5.4.2. Timer used to implement multiprogramming.

5.4.3. Timer also used to compute the current time.

5.4.4. Load-timer is a privileged instruction.

5.4.5. User programs can not disable interrupts.