[ipxe-devel] Handling SERIAL_CONSOLE for non-existent UARTs

Steve Goodrich steve.goodrich at se-eng.com
Thu Sep 27 16:50:30 UTC 2012

I need to catch output on the serial console, but there isn't actually a serial port attached (we're using a hardware debugger to do this).  We can catch the output simply by watching what's written to 0x3F8, but reading from the non-existent UART returns 0xFF.  Thus, the LSR and the data register are both reading 0xFF.  With the current implementation, this gets translated to "there's data available" and "the data byte is 0x7F".  If the LSR has every bit set (including every error bit), I suggest that this indicates that the UART is not present and thus there is no data available.  Also, if both the LSR and Data Register return 0xFF (indicating that the UART is not present), the patch modifies the return value to 0 instead of Delete -- since the serial console's "delete" was wiping out any characters I entered from the keyboard.

I hope this makes sense... if not, ask!
     -- Steve G.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Handle-serial-reads-from-a-non-existent-port.patch
Type: text/x-patch
Size: 1644 bytes
Desc: not available
URL: <http://lists.ipxe.org/pipermail/ipxe-devel/attachments/20120927/05e533bc/attachment.bin>

More information about the ipxe-devel mailing list