Jonathan Boeing
2015-Feb-08 17:39 UTC
[syslinux] [PATCH 0/1] dprintf: add debug console support
On Sun, 8 Feb 2015 17:41:58 +0100 Geert Stappers via Syslinux <syslinux at zytor.com> wrote:> On Sun, Feb 08, 2015 at 09:13:02AM -0700, Jonathan Boeing via > Syslinux wrote: > > This patch adds support for printing messages through a debug > > console. QEMU, for example, supports this through the debugcon > > facility. The benefit is that it's *much* faster than printing > > over a serial port. > > > > To print to I/O port 0x402 (the default used by SeaBIOS and OVMF), > > add "-DDEBUG_IO_PORT=0x402 -DCORE_DEBUG=1" to the build CFLAGS. > > > > To enable a debug console in QEMU that listens to I/O port 0x402 > > and prints to stdio, add "-debugcon stdio -global > > isa-debugcon.iobase=0x402" to the QEMU command line. > > > When enabled, what will the effect on real hardware without the > diagnostic hardware ? > > When enabled, what will the effect on real hardware ? > > What (real) diagnostic hardware is adviced? >This doesn't support real hardware[1]; it's a VM-only thing. If run on real hardware, it shouldn't have any effect[2] as long as it's writing to an unused I/O port. Port 0x402 seems to be unused (based on some google searching) outside of debug consoles. Bochs has a list at http://bochs.sourceforge.net/techspec/PORTS.LST that shows it's in the EISA range, but not specifically used. So, it should be safe on real hardware, but I'd recommend it only for testing and development on a VM. Also, syslinux works correctly if it's enabled and run on a VM without a debug console. The writes are just silently discarded. [1] Specialized (read expensive) CPU debugging hardware could capture these writes. I'm not sure if Intel System Studio can capture them, but it's still $2399 for the JTAG-equipped version. [2] It's CPU implementation specific, but it shouldn't have any visible effect. Regards, Jonathan Boeing
Patrick Masotta
2015-Feb-08 19:37 UTC
[syslinux] [PATCH 0/1] dprintf: add debug console support
> This > doesn't support real hardware[1]; it's a VM-only > thing.Can't you just use a pipe? I debug on VMWare VMs with com2 redirected to a pipe that then connects to a regular terminal; it's pretty fast. Best, Patrick
Jonathan Boeing
2015-Feb-08 20:29 UTC
[syslinux] [PATCH 0/1] dprintf: add debug console support
On Sun, 8 Feb 2015 11:37:34 -0800 Patrick Masotta <masottaus at yahoo.com> wrote:> > > > This > > doesn't support real hardware[1]; it's a VM-only > > thing. > > Can't you just use a pipe? > I debug on VMWare VMs with com2 redirected to a pipe that > then connects to a regular terminal; it's pretty fast.I started out with serial redirection through QEMU, and it was pretty slow (as in, count the lines scrolling past slow). But I ran it again to compare and the serial redirection was maybe just a little slower than the debug console. Not sure what I did wrong the first time, but speed-wise the two methods are pretty close. One other benefit of the debug console is that it makes it dead simple to get interleaved output from multiple debug targets. In my case, I'm getting the messages from OVMF and syslinux. It looks possible to muck around with OVMF to get it to print over serial, but then you have to worry about everyone playing nicely with the shared port. So, redirected serial output would probably work, but the debug console makes some use cases cleaner and simpler. Regards, Jonathan Boeing