Subject: Re: Serial port strangeness?
To: John Klos <john@ziaspace.com>
From: Steven M. Bellovin <smb@cs.columbia.edu>
List: port-i386
Date: 07/20/2007 13:59:16
On Fri, 20 Jul 2007 17:46:03 +0000 (UTC)
John Klos <john@ziaspace.com> wrote:

> Hello,
> 
> On a rather generic ECS motherboard with an AMD processor (64 bit
> capable, but I'm running i386), I'm seeing strange port
> configurations. This is with NetBSD-4 from yesterday:
> 
> com3 at acpi0 (PNP0501-1)
> com3: io 0x3f8-0x3ff irq 4
> com3: ns16550a, working fifo
> lpt3 at acpi0 (PNP0401-1)
> lpt3: io 0x378-0x37f,0x778-0x77b irq 7 drq 3
> 
> There are no other com or lpt ports.
> 
> Normally, I wouldn't care what the "com" number is, because it always
> starts at tty00. However, I can't use tty00 - my serial port shows up
> as tty03. 0x3f8 has always been the first com port...
> 
> Is this a bug? An accident? A "feature"?
> 
It's because of ACPI.

If you look at the config file -- I'm looking at 4.0's GENERIC, you'll
see this:

com0    at isa? port 0x3f8 irq 4        # Standard PC serial ports
com1    at isa? port 0x2f8 irq 3
com2    at isa? port 0x3e8 irq 5

In other words, com[012] are supposed to be on the ISA bus.  Your com
port was found on the ACPI "bus" and recognized by this line:

com*            at acpi?                # Serial communications

It can't be 0, 1, or 2, since those are ISA...

The easiest thing to do is to live with it and use tty03.  If you
really want tty00, build a kernel without those com ports hard-wired in.



		--Steve Bellovin, http://www.cs.columbia.edu/~smb