Re: Creating /dev/* special files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 26 Jun 2010, Mulyadi Santosa wrote:

> Hi...
>
> On Sat, Jun 26, 2010 at 07:35, Brian Paterni <bpaterni@xxxxxxxxx> wrote:
> > What I'm wondering though, is how production drivers handle the
> > creation of these special /dev/* files? "Real" kernel drivers do
> > not depend on specialized scripts to handle this, or do they? I've
> > grepped through my entire /etc directory and only found a few
> > references to mknod in the checkroot, sysklogd, and mountall init
> > scripts. Likewise, there are only few references to the mknod
> > syscall in Linux's /drivers directory.
>
> I'm truly sucks at this area, but perhaps you need to read about
> udev and hotplug.

  yup, that's pretty much right -- you want to read about "udev", but
the "hotplug" facility itself is sort of outdated.  in terms of
learning about udev, what is considered the canonical piece of
documentation is this:

  http://www.reactivated.net/writing_udev_rules.html

but that's already out of date since udev has been refactored, and all
the references to commands like udevtrigger and so on should be
replaced by the catch-all "udevadm" utility.

  and at the risk of sounding repetitive (and i truly hate doing
that), knowing how udev works and how to create the special device
files that correspond to drivers is pretty essential stuff so (you
guessed it) i'll be writing a lesson on this for my kernel programming
course.

  if you just want to handle this manually, there's a good explanation
in the aforementioned LDD3 book (http://lwn.net/Kernel/LDD3/), which
shows how one manually creates the dev files after loading the kernel
module.  that's explained in LDD3, around p. 47, in chapter 3.

  hope that helps.

rday

-- 

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

        Top-notch, inexpensive online Linux/OSS/kernel courses
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux