D.1. Пристрої Linux

У Linux в каталозі /dev можна знайти різні спеціальні файли. Ці файли називаються файлами пристроїв і відрізняються від звичайних файлів. Найпоширенішими типами файлів пристроїв є блокові та символьні пристрої. Ці файли є інтерфейсами до фактичних драйверів (частин ядра Linux), які, своєю чергою, отримують доступ до обладнання. Інший, менш поширений тип файлу пристрою — це pipe. Найважливіші файли пристроїв перераховані нижче в таблицях.

sda Перший жорсткий диск
sdb Second hard disk
sda1 First partition of the first hard disk
sdb7 Seventh partition of the second hard disk

sr0 First CD-ROM
sr1 Second CD-ROM

ttyS0 Serial port 0, also referred to as COM1
ttyS1 Serial port 1, also referred to as COM2
psaux PS/2 mouse device
gpmdata Pseudo device, repeater data from GPM (mouse) daemon

cdrom Symbolic link to the CD-ROM drive
mouse Symbolic link to the mouse device file

null Anything written to this device will disappear
zero One can endlessly read zeros out of this device

D.1.1. Setting Up Your Mouse

The mouse can be used in both the Linux console (with gpm) and the X window environment. Normally, this is a simple matter of installing gpm and the X server itself. Both should be configured to use /dev/input/mice as the mouse device. The correct mouse protocol is named exps2 in gpm, and ExplorerPS/2 in X. The respective configuration files are /etc/gpm.conf and /etc/X11/xorg.conf.

Certain kernel modules must be loaded in order for your mouse to work. In most cases the correct modules are autodetected, but not always for old-style serial and bus mice[21], which are quite rare except on very old computers. Summary of Linux kernel modules needed for different mouse types:

Module Description
psmouse PS/2 mice (should be autodetected)
usbhid USB mice (should be autodetected)
sermouse Most serial mice
logibm Bus mouse connected to Logitech adapter card
inport Bus mouse connected to ATI or Microsoft InPort card

To load a mouse driver module, you can use the modconf command (from the package with the same name) and look in the category kernel/drivers/input/mouse.



[21] Serial mice usually have a 9-hole D-shaped connector; bus mice have an 8-pin round connector, not to be confused with the 6-pin round connector of a PS/2 mouse or the 4-pin round connector of an ADB mouse.