1) Is the operating system hardware or software?

2) What are the functions/goals/role of the operating system?

3) How is a computer system protected from a user program that goes into an infinite loop?

4) Modern CPU's have dual-modes of operation where there are two (or more) modes of operation: user mode and system(/supervisor/monitor) mode. A mode-bit(s) within the CPU's processor-status-word (PSW) register is used to indicate whether the CPU is executing in user or system mode. The set of all machine-language instructions are divided into:

a) privileged instructions that can only be executed in system mode, and

b) non-privileged instructions that can be executed in any mode of operation.

Every time an instruction is executed by the CPU, the hardware checks to see if the instruction is privileged and whether the mode is user. Whenever this case is detected, an exception (internal interrupt) is generated that turns CPU control back over to the operating system.

Can you think of some privileged instructions related to the answer to question (3) above?

5). Suppose we had a block transfer from an I/O device to memory. The block consists of 1024 words and one word can be transferred at a time. For each of the following, indicate the number of interrupts needed to transfer a block:

a) programmed-I/O

b) interrupt-driven I/O

c) DMA (direct-memory access)

6) What is the main difference between programmed I/O and interrupt-driven I/O?

7) What is the main difference between interrupt-driven I/O and DMA?

8) Assume special I/O instructions are used to fill I/O-controller registers. Why can't a user program use these instructions to communicate with the I/O device directly and "by-pass" the operating system's protection checking?

9) Assume that memory-mapped I/O is used. Since Load and Store instructions are used to communicate with the I/O-controller registers, why can't a user program communicate with the I/O device directly and "by-pass" the operating system's protection checking?