[Still working backwards through my old email]
Jurgen Botz writes:
> Richard Gooch wrote:
> > I don't see why you can't just have devfsd load the module when you
> > attempt a lookup of /dev/ttyS.* or whatever. Then the existing rc
> > scripts which do:
> > # setserial /dev/ttyS0 ...
> > # setserial /dev/ttyS1 ...
> > # setserial /dev/ttyS2 ...
> > # setserial /dev/ttyS3 ...
>
> Richard, you're missing the point. We aren't talking about the
> system board serial ports, we're talking about additional serial
> ports on dumb ISA multiport cards. Devfs will not create the
> devices for these because the driver, whether module or compiled-in,
> doesn't know they exist until serserial is called! You can
> currently compile the serial driver with options to be able to
> handle these cards, but the actual configuration (whether, how
> many, what IRQ, etc.) is not compiled in and can't be auto-sensed.
>
> So like I said originally, there's a chicken-and-egg problem...
> devfs can't create the device because it doesn't know the port
> exists, and setserial can't tell the driver that the port exists
> because there is no device on which to do the ioctls that are
> used to pass this info to the kernel.
>
> The point is that because these boards can't be auto-sensed
> we need to pass info to the kernel about the ports. Prior to
> devfs using ioctls on the devices made the most sense. Now,
> with devfs, the devices don't exist until we've talked to the
> kernel. So we need to find another way to pass the info to
> the kernel. module options and kernel command line are not
> a good solution because it's too much info if there are a lot
> of ports.
OK, so in this (unhappy) case, what you can do is configure devfsd to
do mknod(2) and setserial(8) upon LOOKUP. A simple script will work.
Or, you can just do mknod(1) prior to setserial(8) in your boot
script.
Yet another approach is to configure devfsd to mknod(2) upon LOOKUP,
leaving the setserial(8) step to your boot scripts. A fairly clean
solution would be:
LOOKUP ^tts/.*$ MODLOAD
LOOKUP ^tts/.*$ EXECUTE /sbin/serial-helper $devpath
#! /bin/sh
# /sbin/serial-helper
if [ ! -f $1 ]; then
#minor= 64 + index (left as an exercise for the reader)
mknod $1 c 4 $minor
fi
exit 0
# End
Thus, the serial devices which are probed correctly by the driver need
no extra work, and the rest have their device nodes created.
Regards,
Richard....
Permanent: rgooch@xxxxxxxxxxxxx
Current: rgooch@xxxxxxxxxxxxxxx
|