Re: The guts of /dev/* ?

From: Tauno Voipio (tauno.voipio_at_iki.fi.NOSPAM.invalid)
Date: 12/05/04


Date: Sun, 05 Dec 2004 10:11:06 GMT

Jean-David Beyer wrote:
> Bill Unruh wrote:
>
>> Robert Heller <heller@deepsoft.com> writes:
>>
>> ] not@top-post,
>> ] In a message on Sat, 04 Dec 2004 10:54:05 -0600, wrote :
>>
>> ]n> Where would I find text explaining the 'innards' of /dev/* ?
>> ]n> Not at a 'salesClerk level': "try xyz [it worked for me]. ", but
>> ]n> down at asm, interrupts ...etc. level.
>>
>> Read the source code. I highly doubt that this is what you want.
>> The files in /dev/are links to the device drivers. The input and output
>> depend on what the specific device driver will do. cat /dev/dsp reads
>> from teh oss audio device, and pushes the stuff out on
>> stdout. Exactly what is read depends on how the device driver happens
>> to have been
>> set by the ioctls for that device. (ioctls are commands sent to the
>> device
>> driver with routines which deliver the ioctl codes to the driver).
>>
>>
> While you are not wrong, I would never call them _links_, since I use
> that term mainly for the things the _ln_ command creates. I think of
> them as an index to a two-dimensional table inside the kernel that the
> kernel uses to call the proper driver. (I do not mean to imply that it
> is actually implemented that way, though it might be: I never looked.)
>

The major number indexes to the proper driver. It is up to
the driver to use the minor number in whatever way it deems
suitable. An example is the hard disk driver using the minor
number for drive and partition on the drive.

The list of the allocated major device numbers is in the
Linux sources at /usr/src/linux/Documentation/devices.txt

-- 
Tauno Voipio
tauno voipio (at) iki fi


Relevant Pages

  • Re: Mirror Driver Architecture
    ... the various VNCs, which do exactly what you are asking, and come with ... we can't use them unless we publish our own source code (this is a commercial ... You are right, of course, any kind of programming in the kernel seems to be ... driver sample code - specifically DrvBitBlt and DrvCopyBits - for sending ...
    (microsoft.public.win32.programmer.kernel)
  • Re: protecting source code in 2.6
    ... > to distribute our driver as sum of source code and librabry/object code. ... > and the device interface module. ... The device interface module on the other ...
    (Linux-Kernel)
  • Re: SATA RAID 1 - which controller to pick?
    ... release their source code for a driver, ... Because I could not get the Redhat driver working, ... SCSI is really an overkill for small ... > than SATA. ...
    (comp.os.linux.hardware)
  • Re: How can I link the kernel with libgcc ?
    ... I included source code for the ... Where is the source code to your driver? ... need floating point, just some thought ahead of time. ... log10but int) for some positive integer foo. ...
    (Linux-Kernel)
  • Re: Does Bill Gates know about the DDK regarding C++?
    ... a well known chip manufacturer with a 2 character acronym. ... there is something to be said for clean WYSIWYG source code. ... > Don Burn (MVP, Windows DDK) ... > Windows 2k/XP/2k3 Filesystem and Driver Consulting ...
    (microsoft.public.development.device.drivers)