Accessing Serial Port (0x2F8) on modern hardware

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
papst
Posts: 12
Joined: Fri Oct 21, 2022 3:41 pm

Accessing Serial Port (0x2F8) on modern hardware

Post by papst »

I'm debugging a type-1 hypervisor that's showing undefined behavior. Without a proper kernel debugger on this system, I've been printing internal state to the serial port at 0x2F8 and piping that through VMware. However, VMware's nested virtualization has limitations, and I need to test the hypervisor on actual hardware.

My test motherboard is a Gigabyte B550 AORUS ELITE V2, which has no built-in serial ports, making debugging difficult.

Is there any way to “redirect” or emulate serial output through a USB port?

Regards
MichaelPetch
Member
Member
Posts: 857
Joined: Fri Aug 26, 2016 1:41 pm
Libera.chat IRC: mpetch

Re: Accessing Serial Port (0x2F8) on modern hardware

Post by MichaelPetch »

I don't believe it is possible on real hardware via USB dongles as you generally need a USB stack and then a USB serial driver. I'm not sure about your real hardware but if it has PCI slots you can still find some PCI cards that can still present themselves as legacy interrupts and on legacy ports.
User avatar
bellezzasolo
Member
Member
Posts: 163
Joined: Sun Feb 20, 2011 2:01 pm

Re: Accessing Serial Port (0x2F8) on modern hardware

Post by bellezzasolo »

MichaelPetch wrote: Sat Nov 29, 2025 8:07 pm I don't believe it is possible on real hardware via USB dongles as you generally need a USB stack and then a USB serial driver. I'm not sure about your real hardware but if it has PCI slots you can still find some PCI cards that can still present themselves as legacy interrupts and on legacy ports.
i think PCIe is possible too. Something like the PEX1S1P952 advertises compatibility with Windows 95. It is guesswork that that means ISA ports, though.
Whoever said you can't do OS development on Windows?
https://github.com/ChaiSoft/ChaiOS
Octocontrabass
Member
Member
Posts: 6245
Joined: Mon Mar 25, 2013 7:01 pm

Re: Accessing Serial Port (0x2F8) on modern hardware

Post by Octocontrabass »

PCI(e) serial port cards won't use the legacy I/O ports or IRQs. They're also not standardized, but most are vaguely descended from the 8250 UART, so it won't be too difficult to adapt a legacy serial port driver if your hypervisor can prevent the guest from messing with it.

Linux recognizes an enormous list of PCI(e) serial port cards, including lots of device-specific quirks. If you're having trouble getting your card to work, you should see if Linux does anything special with it.
Post Reply