Re: My $0.02 on devd and devfs

Oliver Xymoron (oxymoron@waste.org)
Mon, 11 Oct 1999 11:39:29 -0500 (CDT)


On 11 Oct 1999, H. Peter Anvin wrote:

> This is what I would like to see:
>
> * A device daemon, devd, which can add devices on demand. I was
> thinking of one which would receive data packets like the following:
>
> <stub_name, type, major, first_minor, count, naming_scheme>
>
> e.g.
>
> <"ttyS", char, 4, 64, 192, "serial">
>
> ... where "serial" would mean the daemon should find the iterator
> for this particular class in "/usr/lib/devd/serial.so".

You'll also want a file in proc that contains the current list of such
devices (similar to the current /proc/devices) in addition to your
notification scheme. The kernel keeps some state available internally,
might as well make it available. Devd can use this information to
bootstrap, rather than having it read a (possibly empty) notification
queue.

Notification could be accomplished by poll()ing the device list file but a
real device is probably preferable.

I don't like sending the node name (eg "ttyS") along, though. That should
be left to devd. Plus it means that this can't be made a simple hack on
register_{blk|char}dev. If devd doesn't know what to call it, it can call
it "unknown-serial-n".

--
 "Love the dolphins," she advised him. "Write by W.A.S.T.E.." 

- 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/