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
| Register | Role |
|---|---|
| status register | output-buffer state and error bits |
| output buffer | next scancode byte |
| command register | controller commands |
| IRQ line | keyboard event notification |
Scancodes can be one byte or two bytes. 0xE0 starts an extended sequence.
Plan
- Read status before output.
- Reject data when error bits are set.
- Process bytes into complete scancodes.
- Distinguish make and break events.
- Keep parser state separate from application controls.
Next: implementation tasks.