HARDWARE

connected to the system bus: CPU, RAM, clock, disk controllers (disks connect to their controllers), NIC, video card (monitor connects to video card), keyboard (port) controller, mouse (port) controller, printer (port) controller, modem (port) controller

system bus has 32 address lines, 32 data lines, IO line, RW line, interrupt line, interrupt acknowledgement line

registers in the CPU: PSW (processor status word), PC (program counter), SP (stack pointer), IR (instruction register), MAR (memory address register), MBR (memory buffer register), base register, limit register, general purpose registers

how the CPU uses the MAR and MBR registers and the RW line on the system bus to access RAM for reading and writing

hardware support for secure and protected multiprogramming: user-kernel mode of the CPU, base and limit CPU registers, clock hardware interrupts

PSW contains the user-kernel CPU mode bit, interrupts enabled-disabled bit

privileged instructions can be executed only in CPU kernel mode: IN, OUT, HALT, REBOOT, disable interrupts, load into base or limit register

the IN and OUT instructions are used read data and status information from devices (IN) and to send commands and data to devices (OUT), for example, reformat the disk drive, write to a disk block, read disk drive status, read a disk block

Do you see why these should be privileged instructions?

hardware interrupts:

software interrupts:

how the CPU uses the base and limit registers when executing a load/store instruction from/to RAM

CPU base and limit registers used when CPU in user mode

numerical example

clock chip interrupts let OS keep track of elapsed time so no one user process can ``hog'' the CPU (e.g., caught in infinite loop)

disks: controller and controller registers (command, status, data), platter, surface, track, cylinder, sector, disk arm, read-write heads

role of a device driver is to handle the very complicated details of device IO: reading and writing the device controller registers (command, status, data)

accessing device controller registers

performing device IO


home page: http://elvis.rowan.edu/~hartley/index.html
e-mail: hartley@elvis.rowan.edu