Thursday, January 12, 2006

System Working Principle

For a server to startup or reboot

(1) bootstrap program needs to run first

bootstrap program is simple and stored in firmware known by ROM or EEPROM
it init all aspect of the system, from CPU registers to devices controllers
to memory contents.

(2) bootstrap program must locate and load OS kernel into memory, in addition
the OS then starts to executing the first process such as "init" and wait
for some event to occur.

(3) occuring of the event is singalled by "interrupt" from HW or SW. HW can trigger
an interrupt at any time by sending a signal to the CPU, usually by the way
of system bus. SW may trigger an interrupt by an operation called "system call"


(4) Interrupt transfer the control to a proper interrupt service routine. When a CPU is interrupted, it stops the current processing and immediately
transfers the execution to a fixed location. The fixed location contains
the starting address where the service routine for the interrupt is located.
The service routine executes, on completion, CPU resume the interrupted
computation.

No comments: