Enable bochs terminal output.

This commit is contained in:
Drew Galbraith 2025-05-06 22:26:00 -07:00
parent 5a20c23569
commit 0dfa6008ec
3 changed files with 8 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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) {