Subject: Re: serial console questions
To: None <netbsd-users@netbsd.org>
From: Lubos Vrbka <shnek@tiscali.cz>
List: netbsd-users
Date: 02/14/2004 02:35:31
hi guys,

thank for your help. i would like to summarize things now - i'd like to have 
everything clear before starting the build/update process. and, of course, short 
summary could help people in the future :)
i don't know whether i got everything right, so if you find any mistakes, i'll 
be very grateful for your comments...

ok, so if i understand it well, i need to do the following:

1) recompile the kernel using
options        "CONSDEVNAME=\"com\"",CONADDR=0x3f8,CONSPEED=57600
#options        CONS_OVERRIDE

i.e. use serial port at port 0x3f8 (com0 - /dev/tty0) with communication speed 
57600 baud.
if i uncommented the CONS_OVERRIDE option, the console output would 
automatically go to port specified by CONSDEVNAME. i wouldn't have to recompile 
and reinstall bootloader, but i couldn't force the system to use local 
vga/keyboard without changing the kernel again.
when it is commented out it gives opportunity to change the console device 'on 
the fly', i.e. during the boot time.
btw, what connection speed should be used? kernel config has 57600 baud, manpage 
example 19200 baud.


2) recompile the bootloader if CONS_OVERRIDE is not set

i understand from what is written in boot_console(8) that console device and 
properties are saved in bootstrap by installboot.

i'll therefore need to edit the makefile. man suggests using
/sys/arch/i386/stand/biosboot/Makefile
but i found it in
/sys/arch/i386/stand/boot/biosboot/Makefile
(my system is -current 1.6zh) was there some change in -current, or is it just 
mistake in manpage? the Makefile in biosboot contains only one .include command 
to ../Makefile.boot. so should i modify Makefile in biosboot subdirectory, or 
directly the Makefile in boot directory?

the parameters should be set as

SUPPORT_SERIAL=CONSDEV_AUTO
bootloader should then probe all serial ports and use succesfully probed device 
as a console. when does the probe success? when there's a serial cable 
connecting both computers? has the communication program (cu, tip) to run on the 
other computer?
or should i better use
SUPPORT_SERIAL=CONSDEV_COM0KBD
to suppress serial port connection detection that is performed when CONSDEV_AUTO 
is selected? except this little "feature", both keywords have identical 
behaviour, right?

do you recommend using COMCONS_KEYPRESS? if yes, would i have to start the 'cu' 
on the "console" machine before starting my computer and during the boot send 
some key through the serial line?

what about DIRECT_SERIAL and CONSPEED keywords? should i use them? i expect 
yes, as there is CONSPEED set in the kernel config and also expect both CONSPEED 
variables to have the same value. but i don't understand the hardware/handshake 
stuff, so i may be wrong...

Makefile.boot specifies values for these parameters as e.g. 
CPPFLAGS+=-DSUPPORT_SERIAL=boot_params.bp_consdev
where are these values defined? i could write the values directly to the 
makefile, but i think i could have some problems during the next CVS update. is 
there some more "general" and clever way how to specify these values?


3) install new bootloader

i expect that the make process will result in file /usr/mdec/boot. i also expect 
that the change of serial console device affects only the secondary bootblock - 
am i wrong? according to installboot(8), copying this file over the /boot file 
should be sufficient on i386 (... the following platforms do not require this 
step if the primary bootstrap already exists and the secondary bootstrap file is 
just being updated: ... i386, ...).
so is it necessary to run also
installboot -v -o timeout=5 /dev/rwd0a /usr/mdec/bootxx_ffsv1 ?
btw, 4.2BSD is ffs version 1 or 2? i'm not sure...

thank you very much for your help, advices and comments. i really appreciate it.

regards,

-- 
Lubos
_@_"