Browse Source

Also send console output to port 0xe9 (bochs console.)

This is very handy for debugging.
Andreas Kling 6 years ago
parent
commit
77821da42f
2 changed files with 8 additions and 1 deletions
  1. 1 1
      Kernel/.bochsrc
  2. 7 0
      Kernel/Console.cpp

+ 1 - 1
Kernel/.bochsrc

@@ -33,7 +33,7 @@ cpuid: mmx=true, apic=xapic, simd=sse2, sse4a=false, misaligned_sse=false, sep=t
 cpuid: movbe=false, adx=false, aes=false, sha=false, xsave=false, xsaveopt=false, smep=false
 cpuid: movbe=false, adx=false, aes=false, sha=false, xsave=false, xsaveopt=false, smep=false
 cpuid: smap=false, mwait=true
 cpuid: smap=false, mwait=true
 print_timestamps: enabled=0
 print_timestamps: enabled=0
-port_e9_hack: enabled=0
+port_e9_hack: enabled=1
 private_colormap: enabled=0
 private_colormap: enabled=0
 clock: sync=none, time0=local, rtc_sync=0
 clock: sync=none, time0=local, rtc_sync=0
 # no cmosimage
 # no cmosimage

+ 7 - 0
Kernel/Console.cpp

@@ -1,5 +1,9 @@
 #include "Console.h"
 #include "Console.h"
 #include "VGA.h"
 #include "VGA.h"
+#include "IO.h"
+
+// Bytes output to 0xE9 end up on the Bochs console. It's very handy.
+#define CONSOLE_OUT_TO_E9
 
 
 static Console* s_the;
 static Console* s_the;
 
 
@@ -27,6 +31,9 @@ ssize_t Console::read(byte* buffer, size_t bufferSize)
 
 
 void Console::putChar(char ch)
 void Console::putChar(char ch)
 {
 {
+#ifdef CONSOLE_OUT_TO_E9
+    IO::out8(0xe9, ch);
+#endif
     switch (ch) {
     switch (ch) {
     case '\n':
     case '\n':
         m_cursorColumn = 0;
         m_cursorColumn = 0;