Skip to content

Lab 4: PS/2 Mouse Packets

Generated folder: labs/mouse/

Lab 4 extends the i8042 controller idea to the auxiliary PS/2 mouse. The mouse reports packets containing button state, movement deltas, sign bits, and overflow flags.

Device Model

Packet byteContains
byte 0buttons, sign bits, overflow bits, synchronization bit
byte 1X movement low byte
byte 2Y movement low byte

The first byte includes a synchronization bit that helps recover alignment.

Plan

  1. Enable data reporting.
  2. Validate command responses.
  3. Feed bytes into a packet builder.
  4. Use the sync bit to align packets.
  5. Sign-extend X and Y movement.

Next: implementation tasks.

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