The object is clearly the computer. The operating system operates the computer.
The indirect subject is clear. The operating system operates on behalf of its human user community.
The direct subject is less clear. Generally, the human users interact with applications programs of one kind or another, and it is these programs on behalf of which the operating system operates.
CPU CPU CPU -- central processing units | \ / MEM MEM -- memory | | IOP------IOP----- -- I/O processing units, with an | | interconnection network other other I/O I/O |-------|The focus of a traditional operating system course is on a system with a single CPU and no network. In this course, as suggested by the above figure, we will concentrate on systems that may include multiple CPUs, and indeed, systems that may include many computers interconnected by a network.
Control Registers Unit | PC | The program counter | | and ALU <------> |_______| Some operand registers
Within the CPU, we will be concerned with the set of registers visible to the programmer, and not such details as the presence or absence of pipeline stage registers, microprogram support registers, or other registers hidden inside the CPU.
The most important operation on the registers that will concerns us is that of context switching. This involves first saving all registers of one context and then restoring all registers to build a new context.
Lens Real Memory Virtual ---- | | Memory \ / | | || | | (CPU's / \ | | viewpoint) ---- |_________| Memory Management UnitA Memory Management Unit is present in most larger computer systems, sometimes as a component of the CPU, and sometimes as a separate component. This unit serves as the "lens" through which programs operating on the CPU observe the memory. As with any lens, we will takl about the real memory and the image of memory as seen through the memory management unit, the virtual memory.
The memory management unit contains registers that may (or may not) be part of the context, as described in the following:
If the MMU registers are saved and restored as part of the context switching operation, the operation takes longer and the operation changes the memory address space. If the switch does not save the MMU registers, it is fast, but both the old and new contexts must share the same address space.
This is why we see systems with two levels of processes -- lightweight threads which share address spaces with each other, and heavyweight processes each of which has its own address space. This allows multiple processes acting on behalf of a single application to coexist at very low cost, while allowing separate address spaces to be allocated to each application.
* send( data, device ) -- output * data = get( device ) -- input * repeat until ready( device ) -- wait for transfer completeIn register I/O, data is tranferred is by the program, one byte or word at a time.
* select device and address on device * select buffer in main memory * start transfer in or out * await transfer completeWhen direct memory access I/O hardware is employed, data is transferred one block at a time, in parallel with program execution. I/O is initiated by a program running on the CPU, and then it takes place in parallel with program execution. When done, a signal is sent to the CPU indicating that the transfer is complete.