Port-arm archive

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

Re: UART question



Vincent DEFERT <vincent.defert%posteo.net@localhost> writes:

> Just tried it and no luck, it recreates the same zoo as before.
>
> Anyway, I would really like to learn the rules of the device game.
> And if possible, the reasons behind them.
>


Others may add additional details, but it works more or less like this
in NetBSD:


o There isn't any automatic device node creation for /dev, except for
mount_fdesc(8), which can be used to get you a /dev/fd tree.  The other
exception that I know of is some functions of LVM and ZFS.  Both of
those can create new nodes under /dev/mapper for LVM and /dev/zvol for
ZFS.  However, the device nodes for LVM and ZFS are still hard created
in /dev and just managed from the various lvm and zfs userland commands
behind the scenes.

o There is a devpubd(8) daemon that listens for new devices that might
appear after boot.  A lot of people get a lot of millage out of this,
from what I have read on the lists, but I don't personally use it.  It
might not catch just every device, but should work for USB, at the very
least.


So..  the only thing that is really official is MAKEDEV.  This is a
shell script that is generated when the system is built and has the
major node numbers filled in when built.  The suggestion of moving
/dev/MAKEDEV to /etc legerages code in init(8) that will run either "(cd
/dev;./MAKEDEV -MM init)" or "/etc/MAKEDEV -MM init" in a memory
filesystem to create a /dev device tree.  The trigger for doing this is
the lack of a /dev/console, I believe.

So, except for /dev/fd and some parts of LVM and ZFS, you get the zoo
because that is mostly what MAKEDEV does.


Please also note that the zoo is not "clean" in a lot of ways.  While it
is true that a lot of the devices are simple in the sense that there is
a single device node per device, a lot of the devices are not simple and
the MAKEDEV script has the magic formulas in it to create all of the
required nodes in /dev for those devices.


I am not sure what the I2C reference is about.  I am not personally
familiar with any I2C that might automatically create a device node.





-- 
Brad Spencer - brad%anduin.eldar.org@localhost


Home | Main Index | Thread Index | Old Index