Lecture 1 Summary

Logistics

What is an OS?

The OS is software that mediates the interactions between applications and hardware. It provides:

Why study OS?

Design exercise: keyboard

Suppose we just finished our architecture course and had a design for a processor and memory. How would we implement a program that takes input from a keyboard?

Note: This is not the final picture, we will continue the discussion tomorrow, but here's where we left off:

To start with, we need the keyboard itself. We can think of this as a collection of switches (one for each key). These are connected to an encoder; when a key is pressed, a collection of wires encoding the key code is activated.

The interesting question is what happens next. What do we do with those signals? How do they make their way to the processor and ultimately the program?

We came up with two designs for the actual connection between the keyboard and the processor:

In either of these two designs, when a key is pressed, the keycode will be stored, and an interrupt will be raised (on the interrupt line, which connects the device to the interrupt controller). This will cause the CPU to jump.

In today's lecture, we decided that the CPU should jump to the address of some device-specific code, called the device driver, using the device ID to determine which driver to jump to. Tomorrow we will refine this picture somewhat: in fact the processor will jump to the operating system's interrupt service routine, which may in turn jump to the driver.

At any rate, the driver will then use the I/O instructions (if using programmed I/O) or load and store instructions (if using memory-mapped I/O) to do the appropriate thing. More discussion on what "the appropriate thing" is coming soon.