Skip to content

Lab 3: Keyboard And i8042

Generated folder: labs/kbd/

Lab 3 moves from periodic events to human input. A key press is not a character; it is a device event that may arrive as one or more scancode bytes.

Device Model

RegisterRole
status registeroutput-buffer state and error bits
output buffernext scancode byte
command registercontroller commands
IRQ linekeyboard event notification

Scancodes can be one byte or two bytes. 0xE0 starts an extended sequence.

Plan

  1. Read status before output.
  2. Reject data when error bits are set.
  3. Process bytes into complete scancodes.
  4. Distinguish make and break events.
  5. Keep parser state separate from application controls.

Next: implementation tasks.

Course/docs licensed CC BY 4.0. Code licensed MIT.