Relative devices

The hirun directory contains examples of a mouse device (kb.c) and protocol (msoft.c, ps2.s, msys.c) modules.

Since these modules cover all the main types of relative devices, you probably won't need to develop something new from scratch. If you need to implement support for any device that's not completely supported by this driver, you can simply copy the files from this directory into a new one and modify them.

Note that Microsoft and Mouse Systems class devices don't have a device module — they just use /dev/serN to get raw data from a serial communication port. A PS/2 mouse shares the 8042 controller device driver (kb.c) with a standard keyboard.

The protocol layer module receives raw coordinates from the mouse, formats a packet_rel structure, and then passes it up to the relative filter.

The relative filter module implements an acceleration algorithm, converts raw data received from the protocol level according to the current speed parameter, and emits this data in the form of events.