diff --git a/Jamrules b/Jamrules index 1c4d31ef8a..8555b3b3cb 100644 --- a/Jamrules +++ b/Jamrules @@ -89,8 +89,7 @@ if $(DEBUG) { KERNEL_CCFLAGS ?= "-Wall -Wno-multichar -Wmissing-prototypes -finline -nostdinc" ; KERNEL_CCFLAGS += "-fno-builtin -D$(OBOS_TARGET_DEFINE) " ; -KERNEL_CCFLAGS += "-DBOCHS_E9_HACK=$(BOCHS_E9_HACK) " ; -KERNEL_CCFLAGS += "-DBOCHS_INPUT_HACK=$(BOCHS_INPUT_HACK) " ; +KERNEL_CCFLAGS += "-DBOCHS_DEBUG_HACK=$(BOCHS_DEBUG_HACK) " ; # Instructs the Library rule to not make its object files temporary. # This is need as some objects are used in a static library and for an diff --git a/configure b/configure index 33a7dd97dc..f5aa0f13df 100755 --- a/configure +++ b/configure @@ -89,7 +89,6 @@ cat << EOF > BuildConfig FLOPPY_PATH ?= "$floppy" ; GCC_PATH ?= ${GCC_PATH} ; -BOCHS_E9_HACK ?= $bochs_debug ; -BOCHS_INPUT_HACK ?= $bochs_debug ; +BOCHS_DEBUG_HACK ?= $bochs_debug ; EOF diff --git a/src/kernel/core/arch/x86/arch_dbg_console.c b/src/kernel/core/arch/x86/arch_dbg_console.c index 228b79bc2b..61c7e99bf5 100755 --- a/src/kernel/core/arch/x86/arch_dbg_console.c +++ b/src/kernel/core/arch/x86/arch_dbg_console.c @@ -15,8 +15,11 @@ #include -//#define BOCHS_E9_HACK 0 -//#define BOCHS_INPUT_HACK 0 +/* define this only if not used as compile parameter + * setting it to one will disable serial debug and + * redirect it to Bochs + */ +// #define BOCHS_DEBUG_HACK 0 // Select between COM1 and COM2 for debug output #define USE_COM1 1 @@ -44,8 +47,10 @@ int arch_dbg_con_init(kernel_args *ka) char arch_dbg_con_read(void) { -#if BOCHS_INPUT_HACK - // stolen from nujeffos +#if BOCHS_DEBUG_HACK + /* polling the keyboard, similar to code in keyboard + * driver, but without using an interrupt + */ static const char unshifted_keymap[128] = { 0, 27, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', 8, '\t', 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n', 0, 'a', 's', @@ -99,9 +104,10 @@ char arch_dbg_con_read(void) static void _arch_dbg_con_putch(const char c) { -#if BOCHS_E9_HACK +#if BOCHS_DEBUG_HACK out8(c, 0xe9); -#else + return; +#endif #if USE_COM1 while ((in8(0x3fd) & 0x20) == 0) @@ -112,8 +118,6 @@ static void _arch_dbg_con_putch(const char c) ; out8(c, 0x2f8); #endif - -#endif } char arch_dbg_con_putch(const char c)