The Apple Desktop Bus (ADB) is the single-master, multiple-slave, low-speed serial bus interface used by Macintosh computers to connect input devices such as keyboards, mice, trackpads, trackballs, and graphics tablets to the machine.
NetBSD provides support for the Apple Desktop Bus as found on all supported mac68k models, as well as macppc models with on-board ADB (PowerBooks and “Old World” models).
The
adb driver accesses the ADB controller using the so-called “HWDIRECT” method. This method of access bypasses the Macintosh ROM and uses only
NetBSD routines for ADB access. This is the only method supported on macppc and is the default for mac68k systems.
On mac68k systems there is an alternate method of accessing the ADB controller. With the Macintosh ROM Glue (MRG) method, the routines written for MacOS are used. To enable this method of ADB access, uncomment the line:
options MRG_ADB
in your kernel configuration file.
The
ioctl(2) call is used to control the ADB event device. The following is a list of available
ioctl(2) commands:
ADBIOC_DEVSINFO
Get ADB Device Info
The
adb event device will return an array of information containing an entry for each device connected to the bus. Each entry contains the current address, default address, and handler ID for the corresponding ADB device.
ADBIOC_GETREPEAT
Get Keyboard Repeat Info
Returns a structure containing the current keyboard repeat delay and keyboard repeat interval.
ADBIOC_SETREPEAT
Set Keyboard Repeat Rate
Sets the keyboard repeat delay and interval to the values specified by
argp.
ADBIOC_RESET
ADB Reset
Perform a reset of the ADB which will reinitialize all of the devices attached to the bus.
ADBIOC_LISTENCMD
ADB Listen Command
Send data to the register of the ADB device specified by
argp. This command is not fully implemented at this time.