CHAPTER 2 COMPUTER SYSTEM STRUCTURES

Get Started. It's Free
or sign up with your email address
CHAPTER 2 COMPUTER SYSTEM STRUCTURES by Mind Map: CHAPTER 2  COMPUTER SYSTEM STRUCTURES

1. Interrupt

1.1. Interrupt Handling

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

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

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

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

1.2. Hardware Interrupts

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

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

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

2. Storage Structure

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

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

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

3. Storage Hierarchy

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

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

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

4. I/O Calls

4.1. Synchronous I/O Structure

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

4.2. Asynchronous I/O Structure

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

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.

5.1.2.1. 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 :

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