Re: New driver development

Matti Aarnio (matti.aarnio@sonera.fi)
Thu, 25 Mar 1999 17:16:30 +0200 (EET)


> Hello all.
>
> I'm writing a Linux driver for the new Octoport multiport (4/8) rs232 PCI
> board (saled by Computer Modules, Inc. http://www.compumodules.com/).
> Computer Modules SUPPORTS this work (providing me all necessary resources),
> and maybe it will support moreother in the future.
>
> At this moment, the driver development is at the initial phase (board
> detection and configuration), but I believe a major number for the
> associated devices is needed. Do I have to ask Peter Anvin <hpa@zytor.com>
> (maintainer of /usr/src/linux/Documentation/devices.txt)?

Not necessarily. You can fairly easily do dynamic major
number assignment, and then use a tool which does essentially:

MAJOR=`cat /proc/devices | grep YourDeviceName | cut -c-4`
for MINOR in 0 1 2 3 4 5 6 7 8 9 ...
do
mknod -m 0600 /dev/octo$MINOR c $MAJOR $MINOR
done

That's all.
(Or you can support the devfs subsystem by Richard Goosh (sp?)
and use its registration functions to get all device entries
automagically.)

Of course, while /dev/ directory is persistent storage (except
with devfs), dynamically assigned major number for a dynamically
loaded module might not be the same every time..

> I hope this work can be useful for various users and goals.
> My best regards, Massimo

/Matti Aarnio <matti.aarnio@sonera.fi>

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