Page 1 of 1

Using serial port on docking station

Posted: Thu Feb 04, 2021 8:23 am
by wildptr
Hello fellow OS developers!

I'm trying to develop my OS for a real machine. The machine is a ThinkPad T400, which I'd like to connect to my dev machine via serial port for easier debugging. The ThinkPad does not have a serial port, but I have a docking station for it that does. However, even with the laptop in the docking station, the BIOS data area reports no available serial ports at all (I/O addresses for COM[1-4] are all 0) and indeed, serial loopback test on the usual address of COM1 (3F8h) fails. Also there is nothing on the PCI bus that resembles a serial port.

The serial port on the docking station works perfectly well on Windows XP out of the box. Now I have totally no idea how to get this port working. I can tell from Windows XP's Device Manager that the port is apparantly connected to the LPC interface of the ICH9. I've glanced through the datasheets but could not find out why it doesn't work.

Any ideas?

Re: Using serial port on docking station

Posted: Thu Feb 04, 2021 8:33 pm
by Octocontrabass
Windows probably uses ACPI to handle dynamically allocating resources for the serial port when it's attached to the LPC bus.

If you don't want to use ACPI, you could mess with the LPC controller's PCI configuration registers (documented in the ICH9 datasheet) to enable the serial port address decoding, but there's no guarantee the dock will respond without additional configuration.

Re: Using serial port on docking station

Posted: Thu Feb 04, 2021 8:49 pm
by eekee
Huh! I've been recommending old laptops with docking stations, but if they're like this, maybe I shouldn't. I've been happily using an X61 which is a lot older than a T400.

Re: Using serial port on docking station

Posted: Thu Feb 04, 2021 9:10 pm
by xeyes
eekee wrote:Huh! I've been recommending old laptops with docking stations, but if they're like this, maybe I shouldn't. I've been happily using an X61 which is a lot older than a T400.
X6 ultrabase? Many modern 1 liter desktops still have native serial ports, like M75n iot.

Not sure whether it works with simple inb/outb though, can't find a serial to usb adapter now.

Maybe it is case by case and some are connected to the CPU in overly complicated ways :(

Re: Using serial port on docking station

Posted: Thu Feb 04, 2021 10:11 pm
by wildptr
Octocontrabass wrote:If you don't want to use ACPI, you could mess with the LPC controller's PCI configuration registers (documented in the ICH9 datasheet) to enable the serial port address decoding, but there's no guarantee the dock will respond without additional configuration.
Sadly, a quick examination of the relevant configuration registers shows that the ICH9 is already decoding I/O address 3F8h-3FFh. The device just isn't there for some reason. I'll take a look into the system's ACPI tables to figure out how to enable the serial port.

Re: Using serial port on docking station

Posted: Fri Feb 05, 2021 1:58 am
by wildptr
I just found out that the serial port was disabled in BIOS. Stupid me. :oops:

Enabled it and everything is fine now.

Re: Using serial port on docking station

Posted: Fri Feb 05, 2021 8:03 am
by eekee
That's a relief! :D