Re: char-major
From: Spamless (Spamless_at_Nil.nil)
Date: 07/23/04
- Next message: Tommy Reynolds: "Re: char-major"
- Previous message: Mauro G.: "char-major"
- In reply to: Mauro G.: "char-major"
- Next in thread: Tommy Reynolds: "Re: char-major"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 23 Jul 2004 15:20:23 GMT
In article <pan.2004.07.23.14.29.55.11946@jumpy.it>, Mauro G. wrote:
> I need to understand what is the mean of aliases "char-major-..." or
> "block-major-..."
> Does anyone help me?!
Linux uses a "file" method to access kernel services.
You have a directory /dev.
Those are not devices. They are nodes (created with mknod)
to point to kernel routines (either in the kernel or loaded
from modules if the kernel was compiled with module support
for that device).
Some devices are block devices and some are character oriented
devices.
If you do an "ls -l /dev" you will find entries such as:
brw-rw---- ... 3, 1 Sep 15 2003 hda1
crw------- ... 14, 0 Jul 22 21:14 mixer0
The first character (b or c) indicates block or character
device. While the /dev system uses what "appear" to be
file entries (so you can dump stuff to /dev/[something]
to get it handled by the driver which handles that sort
of data), they are actually tracked by a type, major number
and minor number.
In the above, hda1 is a block device with major number 3
and minor number 1 (often the minor numbers simply represent
different location for the same sort of item, e.g. disk1,
disk2, etc.).
If you have the kernel source installed, the text file:
/usr/src/linux/Documentation/devices.txt
has the list of devices - type and major and minor numbers
(you can have one block device and on character device with the
same major/minor numbers such as
9,1 (major,minor) character device: /dev/st1 Second SCSI tape, mode 0
9,1 (major,minor) block device: /dev/md1 Second metadisk group
(minor number 0 would be the First SCSI tape and metadisk group)
- Next message: Tommy Reynolds: "Re: char-major"
- Previous message: Mauro G.: "char-major"
- In reply to: Mauro G.: "char-major"
- Next in thread: Tommy Reynolds: "Re: char-major"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|