From: Kevin O'Connor Date: Wed, 15 Jan 2014 18:34:19 +0000 (-0500) Subject: debug: Add runtime option to not report the debug serial port to the OS. X-Git-Tag: rel-1.7.5-rc1~72 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=cf85418f7825a2a6712f8feb0ab7e37c55323eb3;p=seabios.git debug: Add runtime option to not report the debug serial port to the OS. DOS resets the serial ports reported by the BIOS. This can mess up debugging and timing when the serial baud rate changes on the debug port. The new "etc/advertise-serial-debug-port" option allows one to suppress the debug serial port from the normal list of serial ports the BIOS reports to DOS. Signed-off-by: Kevin O'Connor --- diff --git a/src/serial.c b/src/serial.c index 9b6d29f..00c6eb7 100644 --- a/src/serial.c +++ b/src/serial.c @@ -9,6 +9,7 @@ #include "bregs.h" // struct bregs #include "hw/serialio.h" // SEROFF_IER #include "output.h" // debug_enter +#include "romfile.h" // romfile_loadint #include "stacks.h" // yield #include "util.h" // serial_setup @@ -20,6 +21,9 @@ static u16 detect_serial(u16 port, u8 timeout, u8 count) { + if (CONFIG_DEBUG_SERIAL && port == CONFIG_DEBUG_SERIAL_PORT + && !romfile_loadint("etc/advertise-serial-debug-port", 1)) + return 0; outb(0x02, port+SEROFF_IER); u8 ier = inb(port+SEROFF_IER); if (ier != 0x02)