|
|
|
|||||||||||||||||||
|
Unix FAQ Menu |
A generic, platform independent explanation of Unix device handling follows, if you are looking for specific details check out the companion FAQ's for either Solaris of Linux. Note: This FAQ assumes you are familar with the concepts and terms outlined in The Unix filesystem explained Devices under UnixWithin Unix devices and files all handled it in much the same way. There are not distinct device and file management systems. Under Unix whenever a process opens a file or device the system creates a new entry for that file in the process'es open file table. If you do an "ls -l" of a device file you'll notice that where you would normally see the size of the file there is instead two comma separated numbers.;
sun (ksh) % ls -l /dev/fb
crw------- 1 root other 63, 0 Mar 11 1999 /dev/fb
These numbers are known as the major and minor device numbers. The major device number is simply index into the kernel "Device Switch Table" and identifies the driver which handles that device. The minor device number is a argument passed to the device driver whenever the kernel calls that driver. It interpreted in a device dependent fashion. Often it is the index of the device handled by that driver so the first terminal would have a minor number of zero the second of a minor number of one, etc. Block & Character devices: There are two device switch tables within the kernel, one for character based devices ("cdevsw") such as terminal's or printers, and the second is the block devices ("bdevsw") such as disk or CD-ROM drives. The first character in the ls -l output indicates which table a device belongs to; 'c' - character, or 'b' - block. Character devices are often refered to as Raw devices. More about Solaris Devices
This page is under construction, please revisit soon...
|
|||||||||||||||||||
|
||||||||||||||||||||