unified Bochs debugging option
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1304 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -15,8 +15,11 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
//#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)
|
||||
|
||||
Reference in New Issue
Block a user