Subject: Re: serial console bug report: port-i386/9236
To: None <port-i386@netbsd.org>
From: amaya <amaya@idiom.com>
List: port-i386
Date: 06/10/2000 18:55:01
>As a side note the bios will also screw up port
>assignments if you skip a port.  That is if you have
>(using DOS names) COM1, COM2, and COM4 the BIOS will
>read f8 03 f8 02 e8 02 00 00 instead of 
>f8 03 f8 02 00 00 e8 02.  In the DOS/Win3.1 days this
>would show up as COM1, COM2, COM3 with COM3 having
>COM4's port address which confused many programs.  I
>don't know what NetBSD does with that, but I do
>remember that Win3.1 got confused by this and the fix
>then was to run a debug script in the autoexec that
>put in the right information at location 40:0

>I think the best way to fix this is to do essentially
>the same thing, only in this case you patch the kernel
>to fix the info, and write tiny applet that will patch
>the kernel with the correct code sequence (based on a
>/etc/bioscom or some such).

>The basic problem is that for most boards the bios 
>cannot be in any way trusted when it comes to serial
>ports.


	Actually we do the same re-assignment of serial port addresses in
our embedded system PC BIOS's (and have for at least 12 years) It really
wasn't stupidity or an error, just compatibility with the way DOS looks at
things...
	We always assumed that those programs that used hardwired port
addresses (PROCOMM etc) were the broken ones since BIOs and DOS always use
logical device names (COM1 could be anywhere), not physical device
names...

	We also remove the first serial port from the port table if we
use the port for console (we have an option to use the first serial port
as console if there is no video card in the system.) We removed the
port from the list because it was no longer available as a DOS device, 
and to prevent collisions with DOS utilities and serial console.
	LPT ports are handled the same way by the BIOS (and DOS), so that
if you have a single LPT port, regardless of whether its address is 0x3bc,
0x378 or 0x278, its still the first entry in the LPT port table and its
still LPT1...

	That being said, we'll probably add a 
Dont_remove_console_from_port_table option in our EEPROM setup to avoid 
the problem but not screw our existing customers...


Peter Wallace