diff --git a/.bochsrc b/.bochsrc index 1757d33..2e7d283 100644 --- a/.bochsrc +++ b/.bochsrc @@ -10,3 +10,4 @@ log: bochs.log romimage: file=/home/drew/opt/bochs/share/bochs/BIOS-bochs-latest vgaromimage: file=/home/drew/opt/bochs/share/bochs/VGABIOS-lgpl-latest.bin vga: extension=vbe +port_e9_hack: enabled=1 diff --git a/scripts/bochs.sh b/scripts/bochs.sh index 9a0d982..be2c781 100755 --- a/scripts/bochs.sh +++ b/scripts/bochs.sh @@ -15,5 +15,5 @@ if [[ $1 == "debug" ]]; then fi # TODO Make this portable, build bochs as a part of toolchain? -~/opt/bochs/bin/bochs +~/opt/bochs/bin/bochs $BOCHS_ARGS -q diff --git a/zion/debug/debug.cpp b/zion/debug/debug.cpp index 096443a..7d10174 100644 --- a/zion/debug/debug.cpp +++ b/zion/debug/debug.cpp @@ -5,14 +5,18 @@ #define COM1 0x3f8 +#define BOCHS_DBG 1 + namespace { bool is_transmit_empty() { return (inb(COM1 + 5) & 0x20) != 0; } void dbgputchar(char c) { - while (!is_transmit_empty()) - ; + while (!is_transmit_empty()); outb(COM1, c); +#if BOCHS_DBG + outb(0xe9, c); +#endif } void dbg(const glcr::StringView& str) {