Sunday, October 26, 2008

How to figure out Linux Devices and Drivers

These are the steps to know if our devices have drivers installed and what they are.

$ less /proc/devices

Character devices:
1 mem
2 pty
3 ttyp
4 /dev/vc/0
4 tty
4 ttyS
5 /dev/tty
5 /dev/console
5 /dev/ptmx
6 lp
7 vcs
10 misc
13 input
14 sound
21 sg
29 fb
81 video4linux
116 alsa
128 ptm
136 pts
180 usb
189 usb_device
195 nvidia
253 usb_endpoint
254 rtc

Block devices:
1 ramdisk
2 fd
3 ide0
7 loop
8 sd
9 md
22 ide1
65 sd
66 sd
67 sd
68 sd
69 sd
70 sd
128 sd
129 sd
130 sd
131 sd
132 sd
133 sd
134 sd
135 sd
253 device-mapper
254 mdp

For example, to see what devices the video4linux driver has:

ls -artl /dev | grep 81
crw-rw---- 1 root root 253, 1 2008-10-26 17:17 usbdev1.1_ep81
crw-rw---- 1 root video 81, 1 2008-10-26 17:17 vbi0
crw-rw---- 1 root video 81, 0 2008-10-26 17:17 video0

To see what devices my NVidia driver has:

ls -artl /dev | grep 195
crw-rw---- 1 root video 195, 255 2008-10-26 17:18 nvidiactl
crw-rw---- 1 root video 195, 0 2008-10-26 17:18 nvidia

The major version is the one that we're interested. It's the first number showed when we do 'ls /dev' as well as the numbers showed in /proc/devices

No comments:

Post a Comment