- A modern general-purpose computer system consists of one or more CPUs and a number of device controllers connected through a common bus that provides access to shared memory (see Fig. 4).
- Each device controller is in charge of a specific type of device (for example, disk drives, audio devices, and
video displays).
- The CPU and the device controllers can execute concurrently, competing for memory cycles.
- To ensure orderly access to the shared memory, a memory controller is provided whose function is to synchronize access to the memory.
Figure 4:
A modern computer system.
|
- For a computer to start running, when it is powered up or rebooted-it needs to have an initial program (bootstrap program) to run.
- Typically, it is stored in read-only memory (ROM) or electrically erasable programmable read-only memory (EEPROM), known by the general term firmware, within the computer hardware.
- It initializes all aspects of the system, from CPU registers to device controllers to memory contents.
- The bootstrap program must know how to load the OS and to start executing that system. To accomplish this
goal, the bootstrap program must locate and load into memory the OS kernel.
- The process of initializing the computer and loading the OS is known as bootstrapping (see Fig. 5).
Figure 5:
Booting the computer.
|
- UNIX System initialization and Bootstrapping;
Figure 6:
UNIX System initialization
|
- Once the kernel boots, we have a running Linux system. It isn't very usable, since the kernel doesn't allow direct interactions with ``user space''.
- So, the system runs one program: init and waits for some event to occur. This program is responsible for everything else and is regarded as the father of all processes.
- The kernel then retires to its rightful position as system manager handling ``kernel space'' (see Fig. 6).
- Some portions of the OS remain in main memory to provide services for critical operations, such as dispatching, interrupt handling, or managing (critical) resources.
- These portions of the OS are collectively called the kernel.
Kernel = OS - transient components
remains comes and goes
- The occurrence of an event is usually signaled by an interrupt from either the hardware or the software.
- Hardware may trigger an interrupt at any time by sending a signal to the CPU, usually by way of the system bus.
Software may trigger an interrupt by executing a special operation called a system call (also called a monitor call).
- When the CPU is interrupted, it stops what it is doing and immediately transfers execution to a fixed location.
- The fixed location usually contains the starting address where the service routine for the interrupt is located.
- The interrupt service routine executes; on completion, the CPU resumes the interrupted computation. A time line of this operation is shown in Fig. 7.
Figure 7:
Interrupt time line for a single process doing output.
|
- Interrupts are an important part of a computer architecture. The interrupt must transfer control to the appropriate interrupt service routine (ISR) (see Fig. 8).
- The straightforward method for handling this transfer would be to invoke a generic routine to examine the interrupt information; the routine, in turn, 'would call the interrupt-specific handler.
- Since only a predefined number of interrupts is possible, a table of pointers to interrupt routines can be used. Generally, the table of pointers is stored in low memory (the first 100 or so locations). These locations hold the addresses of the interrupt service routines for the various devices.
- This array, or interrupt vector, of addresses is then indexed by a unique device number, given with the interrupt request, to provide the address of the interrupt service routine for the interrupting device.
- Operating systems as different as Windows and UNIX dispatch interrupts in this manner.
Cem Ozdogan
2011-02-14