I may regret getting into this, but here goes.
I had to write a modular device driver recently, and wanted to have
access to lots of minor numbers but without getting my own major
number allocation. I couldn't expect "customers" to start using devfs,
so that was out.
What I did was this:
-- Do dynamic major allocation in the usual way.
-- Report the allocation (and other stuff) via /proc.
-- The startup script run by init uses the information in /proc
to create the appropriate inodes.
Now this may seem, er... hacky, but I actually think it achieves the
rather sensible aims of devfs without the pain. The string lookup
mechanisms are now just part of normal filesystem operation, and it's
completely dynamic so pretty well future proofed.
It's not the right choice for the more important drivers in the
kernel, but for purely modular drivers (those which really do need to
be in kernel space), I think it makes a wad of sense. What do the
other protagonists feel?
Cheers,
Matt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/