Lecture 5: Key Board Control

Outline:

Hardware to Software:

The hardware works something like:

serial to parallel interface

We as programmers approach this from the bottom!

We have a status register we can test and a buffer we can read. A small bonus we get is the keyboard controller will automatically turn off the RDY bit when we read the buffer.

Hardware Design Point of View

Software Design Point of View

  1. What is the format of the information
  2. How do we translate the information into some standard
  3. What standard is used by the keyboard
  4. What standard is used by the rest of the computer
mapping a conceptual array to physical memory

Most of our work revolves around number 2 since 1,3,4 should be available in manuals. In the figure, we see a conceptual layout of four related items fu, bar, sna, fu. On the right we see how they are stored in physical memory. What would memory look like if we rearranged the items into the following order: bar, sna, fu, fu?

mapping a conceptual array to physical memory

Interpreting Keystrokes

New Design Method

The keyboard control lends itself to incremental development. Rather than design, and code the whole thing, grow from a small piece of functionality. For example, interpret keystrokes first. Result: type h, see h@h. Next add release, shift, or control. Say we choose control. Result: type h see h#h, type ^h see ^h%^h. Until the release condition is handled, you will see a garbage character print to the screen.


David A Soruco
Last modified: Thu Feb 12 09:56:25 EST