Enable bochs terminal output.
This commit is contained in:
parent
5a20c23569
commit
0dfa6008ec
1
.bochsrc
1
.bochsrc
|
@ -10,3 +10,4 @@ log: bochs.log
|
||||||
romimage: file=/home/drew/opt/bochs/share/bochs/BIOS-bochs-latest
|
romimage: file=/home/drew/opt/bochs/share/bochs/BIOS-bochs-latest
|
||||||
vgaromimage: file=/home/drew/opt/bochs/share/bochs/VGABIOS-lgpl-latest.bin
|
vgaromimage: file=/home/drew/opt/bochs/share/bochs/VGABIOS-lgpl-latest.bin
|
||||||
vga: extension=vbe
|
vga: extension=vbe
|
||||||
|
port_e9_hack: enabled=1
|
||||||
|
|
|
@ -15,5 +15,5 @@ if [[ $1 == "debug" ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# TODO Make this portable, build bochs as a part of toolchain?
|
# TODO Make this portable, build bochs as a part of toolchain?
|
||||||
~/opt/bochs/bin/bochs
|
~/opt/bochs/bin/bochs $BOCHS_ARGS -q
|
||||||
|
|
||||||
|
|
|
@ -5,14 +5,18 @@
|
||||||
|
|
||||||
#define COM1 0x3f8
|
#define COM1 0x3f8
|
||||||
|
|
||||||
|
#define BOCHS_DBG 1
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
bool is_transmit_empty() { return (inb(COM1 + 5) & 0x20) != 0; }
|
bool is_transmit_empty() { return (inb(COM1 + 5) & 0x20) != 0; }
|
||||||
|
|
||||||
void dbgputchar(char c) {
|
void dbgputchar(char c) {
|
||||||
while (!is_transmit_empty())
|
while (!is_transmit_empty());
|
||||||
;
|
|
||||||
|
|
||||||
outb(COM1, c);
|
outb(COM1, c);
|
||||||
|
#if BOCHS_DBG
|
||||||
|
outb(0xe9, c);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void dbg(const glcr::StringView& str) {
|
void dbg(const glcr::StringView& str) {
|
||||||
|
|
Loading…
Reference in New Issue