Subject: Re: Boot console (depend. of keyboard)
To: Diego Linke - GAMK <linke@calnet.com.br>
From: Harry Waddell <waddell@caravan.com>
List: netbsd-help
Date: 11/29/2002 18:01:32
On Fri, 29 Nov 2002 20:22:36 -0200
Diego Linke - GAMK <linke@calnet.com.br> wrote:

> Hi,
> 
> I need to make one boot console depending if the keyboard present or no.
> 
> In FreeBSD:
> /boot.config: -P
> 
> If The keyboard present boot internal.
> If the keyboard not present boot console (COM1)
> 
> This is possible on NetBSD (i386 of course) ?
> 
> Thanks

look at man boot_console(8). You'll want to build some boot blocks using
policy CONSDEV_AUTO. This won't do exactly what you want, but I think it's
close enough. It should look for a terminal on the available serial ports and
then if those fail use the keyboard. To build the necessary boot blocks, you
can modify the code in /usr/src/sys/arch/i386/stand/biosboot. 

If you like downloading compiled code from complete strangers, I've already
created these blocks for my own use by adding 

..if (${BASE} == "biosboot_ser")
CPPFLAGS+= -DSUPPORT_SERIAL=CONSDEV_AUTO -DDIRECT_SERIAL
..endif

to /usr/src/sys/arch/i386/stand/biosboot/Makefile

MD5 (biosboot_ser.sym) = 99fbe97e219e6068c24159160e8dfab9
http://www.caravan.com/biosboot_ser.sym

Make sure you keep a boot floppy or cd handy in case everything goes
tragically wrong. Use /usr/mdec/installboot to add the new boot blocks to
your root fs.

-- 
Harry Waddell
Caravan Electronic Publishing