Serial terminal issues

Alban Hertroys haramrae at gmail.com
Wed Jun 5 19:30:02 UTC 2013


On Jun 5, 2013, at 2:59, Jeremy Chadwick <jdc at koitsu.org> wrote:

> On Tue, Jun 04, 2013 at 11:32:48PM +0200, Alban Hertroys wrote:
>> I can't seem to get my serial terminal to work with my new system.
>> 
>> I had a serial terminal connected to my old system that worked great
>> and copied /boot.config, /boot/loader.conf and /etc/ttys settings over
>> from it.
>> 
>> The new system has a Gigabyte GA970A-UD3 board with just a serial
>> header on the board. I bought a serial connector backplate in an
>> electronics store and connected it to the board. Could the pinout be
>> different or something?
> 
> It is very possible.  You should have asked Gigabyte what exact product
> (specifically part number) to purchase that provided a
> header-to-backplane DB9 port, or if they could send you one (many will
> for free).  Always use what the mainboard vendor tells you.  Always.

I contacted Gigabyte, but haven't heard from them yet.

For the Dutch readers: their website is at gigabyte.co.nl. You absolutely don't want to go to gigabyte.nl - not safe for work, not at all (guess where I was…).

> It's also very possible the cable you're using to connect from the
> Gigabyte board to something (you didn't disclose what) is wired wrong.

I doubt that. It has worked fine before in the same setup with the previous PC and only stopped working once I connected it to the new PC. The new PC is the only variable, I expect that's where the problem is.

The other end of the serial cable is connected to a Bull serial terminal (TWSH004/A). The cable has been that same serial cable for the last 10 years or so.

>>> cat /boot.config 
>> -D -S19200
> 
> Please try using "-S19200 -Dh" (please read carefully).  The order of
> the arguments may matter as well (there has been some speculation on the
> lists about this, and I do not care to do the analysis; just passing
> information on blindly).

That's interesting, I didn't expect that. I'll test that when I get around to playing with the serial port again.
That said, these settings worked in the old PC. I copied boot.config straight over from my backups.

>>> cat /boot/loader.conf 
>> boot_multicons="YES"
>> boot_serial="YES"
>> comconsole_speed="19200"
>> console="comconsole,vidconsole"
> 
> You do not need any of this given what /boot.config contains.  Please
> remove it all.

Good to know, I never liked having this information in duplicate.

>>> From /var/log/messages:
>> Jun  4 21:28:50 solfertje kernel: uart0: <16550 or compatible> port 0x3f8-0x3ff irq 
>> 4 flags 0x10 on acpi0
>> Jun  4 21:28:50 solfertje kernel: uart0: console (19200,n,8,1)
>> Jun  4 21:28:50 solfertje kernel: orm0: <ISA Option ROMs> at iomem 0xd5000-0xd67ff,0xd7000-0xd7fff on isa0
>> Jun  4 21:28:50 solfertje kernel: sc0: <System console> at flags 0x100 on isa0
>> Jun  4 21:28:50 solfertje kernel: sc0: VGA <16 virtual consoles, flags=0x300>
>> Jun  4 21:28:50 solfertje kernel: vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
>> Jun  4 21:28:50 solfertje kernel: atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
>> Jun  4 21:28:50 solfertje kernel: atkbd0: <AT Keyboard> irq 1 on atkbdc0
>> Jun  4 21:28:50 solfertje kernel: kbd0 at atkbd0
>> Jun  4 21:28:50 solfertje kernel: atkbd0: [GIANT-LOCKED]
> 
> Okay, so what's the problem?  You're not seeing any I/O on the serial
> port?

I get a blank screen with just a cursor. It's not blinking because blinking cursors get on my nerves.

Whether that means no I/O at all or the wrong kind of I/O I can't tell. I haven't set up a terminal like this in 10 years as the previous setup always just worked once set up. It's quite possible that I forgot some important detail.

> How do you have your serial device connected to something on the
> other end?  Meaning: solfertje has a serial port, and it's connected to
> what exactly?

The Bull terminal mentioned above.

> Are you sure the device its connected to is working?

Well, it was still working great a few days ago before I replaced the PC it was connected to, so I assume it still does.

(snipped useful information that doesn't apply to my case as my cable has proven to be correct)

> 
>> I didn't see any options in the BIOS to set the console speed (just
>> address and IRQ, those are in the above). ISTR that my old mobo did
>> allow to set that information, but then again, that board (Tyan Tiger)
>> gave me access to the BIOS through the serial console.
> 
> This has absolutely no relevancy.

I thought as much, but it is one obvious difference between the old and new situation...

> Serial port speed settings in a BIOS pertain to BIOS-level console
> redirection -- that redirection is lost the instant anything (boot
> loader, kernel, etc.) touches SMI and/or interrupts and starts
> "fiddling" with the serial port.

That's the bit I wasn't entirely certain of - that there is no possible interaction from having a BIOS console to the point where the OS takes over. That's why I mentioned it.

I assumed that if the BIOS had set up the serial port to 19200 baud and the OS didn't specify it, that it would be possible that the speed set up in the BIOS would still be in effect and that the serial terminal just incidentally worked for the last 10 years because of that. Far-fetched, I know.

That's another theory shot down.

> What you're adjusting in FreeBSD is 1) the FreeBSD boot loader touching
> the serial port, and 2) the FreeBSD kernel outputting to a serial port
> (it also initialises/sets the serial port), and 3) getty et al spawning
> a login prompt on the serial port.

Regarding 2). I found some references on the internet pertaining settings in the kernel config file to adjust serial console settings. Could that be what I'm missing?

I'm fairly certain the last kernel I used on the old PC was the GENERIC i386 kernel. I don't think there are any significant differences regarding serial console between STABLE-i386 (of a few months ago) and STABLE-amd64?

> I would point you to my "FreeBSD via serial console and PXE" document,
> except there are one-offs specific to the PXE portions that are not
> relevant to your situation.  The important part is that I've used
> FreeBSD serial console for almost 16 years and have a very good
> understanding of what works (including vs. what some developers say
> "should" work; i.e. reality vs. pragmatism).


True, but there's relatively much interaction between the different parts that you need to get right before a serial console works at all. Such as having everything on the same baud-rate, for an obvious example.

My guess is that the problem is indeed the connection from the motherboard header to the bracket on the case. I'll verify the cabling of that part sometime this weekend.

Thanks for the help so far.

Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.



More information about the freebsd-stable mailing list