implement printd to silence printing of user unfriendly info (aka only
for developers); much less output now.
This commit is contained in:
parent
c77f5047ee
commit
0b3bc2d82a
@ -1,7 +1,7 @@
|
||||
$OpenBSD: patch-bxio_h,v 1.1 2001/02/02 16:59:06 todd Exp $
|
||||
--- bxio.h.orig Mon Oct 23 22:25:25 2000
|
||||
+++ bxio.h Tue Oct 31 13:13:50 2000
|
||||
@@ -0,0 +1,122 @@
|
||||
$OpenBSD: patch-bxio_h,v 1.2 2001/03/30 16:47:02 todd Exp $
|
||||
--- bxio.h.orig Fri Mar 30 09:30:20 2001
|
||||
+++ bxio.h Fri Mar 30 10:02:06 2001
|
||||
@@ -0,0 +1,124 @@
|
||||
+// Copyright (C) 2000 MandrakeSoft S.A.
|
||||
+//
|
||||
+// MandrakeSoft S.A.
|
||||
@ -96,6 +96,7 @@ $OpenBSD: patch-bxio_h,v 1.1 2001/02/02 16:59:06 todd Exp $
|
||||
+class bxio {
|
||||
+ void init_debug(void);
|
||||
+ void init(void);
|
||||
+ int debug;
|
||||
+public:
|
||||
+ bxio(int fd);
|
||||
+ bxio(char *fn);
|
||||
@ -108,6 +109,7 @@ $OpenBSD: patch-bxio_h,v 1.1 2001/02/02 16:59:06 todd Exp $
|
||||
+ void init_log(char *fn);
|
||||
+ void panic(char *fmt, ...);
|
||||
+ void printf(char *fmt, ...);
|
||||
+ void printd(char *fmt, ...);
|
||||
+ void atexit(void);
|
||||
+ bx_debug_t getdbg(void);
|
||||
+ void setdbg(bx_debug_t dbg);
|
||||
|
@ -1,12 +1,12 @@
|
||||
$OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
$OpenBSD: patch-cpu_proc_ctrl_cc,v 1.2 2001/03/30 16:47:02 todd Exp $
|
||||
--- cpu/proc_ctrl.cc.orig Sat Mar 25 21:39:09 2000
|
||||
+++ cpu/proc_ctrl.cc Thu Oct 19 17:34:18 2000
|
||||
+++ cpu/proc_ctrl.cc Fri Mar 30 10:09:57 2001
|
||||
@@ -35,7 +35,7 @@ BX_CPU_C::UndefinedOpcode(BxInstruction_
|
||||
if (i->b1 != 0x63) {
|
||||
// Windows hits the ARPL command a bunch of times.
|
||||
// Too much spew...
|
||||
- bx_printf("UndefinedOpcode: %02x causes exception 6\n",
|
||||
+ bio->printf("UndefinedOpcode: %02x causes exception 6\n",
|
||||
+ bio->printd("UndefinedOpcode: %02x causes exception 6\n",
|
||||
(unsigned) i->b1);
|
||||
}
|
||||
exception(BX_UD_EXCEPTION, 0, 0);
|
||||
@ -20,7 +20,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
if (CPL!=0) {
|
||||
- bx_printf("HLT(): CPL!=0\n");
|
||||
+ if(bio->getdbg().exceptions)
|
||||
+ bio->printf("[CPU%n] HLT(): CPL!=0\n",BX_SIM_ID);
|
||||
+ bio->printd("[CPU%n] HLT(): CPL!=0\n",BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
return;
|
||||
}
|
||||
@ -28,7 +28,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
if ( ! BX_CPU_THIS_PTR eflags.if_ ) {
|
||||
- fprintf(stderr, "WARNING: HLT instruction with IF=0!\n");
|
||||
- bx_printf("WARNING: HLT instruction with IF=0!\n");
|
||||
+ bio->printf("WARNING: HLT instruction with IF=0!\n");
|
||||
+ bio->printd("WARNING: HLT instruction with IF=0!\n");
|
||||
}
|
||||
|
||||
// stops instruction execution and places the processor in a
|
||||
@ -49,7 +49,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
// #GP(0) if CPL is not 0
|
||||
if (CPL!=0) {
|
||||
- bx_printf("CLTS(): CPL!=0\n");
|
||||
+ bio->printf("CLTS(): CPL!=0\n");
|
||||
+ bio->printd("CLTS(): CPL!=0\n");
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
return;
|
||||
}
|
||||
@ -60,9 +60,9 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
- bx_printf("---------------\n");
|
||||
- bx_printf("- INVD called -\n");
|
||||
- bx_printf("---------------\n");
|
||||
+ bio->printf("---------------\n");
|
||||
+ bio->printf("- INVD called -\n");
|
||||
+ bio->printf("---------------\n");
|
||||
+ bio->printd("---------------\n");
|
||||
+ bio->printd("- INVD called -\n");
|
||||
+ bio->printd("---------------\n");
|
||||
|
||||
#if BX_CPU_LEVEL >= 4
|
||||
invalidate_prefetch_q();
|
||||
@ -70,7 +70,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
if (BX_CPU_THIS_PTR cr0.pe) {
|
||||
if (CPL!=0) {
|
||||
- bx_printf("INVD: CPL!=0\n");
|
||||
+ bio->printf("INVD: CPL!=0\n");
|
||||
+ bio->printd("INVD: CPL!=0\n");
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
}
|
||||
}
|
||||
@ -79,7 +79,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
BX_CPU_C::WBINVD(BxInstruction_t *i)
|
||||
{
|
||||
- bx_printf("WBINVD: (ignoring)\n");
|
||||
+ bio->printf("WBINVD: (ignoring)\n");
|
||||
+ bio->printd("WBINVD: (ignoring)\n");
|
||||
|
||||
#if BX_CPU_LEVEL >= 4
|
||||
invalidate_prefetch_q();
|
||||
@ -87,7 +87,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
if (BX_CPU_THIS_PTR cr0.pe) {
|
||||
if (CPL!=0) {
|
||||
- bx_printf("WBINVD: CPL!=0\n");
|
||||
+ bio->printf("WBINVD: CPL!=0\n");
|
||||
+ bio->printd("WBINVD: CPL!=0\n");
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
}
|
||||
}
|
||||
@ -126,7 +126,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
- if (bx_dbg.dreg)
|
||||
- bx_printf("MOV_DdRd: DR[%u]=%08xh unhandled\n",
|
||||
+ if (bio->getdbg().dreg)
|
||||
+ bio->printf("MOV_DdRd: DR[%u]=%08xh unhandled\n",
|
||||
+ bio->printd("MOV_DdRd: DR[%u]=%08xh unhandled\n",
|
||||
(unsigned) i->nnn, (unsigned) val_32);
|
||||
|
||||
switch (i->nnn) {
|
||||
@ -135,7 +135,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
if ( (i->nnn == 4) && (BX_CPU_THIS_PTR cr4 & 0x00000008) ) {
|
||||
// Debug extensions on
|
||||
- bx_printf("MOV_DdRd: access to DR4 causes #UD\n");
|
||||
+ bio->printf("MOV_DdRd: access to DR4 causes #UD\n");
|
||||
+ bio->printd("MOV_DdRd: access to DR4 causes #UD\n");
|
||||
UndefinedOpcode(i);
|
||||
}
|
||||
#endif
|
||||
@ -144,7 +144,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
if ( (i->nnn == 5) && (BX_CPU_THIS_PTR cr4 & 0x00000008) ) {
|
||||
// Debug extensions (CR4.DE) on
|
||||
- bx_printf("MOV_DdRd: access to DR5 causes #UD\n");
|
||||
+ bio->printf("MOV_DdRd: access to DR5 causes #UD\n");
|
||||
+ bio->printd("MOV_DdRd: access to DR5 causes #UD\n");
|
||||
UndefinedOpcode(i);
|
||||
}
|
||||
#endif
|
||||
@ -202,7 +202,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
|
||||
if (v8086_mode()) {
|
||||
- bx_printf("MOV_RdDd: v8086 mode causes #GP\n");
|
||||
+ bio->printf("MOV_RdDd: v8086 mode causes #GP\n");
|
||||
+ bio->printd("MOV_RdDd: v8086 mode causes #GP\n");
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
}
|
||||
|
||||
@ -214,7 +214,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
|
||||
if (protected_mode() && (CPL!=0)) {
|
||||
- bx_printf("MOV_RdDd: CPL!=0 causes #GP\n");
|
||||
+ bio->printf("MOV_RdDd: CPL!=0 causes #GP\n");
|
||||
+ bio->printd("MOV_RdDd: CPL!=0 causes #GP\n");
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
return;
|
||||
}
|
||||
@ -222,7 +222,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
- if (bx_dbg.dreg)
|
||||
- bx_printf("MOV_RdDd: DR%u not implemented yet\n", i->nnn);
|
||||
+ if (bio->getdbg().dreg)
|
||||
+ bio->printf("MOV_RdDd: DR%u not implemented yet\n", i->nnn);
|
||||
+ bio->printd("MOV_RdDd: DR%u not implemented yet\n", i->nnn);
|
||||
|
||||
switch (i->nnn) {
|
||||
case 0: // DR0
|
||||
@ -231,7 +231,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
if ( (i->nnn == 4) && (BX_CPU_THIS_PTR cr4 & 0x00000008) ) {
|
||||
// Debug extensions on
|
||||
- bx_printf("MOV_RdDd: access to DR4 causes #UD\n");
|
||||
+ bio->printf("MOV_RdDd: access to DR4 causes #UD\n");
|
||||
+ bio->printd("MOV_RdDd: access to DR4 causes #UD\n");
|
||||
UndefinedOpcode(i);
|
||||
}
|
||||
#endif
|
||||
@ -240,7 +240,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
if ( (i->nnn == 5) && (BX_CPU_THIS_PTR cr4 & 0x00000008) ) {
|
||||
// Debug extensions on
|
||||
- bx_printf("MOV_RdDd: access to DR5 causes #UD\n");
|
||||
+ bio->printf("MOV_RdDd: access to DR5 causes #UD\n");
|
||||
+ bio->printd("MOV_RdDd: access to DR5 causes #UD\n");
|
||||
UndefinedOpcode(i);
|
||||
}
|
||||
#endif
|
||||
@ -269,7 +269,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
if ( protected_mode() ) {
|
||||
if ( CPL != 0 ) {
|
||||
- bx_printf("LMSW: CPL != 0, CPL=%u\n", (unsigned) CPL);
|
||||
+ bio->printf("LMSW: CPL != 0, CPL=%u\n", (unsigned) CPL);
|
||||
+ bio->printd("LMSW: CPL != 0, CPL=%u\n", (unsigned) CPL);
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
return;
|
||||
}
|
||||
@ -287,7 +287,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
// mov general register data to control register
|
||||
#if BX_CPU_LEVEL < 3
|
||||
- bx_panic("MOV_CdRd: not supported on < 386\n");
|
||||
+ bio->printf("MOV_CdRd: not supported on < 386\n");
|
||||
+ bio->printd("MOV_CdRd: not supported on < 386\n");
|
||||
+ exception(BX_GP_EXCEPTION, 0, 0);
|
||||
+ return;
|
||||
#else
|
||||
@ -305,7 +305,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
if (i->mod != 0xc0) {
|
||||
- bx_panic("MOV_CdRd(): rm field not a register!\n");
|
||||
- }
|
||||
+ bio->printf("MOV_CdRd(): rm field not a register!\n");
|
||||
+ bio->printd("MOV_CdRd(): rm field not a register!\n");
|
||||
+ exception(BX_GP_EXCEPTION, 0, 0);
|
||||
+ return;
|
||||
+ }
|
||||
@ -314,7 +314,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
|
||||
if (protected_mode() && CPL!=0) {
|
||||
- bx_panic("MOV_CdRd: CPL!=0\n");
|
||||
+ bio->printf("MOV_CdRd: CPL!=0\n");
|
||||
+ bio->printd("MOV_CdRd: CPL!=0\n");
|
||||
/* #GP(0) if CPL is not 0 */
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
return;
|
||||
@ -323,7 +323,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
switch (i->nnn) {
|
||||
case 0: // CR0 (MSW)
|
||||
- // bx_printf("MOV_CdRd:CR0: R32 = %08x\n @CS:EIP %04x:%04x ",
|
||||
+ // bio->printf("MOV_CdRd:CR0: R32 = %08x\n @CS:EIP %04x:%04x ",
|
||||
+ // bio->printd("MOV_CdRd:CR0: R32 = %08x\n @CS:EIP %04x:%04x ",
|
||||
// (unsigned) val_32,
|
||||
// (unsigned) BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].selector.value,
|
||||
// (unsigned) BX_CPU_THIS_PTR eip);
|
||||
@ -338,16 +338,16 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
- bx_printf("MOV_CdRd: CR2 not implemented yet\n");
|
||||
- if (bx_dbg.creg)
|
||||
- bx_printf("MOV_CdRd: CR2 = reg\n");
|
||||
+ bio->printf("MOV_CdRd: CR2 not implemented yet\n");
|
||||
+ bio->printd("MOV_CdRd: CR2 not implemented yet\n");
|
||||
+ if (bio->getdbg().creg)
|
||||
+ bio->printf("MOV_CdRd: CR2 = reg\n");
|
||||
+ bio->printd("MOV_CdRd: CR2 = reg\n");
|
||||
BX_CPU_THIS_PTR cr2 = val_32;
|
||||
break;
|
||||
case 3: // CR3
|
||||
- if (bx_dbg.creg)
|
||||
- bx_printf("MOV_CdRd:(%08x)\n", (unsigned) val_32);
|
||||
+ if (bio->getdbg().creg)
|
||||
+ bio->printf("MOV_CdRd:(%08x)\n", (unsigned) val_32);
|
||||
+ bio->printd("MOV_CdRd:(%08x)\n", (unsigned) val_32);
|
||||
// Reserved bits take on value of MOV instruction
|
||||
CR3_change(val_32);
|
||||
BX_INSTR_TLB_CNTRL(BX_INSTR_MOV_CR3, val_32);
|
||||
@ -356,7 +356,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
#if BX_CPU_LEVEL == 3
|
||||
- bx_panic("MOV_CdRd: write to CR4 of 0x%08x on 386\n",
|
||||
- val_32);
|
||||
+ bio->printf("[CPU%u] MOV_CdRd: write to CR4 of 0x%08x on 386\n",
|
||||
+ bio->printd("[CPU%u] MOV_CdRd: write to CR4 of 0x%08x on 386\n",
|
||||
+ BX_SIM_ID, val_32);
|
||||
UndefinedOpcode(i);
|
||||
#else
|
||||
@ -364,7 +364,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
// any reserved bit of CR4
|
||||
|
||||
- bx_printf("MOV_CdRd: ignoring write to CR4 of 0x%08x\n",
|
||||
+ bio->printf("MOV_CdRd: ignoring write to CR4 of 0x%08x\n",
|
||||
+ bio->printd("MOV_CdRd: ignoring write to CR4 of 0x%08x\n",
|
||||
val_32);
|
||||
- if (val_32) {
|
||||
- bx_panic("MOV_CdRd: (CR4) write of 0x%08x\n",
|
||||
@ -389,7 +389,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
// mov control register data to register
|
||||
#if BX_CPU_LEVEL < 3
|
||||
- bx_panic("MOV_RdCd: not supported on < 386\n");
|
||||
+ bio->printf("[CPU%u] MOV_RdCd: not supported on < 386\n",BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] MOV_RdCd: not supported on < 386\n",BX_SIM_ID);
|
||||
+ exception(BX_GP_EXCEPTION, 0, 0);
|
||||
+ return;
|
||||
#else
|
||||
@ -405,14 +405,14 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
|
||||
if (i->mod != 0xc0) {
|
||||
- bx_panic("MOV_RdCd(): rm field not a register!\n");
|
||||
+ bio->printf("MOV_RdCd(): rm field not a register!\n");
|
||||
+ bio->printd("MOV_RdCd(): rm field not a register!\n");
|
||||
+ exception(BX_GP_EXCEPTION, 0, 0);
|
||||
+ return;
|
||||
}
|
||||
|
||||
if (protected_mode() && CPL!=0) {
|
||||
- bx_panic("MOV_RdCd: CPL!=0\n");
|
||||
+ bio->printf("MOV_RdCd: CPL!=0\n");
|
||||
+ bio->printd("MOV_RdCd: CPL!=0\n");
|
||||
/* #GP(0) if CPL is not 0 */
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
return;
|
||||
@ -421,7 +421,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
val_32 = BX_CPU_THIS_PTR cr0.val32;
|
||||
#if 0
|
||||
- bx_printf("MOV_RdCd:CR0: R32 = %08x\n @CS:EIP %04x:%04x\n",
|
||||
+ bio->printf("MOV_RdCd:CR0: R32 = %08x\n @CS:EIP %04x:%04x\n",
|
||||
+ bio->printd("MOV_RdCd:CR0: R32 = %08x\n @CS:EIP %04x:%04x\n",
|
||||
(unsigned) val_32,
|
||||
(unsigned) BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].selector.value,
|
||||
(unsigned) BX_CPU_THIS_PTR eip);
|
||||
@ -429,38 +429,38 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
break;
|
||||
case 1: /* CR1 */
|
||||
- bx_panic("MOV_RdCd: CR1 not implemented yet\n");
|
||||
+ bio->printf("MOV_RdCd: CR1 not implemented yet\n");
|
||||
+ bio->printd("MOV_RdCd: CR1 not implemented yet\n");
|
||||
val_32 = 0;
|
||||
break;
|
||||
case 2: /* CR2 */
|
||||
- if (bx_dbg.creg)
|
||||
- bx_printf("MOV_RdCd: CR2\n");
|
||||
+ if (bio->getdbg().creg)
|
||||
+ bio->printf("MOV_RdCd: CR2\n");
|
||||
+ bio->printd("MOV_RdCd: CR2\n");
|
||||
val_32 = BX_CPU_THIS_PTR cr2;
|
||||
break;
|
||||
case 3: // CR3
|
||||
- if (bx_dbg.creg)
|
||||
- bx_printf("MOV_RdCd: reading CR3\n");
|
||||
+ if (bio->getdbg().creg)
|
||||
+ bio->printf("MOV_RdCd: reading CR3\n");
|
||||
+ bio->printd("MOV_RdCd: reading CR3\n");
|
||||
val_32 = BX_CPU_THIS_PTR cr3;
|
||||
break;
|
||||
case 4: // CR4
|
||||
#if BX_CPU_LEVEL == 3
|
||||
val_32 = 0;
|
||||
- bx_printf("MOV_RdCd: read of CR4 causes #UD\n");
|
||||
+ bio->printf("MOV_RdCd: read of CR4 causes #UD\n");
|
||||
+ bio->printd("MOV_RdCd: read of CR4 causes #UD\n");
|
||||
UndefinedOpcode(i);
|
||||
#else
|
||||
- bx_printf("MOV_RdCd: read of CR4\n");
|
||||
+ bio->printf("MOV_RdCd: read of CR4\n");
|
||||
+ bio->printd("MOV_RdCd: read of CR4\n");
|
||||
val_32 = BX_CPU_THIS_PTR cr4;
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
- bx_panic("MOV_RdCd: control register index out of range\n");
|
||||
+ bio->printf("MOV_RdCd: control register index out of range\n");
|
||||
+ bio->printd("MOV_RdCd: control register index out of range\n");
|
||||
val_32 = 0;
|
||||
}
|
||||
BX_WRITE_32BIT_REG(i->rm, val_32);
|
||||
@ -476,7 +476,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
#else
|
||||
// Pentium+ does not have TRx. They were redesigned using the MSRs.
|
||||
- bx_printf("MOV_TdRd: causes #UD\n");
|
||||
+ bio->printf("MOV_TdRd: causes #UD\n");
|
||||
+ bio->printd("MOV_TdRd: causes #UD\n");
|
||||
UndefinedOpcode(i);
|
||||
#endif
|
||||
}
|
||||
@ -492,7 +492,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
#else
|
||||
// Pentium+ does not have TRx. They were redesigned using the MSRs.
|
||||
- bx_printf("MOV_RdTd: causes #UD\n");
|
||||
+ bio->printf("MOV_RdTd: causes #UD\n");
|
||||
+ bio->printd("MOV_RdTd: causes #UD\n");
|
||||
UndefinedOpcode(i);
|
||||
#endif
|
||||
}
|
||||
@ -535,7 +535,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
BX_CPU_THIS_PTR cr0.ts = (msw & 0x01);
|
||||
|
||||
- //bx_printf("LOADALL: pe=%u, mp=%u, em=%u, ts=%u\n",
|
||||
+ //bio->printf("LOADALL: pe=%u, mp=%u, em=%u, ts=%u\n",
|
||||
+ //bio->printd("LOADALL: pe=%u, mp=%u, em=%u, ts=%u\n",
|
||||
// (unsigned) BX_CPU_THIS_PTR cr0.pe, (unsigned) BX_CPU_THIS_PTR cr0.mp,
|
||||
// (unsigned) BX_CPU_THIS_PTR cr0.em, (unsigned) BX_CPU_THIS_PTR cr0.ts);
|
||||
|
||||
@ -559,7 +559,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
if (BX_CPU_THIS_PTR ldtr.cache.segment) { /* not a system segment */
|
||||
- bx_printf(" AR byte = %02x\n", (unsigned) access);
|
||||
- bx_panic("loadall: LDTR descriptor cache loaded with non system segment\n");
|
||||
+ bio->printf(" AR byte = %02x\n", (unsigned) access);
|
||||
+ bio->printd(" AR byte = %02x\n", (unsigned) access);
|
||||
+ bio->panic("loadall: LDTR descriptor cache loaded with non system segment\n");
|
||||
}
|
||||
if ( BX_CPU_THIS_PTR ldtr.cache.type != 2 ) {
|
||||
@ -591,7 +591,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].selector.rpl = (cs_raw & 0x03); cs_raw >>= 2;
|
||||
|
||||
- //bx_printf("LOADALL: setting cs.selector.rpl to %u\n",
|
||||
+ //bio->printf("LOADALL: setting cs.selector.rpl to %u\n",
|
||||
+ //bio->printd("LOADALL: setting cs.selector.rpl to %u\n",
|
||||
// (unsigned) BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].selector.rpl);
|
||||
|
||||
BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].selector.ti = (cs_raw & 0x01); cs_raw >>= 1;
|
||||
@ -613,20 +613,20 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
- bx_printf("BX_CPU_THIS_PTR sregs[BX_SEG_REG_DS].dpl = %02x\n", (unsigned) BX_CPU_THIS_PTR ds.cache.dpl);
|
||||
- bx_printf("BX_CPU_THIS_PTR sregs[BX_SEG_REG_ES].dpl = %02x\n", (unsigned) BX_CPU_THIS_PTR es.cache.dpl);
|
||||
- bx_printf("LOADALL: setting cs.selector.rpl to %u\n",
|
||||
+ bio->printf("cs.dpl = %02x\n", (unsigned) BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.dpl);
|
||||
+ bio->printf("ss.dpl = %02x\n", (unsigned) BX_CPU_THIS_PTR sregs[BX_SEG_REG_SS].cache.dpl);
|
||||
+ bio->printf("BX_CPU_THIS_PTR sregs[BX_SEG_REG_DS].dpl = %02x\n", (unsigned) BX_CPU_THIS_PTR ds.cache.dpl);
|
||||
+ bio->printf("BX_CPU_THIS_PTR sregs[BX_SEG_REG_ES].dpl = %02x\n", (unsigned) BX_CPU_THIS_PTR es.cache.dpl);
|
||||
+ bio->printf("LOADALL: setting cs.selector.rpl to %u\n",
|
||||
+ bio->printd("cs.dpl = %02x\n", (unsigned) BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.dpl);
|
||||
+ bio->printd("ss.dpl = %02x\n", (unsigned) BX_CPU_THIS_PTR sregs[BX_SEG_REG_SS].cache.dpl);
|
||||
+ bio->printd("BX_CPU_THIS_PTR sregs[BX_SEG_REG_DS].dpl = %02x\n", (unsigned) BX_CPU_THIS_PTR ds.cache.dpl);
|
||||
+ bio->printd("BX_CPU_THIS_PTR sregs[BX_SEG_REG_ES].dpl = %02x\n", (unsigned) BX_CPU_THIS_PTR es.cache.dpl);
|
||||
+ bio->printd("LOADALL: setting cs.selector.rpl to %u\n",
|
||||
(unsigned) BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].selector.rpl);
|
||||
- bx_printf("LOADALL: setting ss.selector.rpl to %u\n",
|
||||
+ bio->printf("LOADALL: setting ss.selector.rpl to %u\n",
|
||||
+ bio->printd("LOADALL: setting ss.selector.rpl to %u\n",
|
||||
(unsigned) BX_CPU_THIS_PTR sregs[BX_SEG_REG_SS].selector.rpl);
|
||||
- bx_printf("LOADALL: setting ds.selector.rpl to %u\n",
|
||||
+ bio->printf("LOADALL: setting ds.selector.rpl to %u\n",
|
||||
+ bio->printd("LOADALL: setting ds.selector.rpl to %u\n",
|
||||
(unsigned) BX_CPU_THIS_PTR sregs[BX_SEG_REG_DS].selector.rpl);
|
||||
- bx_printf("LOADALL: setting es.selector.rpl to %u\n",
|
||||
+ bio->printf("LOADALL: setting es.selector.rpl to %u\n",
|
||||
+ bio->printd("LOADALL: setting es.selector.rpl to %u\n",
|
||||
(unsigned) BX_CPU_THIS_PTR sregs[BX_SEG_REG_ES].selector.rpl);
|
||||
#endif
|
||||
|
||||
@ -644,7 +644,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
#if 0
|
||||
if (access)
|
||||
- bx_printf("LOADALL: GDTR access bits not 0 (%02x).\n",
|
||||
+ bio->printf("LOADALL: GDTR access bits not 0 (%02x).\n",
|
||||
+ bio->printd("LOADALL: GDTR access bits not 0 (%02x).\n",
|
||||
(unsigned) access);
|
||||
#endif
|
||||
|
||||
@ -662,7 +662,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
EDX = features;
|
||||
+#else
|
||||
+ family = 6;
|
||||
+ bio->printf("CPUID: not implemented for > 5\n");
|
||||
+ bio->printd("CPUID: not implemented for > 5\n");
|
||||
+#endif
|
||||
break;
|
||||
|
||||
@ -681,7 +681,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
|
||||
//if (BX_CPU_THIS_PTR cr0.ts)
|
||||
- // bx_printf("MOV_CdRd:CR0.TS set 0x%x\n", (unsigned) val_32);
|
||||
+ // bio->printf("MOV_CdRd:CR0.TS set 0x%x\n", (unsigned) val_32);
|
||||
+ // bio->printd("MOV_CdRd:CR0.TS set 0x%x\n", (unsigned) val_32);
|
||||
|
||||
if (prev_pe==0 && BX_CPU_THIS_PTR cr0.pe) {
|
||||
enter_protected_mode();
|
||||
@ -708,7 +708,7 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
{
|
||||
#if BX_CPU_LEVEL >= 5
|
||||
- bx_panic("RDMSR: not implemented yet\n");
|
||||
+ bio->printf("[CPU%u] RDMSR: not implemented yet\n",BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] RDMSR: not implemented yet\n",BX_SIM_ID);
|
||||
+ UndefinedOpcode(i);
|
||||
#else
|
||||
UndefinedOpcode(i);
|
||||
|
@ -1,6 +1,6 @@
|
||||
$OpenBSD: patch-gui_x_cc,v 1.1 2001/02/02 16:59:10 todd Exp $
|
||||
$OpenBSD: patch-gui_x_cc,v 1.2 2001/03/30 16:47:02 todd Exp $
|
||||
--- gui/x.cc.orig Sat Mar 25 21:43:36 2000
|
||||
+++ gui/x.cc Mon Oct 23 22:11:14 2000
|
||||
+++ gui/x.cc Fri Mar 30 10:15:39 2001
|
||||
@@ -27,6 +27,7 @@ extern "C" {
|
||||
#include <X11/Xos.h>
|
||||
#include <X11/Xatom.h>
|
||||
@ -23,7 +23,7 @@ $OpenBSD: patch-gui_x_cc,v 1.1 2001/02/02 16:59:10 todd Exp $
|
||||
|
||||
if (bx_options.private_colormap) {
|
||||
- fprintf(stderr, "# WARNING: X11: private_colormap option not handled yet.\n");
|
||||
+ bio->printf("#X] WARNING: X11: private_colormap option not handled yet.\n");
|
||||
+ bio->printd("#X] WARNING: X11: private_colormap option not handled yet.\n");
|
||||
}
|
||||
|
||||
x_tilesize = tilewidth;
|
||||
@ -85,13 +85,13 @@ $OpenBSD: patch-gui_x_cc,v 1.1 2001/02/02 16:59:10 todd Exp $
|
||||
XSync(bx_x_display, /* no discard */ 0);
|
||||
|
||||
- bx_printf("waiting for MapNotify\n");
|
||||
+ bio->printf("[X] waiting for MapNotify\n");
|
||||
+ bio->printd("[X] waiting for MapNotify\n");
|
||||
while (1) {
|
||||
XNextEvent(bx_x_display, &report);
|
||||
if (report.type == MapNotify) break;
|
||||
}
|
||||
- bx_printf("MapNotify found.\n");
|
||||
+ bio->printf("[X] MapNotify found.\n");
|
||||
+ bio->printd("[X] MapNotify found.\n");
|
||||
|
||||
{
|
||||
char *imagedata;
|
||||
@ -124,7 +124,7 @@ $OpenBSD: patch-gui_x_cc,v 1.1 2001/02/02 16:59:10 todd Exp $
|
||||
if ((font_info = XLoadQueryFont(bx_x_display,"vga")) == NULL) {
|
||||
- fprintf(stderr, "# %s: Cannot open vga font\n", progname);
|
||||
- bx_panic("Could not open vga font\n");
|
||||
+ bio->printf("#X] %s: Cannot open vga font\n", progname);
|
||||
+ bio->printd("#X] %s: Cannot open vga font\n", progname);
|
||||
+ bio->panic("X Could not open vga font\n");
|
||||
}
|
||||
}
|
||||
@ -134,20 +134,20 @@ $OpenBSD: patch-gui_x_cc,v 1.1 2001/02/02 16:59:10 todd Exp $
|
||||
|
||||
case ConfigureNotify:
|
||||
-//bx_printf("ConfigureNotify Xevent\n");
|
||||
+//bio->printf("[X] ConfigureNotify Xevent\n");
|
||||
+//bio->printd("[X] ConfigureNotify Xevent\n");
|
||||
show_headerbar();
|
||||
break;
|
||||
|
||||
case ButtonPress:
|
||||
button_event = (XButtonEvent *) &report;
|
||||
-//bx_printf("xxx: buttonpress\n");
|
||||
+//bio->printf("[X] xxx: buttonpress\n");
|
||||
+//bio->printd("[X] xxx: buttonpress\n");
|
||||
if (button_event->y < BX_HEADER_BAR_Y) {
|
||||
-//bx_printf("xxx: in headerbar\n");
|
||||
+//bio->printf("[X] xxx: in headerbar\n");
|
||||
+//bio->printd("[X] xxx: in headerbar\n");
|
||||
if (mouse_update) {
|
||||
-//bx_printf("xxx: mouse_update=1\n");
|
||||
+//bio->printf("[X] xxx: mouse_update=1\n");
|
||||
+//bio->printd("[X] xxx: mouse_update=1\n");
|
||||
send_keyboard_mouse_status();
|
||||
mouse_update = 0;
|
||||
}
|
||||
@ -156,24 +156,24 @@ $OpenBSD: patch-gui_x_cc,v 1.1 2001/02/02 16:59:10 todd Exp $
|
||||
current_y = button_event->y;
|
||||
mouse_update = 1;
|
||||
-//bx_printf("xxx: x,y=(%d,%d)\n", current_x, current_y);
|
||||
+//bio->printf("[X] xxx: x,y=(%d,%d)\n", current_x, current_y);
|
||||
+//bio->printd("[X] xxx: x,y=(%d,%d)\n", current_x, current_y);
|
||||
switch (button_event->button) {
|
||||
case Button1:
|
||||
-//bx_printf("xxx: button1\n");
|
||||
+//bio->printf("[X] xxx: button1\n");
|
||||
+//bio->printd("[X] xxx: button1\n");
|
||||
mouse_button_state |= 0x01;
|
||||
send_keyboard_mouse_status();
|
||||
mouse_update = 0;
|
||||
break;
|
||||
case Button2:
|
||||
-//bx_printf("xxx: button2\n");
|
||||
+//bio->printf("[X] xxx: button2\n");
|
||||
+//bio->printd("[X] xxx: button2\n");
|
||||
|
||||
// (mch) Hack for easier mouse handling (toggle mouse enable)
|
||||
mouse_handler();
|
||||
if (bx_options.mouse_enabled) {
|
||||
- bx_printf("[x] Mouse enabled\n");
|
||||
+ bio->printf("[x] Mouse enabled\n");
|
||||
+ bio->printd("[x] Mouse enabled\n");
|
||||
mouse_enable_x = current_x;
|
||||
mouse_enable_y = current_y;
|
||||
disable_cursor();
|
||||
@ -181,7 +181,7 @@ $OpenBSD: patch-gui_x_cc,v 1.1 2001/02/02 16:59:10 todd Exp $
|
||||
warp_cursor(warp_home_x-current_x, warp_home_y-current_y);
|
||||
} else {
|
||||
- bx_printf("[x] Mouse disabled\n");
|
||||
+ bio->printf("[x] Mouse disabled\n");
|
||||
+ bio->printd("[x] Mouse disabled\n");
|
||||
enable_cursor();
|
||||
warp_cursor(mouse_enable_x-current_x, mouse_enable_y-current_y);
|
||||
}
|
||||
@ -190,7 +190,7 @@ $OpenBSD: patch-gui_x_cc,v 1.1 2001/02/02 16:59:10 todd Exp $
|
||||
break;
|
||||
case Button3:
|
||||
-//bx_printf("xxx: button3\n");
|
||||
+//bio->printf("[X] xxx: button3\n");
|
||||
+//bio->printd("[X] xxx: button3\n");
|
||||
mouse_button_state |= 0x02;
|
||||
send_keyboard_mouse_status();
|
||||
mouse_update = 0;
|
||||
@ -199,13 +199,13 @@ $OpenBSD: patch-gui_x_cc,v 1.1 2001/02/02 16:59:10 todd Exp $
|
||||
case ButtonRelease:
|
||||
button_event = (XButtonEvent *) &report;
|
||||
-//bx_printf("xxx: buttonrelease\n");
|
||||
+//bio->printf("[X] xxx: buttonrelease\n");
|
||||
+//bio->printd("[X] xxx: buttonrelease\n");
|
||||
if (button_event->y < BX_HEADER_BAR_Y) {
|
||||
-//bx_printf("xxx: in headerbar\n");
|
||||
+//bio->printf("[X] xxx: in headerbar\n");
|
||||
+//bio->printd("[X] xxx: in headerbar\n");
|
||||
if (mouse_update) {
|
||||
-//bx_printf("xxx: mouse_update=1\n");
|
||||
+//bio->printf("[X] xxx: mouse_update=1\n");
|
||||
+//bio->printd("[X] xxx: mouse_update=1\n");
|
||||
send_keyboard_mouse_status();
|
||||
mouse_update = 0;
|
||||
}
|
||||
@ -214,25 +214,25 @@ $OpenBSD: patch-gui_x_cc,v 1.1 2001/02/02 16:59:10 todd Exp $
|
||||
current_y = button_event->y;
|
||||
mouse_update = 1;
|
||||
-//bx_printf("xxx: x,y=(%d,%d)\n", current_x, current_y);
|
||||
+//bio->printf("[X] xxx: x,y=(%d,%d)\n", current_x, current_y);
|
||||
+//bio->printd("[X] xxx: x,y=(%d,%d)\n", current_x, current_y);
|
||||
switch (button_event->button) {
|
||||
case Button1:
|
||||
-//bx_printf("xxx: button1\n");
|
||||
+//bio->printf("[X] xxx: button1\n");
|
||||
+//bio->printd("[X] xxx: button1\n");
|
||||
mouse_button_state &= ~0x01;
|
||||
send_keyboard_mouse_status();
|
||||
mouse_update = 0;
|
||||
break;
|
||||
case Button2:
|
||||
-//bx_printf("xxx: button2\n");
|
||||
+//bio->printf("[X] xxx: button2\n");
|
||||
+//bio->printd("[X] xxx: button2\n");
|
||||
//mouse_button_state &= ~;
|
||||
//send_keyboard_mouse_status();
|
||||
//mouse_update = 0;
|
||||
break;
|
||||
case Button3:
|
||||
-//bx_printf("xxx: button3\n");
|
||||
+//bio->printf("[X] xxx: button3\n");
|
||||
+//bio->printd("[X] xxx: button3\n");
|
||||
mouse_button_state &= ~0x02;
|
||||
send_keyboard_mouse_status();
|
||||
mouse_update = 0;
|
||||
@ -241,7 +241,7 @@ $OpenBSD: patch-gui_x_cc,v 1.1 2001/02/02 16:59:10 todd Exp $
|
||||
key_event = (XKeyEvent *) &report;
|
||||
charcount = XLookupString(key_event, buffer, bufsize, &keysym, &compose);
|
||||
-/*fprintf(stderr, "# >>> %s\n", XKeysymToString(keysym));*/
|
||||
+/*bio->printf("#X] >>> %s\n", XKeysymToString(keysym));*/
|
||||
+/*bio->printd("#X] >>> %s\n", XKeysymToString(keysym));*/
|
||||
xkeypress(keysym, 0);
|
||||
break;
|
||||
|
||||
@ -249,7 +249,7 @@ $OpenBSD: patch-gui_x_cc,v 1.1 2001/02/02 16:59:10 todd Exp $
|
||||
key_event = (XKeyEvent *) &report;
|
||||
charcount = XLookupString(key_event, buffer, bufsize, &keysym, &compose);
|
||||
-/*fprintf(stderr, "# <<< %s\n", XKeysymToString(keysym));*/
|
||||
+/*bio->printf("#X] <<< %s\n", XKeysymToString(keysym));*/
|
||||
+/*bio->printd("#X] <<< %s\n", XKeysymToString(keysym));*/
|
||||
xkeypress(keysym, 1);
|
||||
break;
|
||||
|
||||
@ -258,7 +258,7 @@ $OpenBSD: patch-gui_x_cc,v 1.1 2001/02/02 16:59:10 todd Exp $
|
||||
current_y = pointer_event->y;
|
||||
mouse_update = 1;
|
||||
-//bx_printf("xxx: motionNotify x,y=(%d,%d)\n", current_x, current_y);
|
||||
+//bio->printf("[X] xxx: motionNotify x,y=(%d,%d)\n", current_x, current_y);
|
||||
+//bio->printd("[X] xxx: motionNotify x,y=(%d,%d)\n", current_x, current_y);
|
||||
break;
|
||||
|
||||
case EnterNotify:
|
||||
@ -266,7 +266,7 @@ $OpenBSD: patch-gui_x_cc,v 1.1 2001/02/02 16:59:10 todd Exp $
|
||||
prev_x = current_x = enter_event->x;
|
||||
prev_y = current_y = enter_event->y;
|
||||
-//bx_printf("xxx: enterNotify x,y=(%d,%d)\n", current_x, current_y);
|
||||
+//bio->printf("[X] xxx: enterNotify x,y=(%d,%d)\n", current_x, current_y);
|
||||
+//bio->printd("[X] xxx: enterNotify x,y=(%d,%d)\n", current_x, current_y);
|
||||
break;
|
||||
|
||||
case LeaveNotify:
|
||||
@ -274,7 +274,7 @@ $OpenBSD: patch-gui_x_cc,v 1.1 2001/02/02 16:59:10 todd Exp $
|
||||
prev_x = current_x = -1;
|
||||
prev_y = current_y = -1;
|
||||
-//bx_printf("xxx: LeaveNotify x,y set to -1\n");
|
||||
+//bio->printf("[X] xxx: LeaveNotify x,y set to -1\n");
|
||||
+//bio->printd("[X] xxx: LeaveNotify x,y set to -1\n");
|
||||
break;
|
||||
|
||||
case MapNotify:
|
||||
@ -282,14 +282,14 @@ $OpenBSD: patch-gui_x_cc,v 1.1 2001/02/02 16:59:10 todd Exp $
|
||||
* requests before window mapped
|
||||
*/
|
||||
-//bx_printf("xxx: mapnotify: found\n");
|
||||
+//bio->printf("[X] xxx: mapnotify: found\n");
|
||||
+//bio->printd("[X] xxx: mapnotify: found\n");
|
||||
//retval = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
// (mch) Ignore...
|
||||
- // bx_printf("xxx: default Xevent type\n");
|
||||
+ // bio->printf("[X] xxx: default Xevent type\n");
|
||||
+ // bio->printd("[X] xxx: default Xevent type\n");
|
||||
/* all events selected by StructureNotifyMask are thrown away here,
|
||||
* since nothing is done with them */
|
||||
break;
|
||||
@ -298,7 +298,7 @@ $OpenBSD: patch-gui_x_cc,v 1.1 2001/02/02 16:59:10 todd Exp $
|
||||
|
||||
if (mouse_update) {
|
||||
- //bx_printf("xxx: bottom, send status\n");
|
||||
+ //bio->printf("[X] xxx: bottom, send status\n");
|
||||
+ //bio->printd("[X] xxx: bottom, send status\n");
|
||||
send_keyboard_mouse_status();
|
||||
}
|
||||
}
|
||||
@ -307,7 +307,7 @@ $OpenBSD: patch-gui_x_cc,v 1.1 2001/02/02 16:59:10 todd Exp $
|
||||
send_keyboard_mouse_status(void)
|
||||
{
|
||||
-//bx_printf("xxx: prev=(%d,%d) curr=(%d,%d)\n",
|
||||
+//bio->printf("[X] xxx: prev=(%d,%d) curr=(%d,%d)\n",
|
||||
+//bio->printd("[X] xxx: prev=(%d,%d) curr=(%d,%d)\n",
|
||||
// prev_x, prev_y, current_x, current_y);
|
||||
|
||||
if ( (prev_x!=-1) && (current_x!=-1) && (prev_y!=-1) && (current_y!=-1)) {
|
||||
@ -316,7 +316,7 @@ $OpenBSD: patch-gui_x_cc,v 1.1 2001/02/02 16:59:10 todd Exp $
|
||||
warp_cursor(warp_home_x-current_x, warp_home_y-current_y);
|
||||
|
||||
-//bx_printf("xxx: MOUSE_MOTION: dx=%d, dy=%d\n", (int) dx, (int) dy);
|
||||
+//bio->printf("[X] xxx: MOUSE_MOTION: dx=%d, dy=%d\n", (int) dx, (int) dy);
|
||||
+//bio->printd("[X] xxx: MOUSE_MOTION: dx=%d, dy=%d\n", (int) dx, (int) dy);
|
||||
bx_devices.keyboard->mouse_motion( dx, dy, mouse_button_state);
|
||||
//if (warped) {
|
||||
// prev_x = current_x = -1;
|
||||
@ -325,7 +325,7 @@ $OpenBSD: patch-gui_x_cc,v 1.1 2001/02/02 16:59:10 todd Exp $
|
||||
|
||||
default:
|
||||
- fprintf(stderr, "# xkeypress(): keysym %x unhandled!\n", (unsigned) keysym);
|
||||
+ bio->printf("#X] xkeypress(): keysym %x unhandled!\n", (unsigned) keysym);
|
||||
+ bio->printd("#X] xkeypress(): keysym %x unhandled!\n", (unsigned) keysym);
|
||||
return;
|
||||
break;
|
||||
}
|
||||
@ -370,7 +370,7 @@ $OpenBSD: patch-gui_x_cc,v 1.1 2001/02/02 16:59:10 todd Exp $
|
||||
bx_gui_c::exit(void)
|
||||
{
|
||||
- bx_printf("Note: X11: bx_gui_c::exit() not implemented yet.\n");
|
||||
+ bio->printf("[X] Note: bx_gui_c::exit() not implemented yet.\n");
|
||||
+ bio->printd("[X] Note: bx_gui_c::exit() not implemented yet.\n");
|
||||
}
|
||||
|
||||
static void warp_cursor (int dx, int dy)
|
||||
|
@ -1,6 +1,6 @@
|
||||
$OpenBSD: patch-iodev_devices_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
$OpenBSD: patch-iodev_devices_cc,v 1.2 2001/03/30 16:47:02 todd Exp $
|
||||
--- iodev/devices.cc.orig Sat Mar 25 21:32:21 2000
|
||||
+++ iodev/devices.cc Tue Oct 17 12:04:02 2000
|
||||
+++ iodev/devices.cc Fri Mar 30 10:13:53 2001
|
||||
@@ -273,11 +273,11 @@ bx_devices_c::port92_read(Bit32u address
|
||||
UNUSED(this_ptr);
|
||||
#endif // !BX_USE_DEV_SMF
|
||||
@ -11,34 +11,50 @@ $OpenBSD: patch-iodev_devices_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
|
||||
- bx_printf("devices: port92h read partially supported!!!\n");
|
||||
- bx_printf("devices: returning %02x\n", (unsigned) (BX_GET_ENABLE_A20() << 1));
|
||||
+ bio->printf("devices: port92h read partially supported!!!\n");
|
||||
+ bio->printf("devices: returning %02x\n", (unsigned) (BX_GET_ENABLE_A20() << 1));
|
||||
+ bio->printd("[devices] port92h read partially supported!!!\n");
|
||||
+ bio->printd("[devices] returning %02x\n", (unsigned) (BX_GET_ENABLE_A20() << 1));
|
||||
return(BX_GET_ENABLE_A20() << 1);
|
||||
}
|
||||
|
||||
@@ -300,17 +300,17 @@ bx_devices_c::port92_write(Bit32u addres
|
||||
Boolean bx_cpu_reset;
|
||||
@@ -295,23 +295,23 @@ bx_devices_c::write_handler(void *this_p
|
||||
bx_devices_c::port92_write(Bit32u address, Bit32u value, unsigned io_len)
|
||||
{
|
||||
#else
|
||||
- UNUSED(this_ptr);
|
||||
+ UNUSED(this_ptr);
|
||||
#endif // !BX_USE_DEV_SMF
|
||||
- Boolean bx_cpu_reset;
|
||||
+ Boolean bx_cpu_reset;
|
||||
|
||||
if (io_len > 1)
|
||||
- if (io_len > 1)
|
||||
- bx_panic("devices.c: port 92h: io read from address %08x, len=%u\n",
|
||||
+ bio->panic("devices.c: port 92h: io read from address %08x, len=%u\n",
|
||||
(unsigned) address, (unsigned) io_len);
|
||||
|
||||
- (unsigned) address, (unsigned) io_len);
|
||||
-
|
||||
- bx_printf("devices: port92h write of %02x partially supported!!!\n",
|
||||
+ bio->printf("devices: port92h write of %02x partially supported!!!\n",
|
||||
(unsigned) value);
|
||||
- (unsigned) value);
|
||||
-bx_printf("devices: A20: set_enable_a20() called\n");
|
||||
+bio->printf("devices: A20: set_enable_a20() called\n");
|
||||
BX_SET_ENABLE_A20( (value & 0x02) >> 1 );
|
||||
- BX_SET_ENABLE_A20( (value & 0x02) >> 1 );
|
||||
- bx_printf("A20: now %u\n", (unsigned) BX_GET_ENABLE_A20());
|
||||
+ bio->printf("A20: now %u\n", (unsigned) BX_GET_ENABLE_A20());
|
||||
bx_cpu_reset = (value & 0x01); /* high speed reset */
|
||||
if (bx_cpu_reset) {
|
||||
- bx_cpu_reset = (value & 0x01); /* high speed reset */
|
||||
- if (bx_cpu_reset) {
|
||||
- bx_panic("PORT 92h write: CPU reset requested!\n");
|
||||
+ bio->panic("PORT 92h write: CPU reset requested!\n");
|
||||
}
|
||||
- }
|
||||
+ if (io_len > 1)
|
||||
+ bio->panic("[devices] port 92h: io read from address %08x, len=%u\n",
|
||||
+ (unsigned) address, (unsigned) io_len);
|
||||
+
|
||||
+ bio->printd("[devices] port92h write of %02x partially supported!!!\n",
|
||||
+ (unsigned) value);
|
||||
+ bio->printd("[devices] A20: set_enable_a20() called\n");
|
||||
+ BX_SET_ENABLE_A20( (value & 0x02) >> 1 );
|
||||
+ bio->printd("[devices] A20: now %u\n", (unsigned) BX_GET_ENABLE_A20());
|
||||
+ bx_cpu_reset = (value & 0x01); /* high speed reset */
|
||||
+ if (bx_cpu_reset) {
|
||||
+ bio->panic("PORT 92h write: CPU reset requested!\n");
|
||||
+ }
|
||||
}
|
||||
|
||||
void
|
||||
@@ -333,8 +333,8 @@ bx_devices_c::timer()
|
||||
|
||||
retval = keyboard->periodic( TIMER_DELTA );
|
||||
@ -46,7 +62,7 @@ $OpenBSD: patch-iodev_devices_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- if (bx_dbg.keyboard)
|
||||
- bx_printf("keyboard: interrupt(1)\n");
|
||||
+ if (bio->getdbg().keyboard)
|
||||
+ bio->printf("keyboard: interrupt(1)\n");
|
||||
+ bio->printd("keyboard: interrupt(1)\n");
|
||||
pic->trigger_irq(1);
|
||||
}
|
||||
if (retval & 0x02)
|
||||
@ -75,14 +91,14 @@ $OpenBSD: patch-iodev_devices_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
|
||||
if (!irq_handler_name[irq]) {
|
||||
- bx_printf("IO device %s tried to unregister IRQ %d, not registered\n",
|
||||
+ bio->printf("IO device %s tried to unregister IRQ %d, not registered\n",
|
||||
+ bio->printd("IO device %s tried to unregister IRQ %d, not registered\n",
|
||||
name, irq);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcmp(irq_handler_name[irq], name)) {
|
||||
- bx_printf("IRQ %u not registered to %s but to %s\n", irq,
|
||||
+ bio->printf("IRQ %u not registered to %s but to %s\n", irq,
|
||||
+ bio->printd("IRQ %u not registered to %s but to %s\n", irq,
|
||||
name, irq_handler_name[irq]);
|
||||
return;
|
||||
}
|
||||
@ -102,7 +118,7 @@ $OpenBSD: patch-iodev_devices_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
// if it is not the Unmapped port handler, bail
|
||||
if ( strcmp( io_read_handler[read_handler_id[addr]].handler_name, "Unmapped" ) ) {
|
||||
- bx_printf("IO device address conflict(read) at IO address %Xh\n",
|
||||
+ bio->printf("IO device address conflict(read) at IO address %Xh\n",
|
||||
+ bio->printd("IO device address conflict(read) at IO address %Xh\n",
|
||||
(unsigned) addr);
|
||||
- bx_panic(" conflicting devices: %s & %s\n",
|
||||
+ bio->panic(" conflicting devices: %s & %s\n",
|
||||
|
@ -1,5 +1,5 @@
|
||||
--- iodev/harddrv.cc.orig Sat Mar 25 21:28:49 2000
|
||||
+++ iodev/harddrv.cc Thu Oct 19 10:25:12 2000
|
||||
+++ iodev/harddrv.cc Fri Mar 30 10:31:29 2001
|
||||
@@ -103,10 +103,11 @@ bx_hard_drive_c::init(bx_devices_c *d, b
|
||||
BX_HD_THIS s[1].hard_drive->cylinders = bx_options.diskd.cylinders;
|
||||
BX_HD_THIS s[1].hard_drive->heads = bx_options.diskd.heads;
|
||||
@ -669,7 +669,7 @@
|
||||
BX_SELECTED_CONTROLLER.error_register = 0x81; // Drive 1 failed, no error on drive 0
|
||||
// BX_SELECTED_CONTROLLER.status.busy = 0; // not needed
|
||||
BX_SELECTED_CONTROLLER.status.drq = 0;
|
||||
@@ -1339,20 +1341,20 @@ bx_hard_drive_c::write(Bit32u address, B
|
||||
@@ -1339,20 +1341,17 @@ bx_hard_drive_c::write(Bit32u address, B
|
||||
|
||||
case 0x91: // initialize drive parameters
|
||||
if (BX_SELECTED_CONTROLLER.status.busy) {
|
||||
@ -682,14 +682,13 @@
|
||||
// sets logical geometry of specified drive
|
||||
- bx_printf("initialize drive params\n");
|
||||
- bx_printf(" sector count = %u\n",
|
||||
+ bio->printf("[HDD] initialize drive params\n");
|
||||
+ bio->printf("[HDD] sector count = %u\n",
|
||||
(unsigned) BX_SELECTED_CONTROLLER.sector_count);
|
||||
- (unsigned) BX_SELECTED_CONTROLLER.sector_count);
|
||||
- bx_printf(" drive select = %u\n",
|
||||
+ bio->printf("[HDD] drive select = %u\n",
|
||||
(unsigned) BX_HD_THIS drive_select);
|
||||
- (unsigned) BX_HD_THIS drive_select);
|
||||
- bx_printf(" head number = %u\n",
|
||||
+ bio->printf("[HDD] head number = %u\n",
|
||||
+ bio->printf("[HDD] init drive parms: sec ct = %u, drive sel = %u, head = %u\n",
|
||||
+ (unsigned) BX_SELECTED_CONTROLLER.sector_count,
|
||||
+ (unsigned) BX_HD_THIS drive_select,
|
||||
(unsigned) BX_SELECTED_CONTROLLER.head_no);
|
||||
if (BX_HD_THIS drive_select != 0 && !bx_options.diskd.present) {
|
||||
- bx_panic("disk: init drive params: drive != 0\n");
|
||||
@ -697,7 +696,7 @@
|
||||
//BX_SELECTED_CONTROLLER.error_register = 0x12;
|
||||
BX_SELECTED_CONTROLLER.status.busy = 0;
|
||||
BX_SELECTED_CONTROLLER.status.drive_ready = 1;
|
||||
@@ -1362,9 +1364,9 @@ bx_hard_drive_c::write(Bit32u address, B
|
||||
@@ -1362,9 +1361,9 @@ bx_hard_drive_c::write(Bit32u address, B
|
||||
break;
|
||||
}
|
||||
if (BX_SELECTED_CONTROLLER.sector_count != BX_SELECTED_HD.hard_drive->sectors)
|
||||
@ -709,7 +708,7 @@
|
||||
BX_SELECTED_CONTROLLER.status.busy = 0;
|
||||
BX_SELECTED_CONTROLLER.status.drive_ready = 1;
|
||||
BX_SELECTED_CONTROLLER.status.drq = 0;
|
||||
@@ -1374,11 +1376,11 @@ bx_hard_drive_c::write(Bit32u address, B
|
||||
@@ -1374,11 +1373,11 @@ bx_hard_drive_c::write(Bit32u address, B
|
||||
|
||||
case 0xec: // Get Drive Info
|
||||
if (bx_options.newHardDriveSupport) {
|
||||
@ -724,7 +723,7 @@
|
||||
command_aborted(value);
|
||||
break;
|
||||
}
|
||||
@@ -1408,7 +1410,7 @@ bx_hard_drive_c::write(Bit32u address, B
|
||||
@@ -1408,7 +1407,7 @@ bx_hard_drive_c::write(Bit32u address, B
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -733,7 +732,7 @@
|
||||
command_aborted(value);
|
||||
}
|
||||
break;
|
||||
@@ -1416,8 +1418,8 @@ bx_hard_drive_c::write(Bit32u address, B
|
||||
@@ -1416,8 +1415,8 @@ bx_hard_drive_c::write(Bit32u address, B
|
||||
case 0x40: //
|
||||
if (bx_options.newHardDriveSupport) {
|
||||
if (BX_SELECTED_HD.device_type != IDE_DISK)
|
||||
@ -744,7 +743,7 @@
|
||||
BX_SELECTED_CONTROLLER.status.busy = 0;
|
||||
BX_SELECTED_CONTROLLER.status.drive_ready = 1;
|
||||
BX_SELECTED_CONTROLLER.status.drq = 0;
|
||||
@@ -1425,11 +1427,14 @@ bx_hard_drive_c::write(Bit32u address, B
|
||||
@@ -1425,11 +1424,14 @@ bx_hard_drive_c::write(Bit32u address, B
|
||||
raise_interrupt();
|
||||
}
|
||||
else {
|
||||
@ -761,7 +760,7 @@
|
||||
case 0xc6: // (mch) set multiple mode
|
||||
if (BX_SELECTED_CONTROLLER.sector_count != 128 &&
|
||||
BX_SELECTED_CONTROLLER.sector_count != 64 &&
|
||||
@@ -1441,7 +1446,7 @@ bx_hard_drive_c::write(Bit32u address, B
|
||||
@@ -1441,7 +1443,7 @@ bx_hard_drive_c::write(Bit32u address, B
|
||||
command_aborted(value);
|
||||
|
||||
if (BX_SELECTED_HD.device_type != IDE_DISK)
|
||||
@ -770,7 +769,7 @@
|
||||
|
||||
BX_SELECTED_CONTROLLER.sectors_per_block = BX_SELECTED_CONTROLLER.sector_count;
|
||||
BX_SELECTED_CONTROLLER.status.busy = 0;
|
||||
@@ -1498,9 +1503,9 @@ bx_hard_drive_c::write(Bit32u address, B
|
||||
@@ -1498,9 +1500,9 @@ bx_hard_drive_c::write(Bit32u address, B
|
||||
if (BX_SELECTED_HD.device_type == IDE_CDROM) {
|
||||
// PACKET
|
||||
if (BX_SELECTED_CONTROLLER.features & (1 << 0))
|
||||
@ -782,7 +781,7 @@
|
||||
|
||||
// We're already ready!
|
||||
BX_SELECTED_CONTROLLER.sector_count = 1;
|
||||
@@ -1518,11 +1523,11 @@ bx_hard_drive_c::write(Bit32u address, B
|
||||
@@ -1518,11 +1520,11 @@ bx_hard_drive_c::write(Bit32u address, B
|
||||
}
|
||||
case 0xa2: // ATAPI service (optional)
|
||||
if (BX_SELECTED_HD.device_type == IDE_CDROM) {
|
||||
@ -796,7 +795,7 @@
|
||||
command_aborted(value);
|
||||
break;
|
||||
|
||||
@@ -1538,7 +1543,7 @@ bx_hard_drive_c::write(Bit32u address, B
|
||||
@@ -1538,7 +1540,7 @@ bx_hard_drive_c::write(Bit32u address, B
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -805,7 +804,7 @@
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1550,13 +1555,13 @@ bx_hard_drive_c::write(Bit32u address, B
|
||||
@@ -1550,13 +1552,13 @@ bx_hard_drive_c::write(Bit32u address, B
|
||||
BX_HD_THIS s[0].controller.control.reset = value & 0x04;
|
||||
BX_HD_THIS s[1].controller.control.reset = value & 0x04;
|
||||
BX_SELECTED_CONTROLLER.control.disable_irq = value & 0x02;
|
||||
@ -822,7 +821,7 @@
|
||||
|
||||
// (mch) Set BSY, drive not ready
|
||||
for (int id = 0; id < 2; id++) {
|
||||
@@ -1583,7 +1588,7 @@ bx_hard_drive_c::write(Bit32u address, B
|
||||
@@ -1583,7 +1585,7 @@ bx_hard_drive_c::write(Bit32u address, B
|
||||
} else if (BX_SELECTED_CONTROLLER.reset_in_progress &&
|
||||
!BX_SELECTED_CONTROLLER.control.reset) {
|
||||
// Clear BSY and DRDY
|
||||
@ -831,7 +830,7 @@
|
||||
for (int id = 0; id < 2; id++) {
|
||||
BX_CONTROLLER(id).status.busy = 0;
|
||||
BX_CONTROLLER(id).status.drive_ready = 1;
|
||||
@@ -1606,7 +1611,7 @@ bx_hard_drive_c::write(Bit32u address, B
|
||||
@@ -1606,7 +1608,7 @@ bx_hard_drive_c::write(Bit32u address, B
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -840,7 +839,7 @@
|
||||
(unsigned) address, (unsigned) value);
|
||||
}
|
||||
}
|
||||
@@ -1619,7 +1624,7 @@ bx_hard_drive_c::close_harddrive(void)
|
||||
@@ -1619,7 +1621,7 @@ bx_hard_drive_c::close_harddrive(void)
|
||||
}
|
||||
|
||||
|
||||
@ -849,7 +848,7 @@
|
||||
|
||||
Bit32u
|
||||
bx_hard_drive_c::calculate_logical_address()
|
||||
@@ -1637,8 +1642,21 @@ bx_hard_drive_c::calculate_logical_addre
|
||||
@@ -1637,8 +1639,21 @@ bx_hard_drive_c::calculate_logical_addre
|
||||
(BX_SELECTED_CONTROLLER.sector_no - 1);
|
||||
|
||||
if (logical_sector >=
|
||||
@ -873,7 +872,7 @@
|
||||
}
|
||||
return logical_sector;
|
||||
}
|
||||
@@ -1675,7 +1693,7 @@ bx_hard_drive_c::identify_ATAPI_drive(un
|
||||
@@ -1675,7 +1690,7 @@ bx_hard_drive_c::identify_ATAPI_drive(un
|
||||
unsigned i;
|
||||
|
||||
if (drive != (unsigned)BX_HD_THIS drive_select) {
|
||||
@ -882,7 +881,7 @@
|
||||
}
|
||||
|
||||
BX_SELECTED_HD.id_drive[0] = (2 << 14) | (5 << 8) | (1 << 7) | (2 << 5) | (0 << 0); // Removable CDROM, 50us response, 12 byte packets
|
||||
@@ -1779,7 +1797,7 @@ bx_hard_drive_c::identify_drive(unsigned
|
||||
@@ -1779,7 +1794,7 @@ bx_hard_drive_c::identify_drive(unsigned
|
||||
Bit16u temp16;
|
||||
|
||||
if (drive != BX_HD_THIS drive_select) {
|
||||
@ -891,7 +890,7 @@
|
||||
}
|
||||
|
||||
#if defined(CONNER_CFA540A)
|
||||
@@ -2108,8 +2126,8 @@ bx_hard_drive_c::identify_drive(unsigned
|
||||
@@ -2108,8 +2123,8 @@ bx_hard_drive_c::identify_drive(unsigned
|
||||
|
||||
#endif
|
||||
|
||||
@ -902,7 +901,7 @@
|
||||
|
||||
// now convert the id_drive array (native 256 word format) to
|
||||
// the controller buffer (512 bytes)
|
||||
@@ -2124,13 +2142,13 @@ bx_hard_drive_c::identify_drive(unsigned
|
||||
@@ -2124,13 +2139,13 @@ bx_hard_drive_c::identify_drive(unsigned
|
||||
bx_hard_drive_c::init_send_atapi_command(Bit8u command, int req_length, int alloc_length, bool lazy)
|
||||
{
|
||||
if (BX_SELECTED_CONTROLLER.byte_count == 0)
|
||||
@ -919,7 +918,7 @@
|
||||
|
||||
BX_SELECTED_CONTROLLER.interrupt_reason.i_o = 1;
|
||||
BX_SELECTED_CONTROLLER.interrupt_reason.c_d = 0;
|
||||
@@ -2218,19 +2236,19 @@ void
|
||||
@@ -2218,19 +2233,19 @@ void
|
||||
bx_hard_drive_c::raise_interrupt()
|
||||
{
|
||||
if (!BX_SELECTED_CONTROLLER.control.disable_irq) {
|
||||
@ -944,7 +943,7 @@
|
||||
BX_SELECTED_CONTROLLER.current_command = 0;
|
||||
BX_SELECTED_CONTROLLER.status.busy = 0;
|
||||
BX_SELECTED_CONTROLLER.status.drive_ready = 1;
|
||||
@@ -2263,7 +2281,7 @@ int default_image_t::open (const char* p
|
||||
@@ -2263,7 +2278,7 @@ int default_image_t::open (const char* p
|
||||
int ret = fstat(fd, &stat_buf);
|
||||
if (ret) {
|
||||
perror("fstat'ing hard drive image file");
|
||||
@ -953,7 +952,7 @@
|
||||
}
|
||||
|
||||
return fd;
|
||||
@@ -2294,7 +2312,7 @@ ssize_t default_image_t::write (const vo
|
||||
@@ -2294,7 +2309,7 @@ ssize_t default_image_t::write (const vo
|
||||
error_recovery_t::error_recovery_t ()
|
||||
{
|
||||
if (sizeof(error_recovery_t) != 8) {
|
||||
|
@ -1,12 +1,12 @@
|
||||
$OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
$OpenBSD: patch-iodev_keyboard_cc,v 1.2 2001/03/30 16:47:03 todd Exp $
|
||||
--- iodev/keyboard.cc.orig Sat Mar 25 21:28:49 2000
|
||||
+++ iodev/keyboard.cc Tue Oct 31 12:27:44 2000
|
||||
+++ iodev/keyboard.cc Fri Mar 30 10:45:28 2001
|
||||
@@ -131,7 +131,7 @@ bx_keyb_c::init(bx_devices_c *d, bx_cmos
|
||||
BX_KEY_THIS s.kbd_controller.irq1_requested = 0;
|
||||
BX_KEY_THIS s.kbd_controller.irq12_requested = 0;
|
||||
|
||||
-//fprintf(stderr, "# keyboard_serial_delay is %u usec\n",
|
||||
+//bio->printf("#KBD] keyboard_serial_delay is %u usec\n",
|
||||
+//bio->printd("#KBD] keyboard_serial_delay is %u usec\n",
|
||||
// (unsigned) bx_options.keyboard_serial_delay);
|
||||
BX_KEY_THIS s.kbd_controller.timer_pending = 0;
|
||||
|
||||
@ -17,14 +17,14 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- if (io_len > 1)
|
||||
- bx_panic("kbd: io read to address %08x, len=%u\n",
|
||||
+ if (io_len > 1) {
|
||||
+ bio->printf("[KBD] io read to address %08x, len=%u\n",
|
||||
+ bio->printd("[KBD] io read to address %08x, len=%u\n",
|
||||
(unsigned) address, (unsigned) io_len);
|
||||
+ return ret;
|
||||
+ }
|
||||
|
||||
|
||||
-//fprintf(stderr, "# KBD: read from port 0x%04x\n", (unsigned) address);
|
||||
+//bio->printf("#KBD] read from port 0x%04x\n", (unsigned) address);
|
||||
+//bio->printd("#KBD] read from port 0x%04x\n", (unsigned) address);
|
||||
|
||||
if (address == 0x60) { /* output buffer */
|
||||
Bit8u val;
|
||||
@ -33,13 +33,13 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
}
|
||||
|
||||
-//bx_printf("mouse: ___io_read aux = 0x%02x\n", (unsigned) val);
|
||||
+//bio->printf("[MOUSE] ___io_read aux = 0x%02x\n", (unsigned) val);
|
||||
+//bio->printd("[MOUSE] ___io_read aux = 0x%02x\n", (unsigned) val);
|
||||
|
||||
activate_timer();
|
||||
- if (bx_dbg.keyboard)
|
||||
- bx_printf("KBD: READ(%02x) = %02x\n", (unsigned) address,
|
||||
+ if (bio->getdbg().keyboard)
|
||||
+ bio->printf("[KBD] READ(%02x) = %02x\n", (unsigned) address,
|
||||
+ bio->printd("[KBD] READ(%02x) = %02x\n", (unsigned) address,
|
||||
(unsigned) val);
|
||||
RETURN(val);
|
||||
}
|
||||
@ -48,7 +48,7 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
BX_KEY_THIS s.kbd_controller.outb = 0;
|
||||
BX_KEY_THIS s.kbd_controller.auxb = 0;
|
||||
-//fprintf(stderr, "# ___io_read kbd\n");
|
||||
+//bio->printf("#MOUSE] ___io_read kbd\n");
|
||||
+//bio->printd("#MOUSE] ___io_read kbd\n");
|
||||
|
||||
if (BX_KEY_THIS s.controller_Qsize) {
|
||||
unsigned i;
|
||||
@ -59,7 +59,7 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- if (bx_dbg.keyboard)
|
||||
- bx_printf("KBD: READ(%02x) = %02x\n", (unsigned) address,
|
||||
+ if (bio->getdbg().keyboard)
|
||||
+ bio->printf("[KBD] READ(%02x) = %02x\n", (unsigned) address,
|
||||
+ bio->printd("[KBD] READ(%02x) = %02x\n", (unsigned) address,
|
||||
(unsigned) val);
|
||||
RETURN(val);
|
||||
}
|
||||
@ -68,8 +68,8 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- bx_printf("KBD: num_elements = %d\n", BX_KEY_THIS s.kbd_internal_buffer.num_elements);
|
||||
- bx_printf("KBD: read from port 60h with outb empty\n");
|
||||
+ if (bio->getdbg().keyboard) {
|
||||
+ bio->printf("[KBD] num_elements = %d\n", BX_KEY_THIS s.kbd_internal_buffer.num_elements);
|
||||
+ bio->printf("[KBD] read from port 60h with outb empty\n");
|
||||
+ bio->printd("[KBD] num_elements = %d\n", BX_KEY_THIS s.kbd_internal_buffer.num_elements);
|
||||
+ bio->printd("[KBD] read from port 60h with outb empty\n");
|
||||
}
|
||||
val = 0;
|
||||
RETURN(val);
|
||||
@ -80,14 +80,14 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- if (bx_dbg.keyboard)
|
||||
- bx_printf("KBD: IO read from port 64h, system 8255 mode register\n");
|
||||
+ if (bio->getdbg().keyboard)
|
||||
+ bio->printf("[KBD] IO read from port 64h, system 8255 mode register\n");
|
||||
+ bio->printd("[KBD] IO read from port 64h, system 8255 mode register\n");
|
||||
RETURN(BX_KEY_THIS s.kbd_controller.outb);
|
||||
}
|
||||
#endif /* BX_CPU_LEVEL > 0 */
|
||||
|
||||
else {
|
||||
- bx_panic("KBD: unknown address in io read to keyboard port %x\n",
|
||||
+ bio->printf("[KBD] unknown address in io read to keyboard port %x\n",
|
||||
+ bio->printd("[KBD] unknown address in io read to keyboard port %x\n",
|
||||
(unsigned) address);
|
||||
RETURN(0); /* keep compiler happy */
|
||||
}
|
||||
@ -96,7 +96,7 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- if (bx_dbg.keyboard)
|
||||
- bx_printf("keyboard: 8-bit read from %04x = %02x\n", (unsigned)address, ret);
|
||||
+ if (bio->getdbg().keyboard)
|
||||
+ bio->printf("[KBD] 8-bit read from %04x = %02x\n", (unsigned)address, ret);
|
||||
+ bio->printd("[KBD] 8-bit read from %04x = %02x\n", (unsigned)address, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -107,7 +107,7 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- if (io_len > 1)
|
||||
- bx_panic("kbd: io write to address %08x, len=%u\n",
|
||||
+ if (io_len > 1) {
|
||||
+ bio->printf("[KBD] io write to address %08x, len=%u\n",
|
||||
+ bio->printd("[KBD] io write to address %08x, len=%u\n",
|
||||
(unsigned) address, (unsigned) io_len);
|
||||
+ return;
|
||||
+ }
|
||||
@ -115,11 +115,11 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- if (bx_dbg.keyboard)
|
||||
- bx_printf("keyboard: 8-bit write to %04x = %02x\n", (unsigned)address, (unsigned)value);
|
||||
+ if (bio->getdbg().keyboard)
|
||||
+ bio->printf("[KBD] 8-bit write to %04x = %02x\n", (unsigned)address, (unsigned)value);
|
||||
+ bio->printd("[KBD] 8-bit write to %04x = %02x\n", (unsigned)address, (unsigned)value);
|
||||
|
||||
|
||||
-//fprintf(stderr, "# KBD: WRITE(%02x) = %02x\n", (unsigned) address,
|
||||
+//bio->printf("[KBD] WRITE(%02x) = %02x\n", (unsigned) address,
|
||||
+//bio->printd("[KBD] WRITE(%02x) = %02x\n", (unsigned) address,
|
||||
// (unsigned) value);
|
||||
|
||||
switch (address) {
|
||||
@ -128,7 +128,7 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
BX_KEY_THIS s.kbd_controller.c_d = 0;
|
||||
if (BX_KEY_THIS s.kbd_controller.inpb) {
|
||||
- bx_panic("KBD: write to port 60h, not ready for write\n");
|
||||
+ bio->printf("[KBD] write to port 60h, not ready for write\n");
|
||||
+ bio->printd("[KBD] write to port 60h, not ready for write\n");
|
||||
+ break;
|
||||
}
|
||||
switch (BX_KEY_THIS s.kbd_controller.last_comm) {
|
||||
@ -138,11 +138,11 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
BX_KEY_THIS s.kbd_controller.irq1_requested = 1;
|
||||
|
||||
-//fprintf(stderr, "# allow_irq12 set to %u\n", (unsigned)
|
||||
+//bio->printf("#KBD] allow_irq12 set to %u\n", (unsigned)
|
||||
+//bio->printd("#KBD] allow_irq12 set to %u\n", (unsigned)
|
||||
// BX_KEY_THIS s.kbd_controller.allow_irq12);
|
||||
if ( !scan_convert )
|
||||
- bx_printf("keyboard: (mch) scan convert turned off\n");
|
||||
+ bio->printf("[KBD] (mch) scan convert turned off\n");
|
||||
+ bio->printd("[KBD] (mch) scan convert turned off\n");
|
||||
|
||||
// (mch) NT needs this
|
||||
BX_KEY_THIS s.kbd_controller.scan_convert = scan_convert;
|
||||
@ -152,12 +152,12 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- if (bx_dbg.keyboard)
|
||||
- bx_printf("KBD: write output port with value %02xh\n",
|
||||
+ if (bio->getdbg().keyboard)
|
||||
+ bio->printf("[KBD] write output port with value %02xh\n",
|
||||
+ bio->printd("[KBD] write output port with value %02xh\n",
|
||||
(unsigned) value);
|
||||
BX_SET_ENABLE_A20( (value & 0x02) != 0 );
|
||||
- if (!(value & 0x01)) bx_panic("KBD: IO write: processor reset requested!\n");
|
||||
+ if (!(value & 0x01)) /* XXX insert reset?? */
|
||||
+ bio->printf("[KBD] IO write: processor reset requested!\n");
|
||||
+ bio->printd("[KBD] IO write: processor reset requested!\n");
|
||||
break;
|
||||
case 0xd4: // Write to mouse
|
||||
// I don't think this enables the AUX clock
|
||||
@ -166,7 +166,7 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
|
||||
default:
|
||||
- bx_panic("KBD: === unsupported write to port 60h(lastcomm=%02x): %02x\n",
|
||||
+ bio->printf("[KBD] === unsupported write to port 60h(lastcomm=%02x): %02x\n",
|
||||
+ bio->printd("[KBD] === unsupported write to port 60h(lastcomm=%02x): %02x\n",
|
||||
(unsigned) BX_KEY_THIS s.kbd_controller.last_comm, (unsigned) value);
|
||||
}
|
||||
}
|
||||
@ -175,77 +175,80 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
/* ??? should conditionally pass to mouse device here ??? */
|
||||
if (BX_KEY_THIS s.kbd_controller.kbd_clock_enabled==0) {
|
||||
- bx_printf("KBD: keyboard disabled & send of byte %02x to kbd\n",
|
||||
+ bio->printf("[KBD] keyboard disabled & send of byte %02x to kbd\n",
|
||||
+ bio->printd("[KBD] keyboard disabled & send of byte %02x to kbd\n",
|
||||
(unsigned) value);
|
||||
}
|
||||
kbd_ctrl_to_kbd(value);
|
||||
@@ -402,11 +408,11 @@ bx_keyb_c::write( Bit32u address, Bit3
|
||||
@@ -402,11 +408,12 @@ bx_keyb_c::write( Bit32u address, Bit3
|
||||
|
||||
switch (value) {
|
||||
case 0x20: // get keyboard command byte
|
||||
- if (bx_dbg.keyboard)
|
||||
- bx_printf("KBD: get keyboard command byte\n");
|
||||
+ if (bio->getdbg().keyboard)
|
||||
+ bio->printf("[KBD] get keyboard command byte\n");
|
||||
+ bio->printd("[KBD] get keyboard command byte\n");
|
||||
// controller output buffer must be empty
|
||||
if (BX_KEY_THIS s.kbd_controller.outb) {
|
||||
-bx_panic("kbd: OUTB set and command 0x%02x encountered\n", value);
|
||||
+bio->printf("[KBD] OUTB set and command 0x%02x encountered\n", value);
|
||||
+ bio->printd("[KBD] OUTB set and command 0x%02x encountered\n",
|
||||
+ value);
|
||||
break;
|
||||
}
|
||||
command_byte =
|
||||
@@ -420,37 +426,37 @@ bx_panic("kbd: OUTB set and command 0x%0
|
||||
@@ -420,37 +427,39 @@ bx_panic("kbd: OUTB set and command 0x%0
|
||||
controller_enQ(command_byte, 0);
|
||||
break;
|
||||
case 0x60: // write command byte
|
||||
- if (bx_dbg.keyboard)
|
||||
- bx_printf("KBD: write command byte\n");
|
||||
+ if (bio->getdbg().keyboard)
|
||||
+ bio->printf("[KBD] write command byte\n");
|
||||
+ bio->printd("[KBD] write command byte\n");
|
||||
// following byte written to port 60h is command byte
|
||||
BX_KEY_THIS s.kbd_controller.expecting_port60h = 1;
|
||||
break;
|
||||
|
||||
case 0xa1:
|
||||
- bx_printf ("KBD: Dummy out Green PC for now : 0xa1\n");
|
||||
+ bio->printf ("[KBD] Dummy out Green PC for now : 0xa1\n");
|
||||
+ bio->printd ("[KBD] Dummy out Green PC for now : 0xa1\n");
|
||||
break;
|
||||
|
||||
case 0xa7: // disable the aux device
|
||||
set_aux_clock_enable(0);
|
||||
- if (bx_dbg.keyboard) bx_printf("KBD: aux device disabled\n");
|
||||
+ if (bio->getdbg().keyboard) bio->printf("[KBD] aux device disabled\n");
|
||||
+ if (bio->getdbg().keyboard) bio->printd("[KBD] aux device disabled\n");
|
||||
break;
|
||||
case 0xa8: // enable the aux device
|
||||
set_aux_clock_enable(1);
|
||||
- if (bx_dbg.keyboard) bx_printf("KBD: aux device enabled\n");
|
||||
+ if (bio->getdbg().keyboard) bio->printf("[KBD] aux device enabled\n");
|
||||
+ if (bio->getdbg().keyboard) bio->printd("[KBD] aux device enabled\n");
|
||||
break;
|
||||
case 0xa9: // Test Mouse Port
|
||||
// controller output buffer must be empty
|
||||
if (BX_KEY_THIS s.kbd_controller.outb) {
|
||||
-bx_panic("kbd: OUTB set and command 0x%02x encountered\n", value);
|
||||
+bio->printf("[KBD] OUTB set and command 0x%02x encountered\n", value);
|
||||
+ bio->printd("[KBD] OUTB set and command 0x%02x encountered\n",
|
||||
+ value);
|
||||
break;
|
||||
}
|
||||
controller_enQ(0x00, 0); // no errors detected
|
||||
break;
|
||||
case 0xaa: // motherboard controller self test
|
||||
- if (bx_dbg.keyboard) bx_printf("KBD: Self Test\n");
|
||||
+ if (bio->getdbg().keyboard) bio->printf("[KBD] Self Test\n");
|
||||
+ if (bio->getdbg().keyboard) bio->printd("[KBD] Self Test\n");
|
||||
// controller output buffer must be empty
|
||||
if (BX_KEY_THIS s.kbd_controller.outb) {
|
||||
-bx_panic("kbd: OUTB set and command 0x%02x encountered\n", value);
|
||||
+bio->printf("[KBD] OUTB set and command 0x%02x encountered\n", value);
|
||||
+ bio->printd("[KBD] OUTB set and command 0x%02x encountered\n",
|
||||
+ value);
|
||||
break;
|
||||
}
|
||||
// (mch) Why is this commented out??? Enabling
|
||||
@@ -460,34 +466,34 @@ bx_panic("kbd: OUTB set and command 0x%0
|
||||
@@ -460,34 +469,35 @@ bx_panic("kbd: OUTB set and command 0x%0
|
||||
case 0xab: // Interface Test
|
||||
// controller output buffer must be empty
|
||||
if (BX_KEY_THIS s.kbd_controller.outb) {
|
||||
-bx_panic("kbd: OUTB set and command 0x%02x encountered\n", value);
|
||||
+bio->printf("[KBD] OUTB set and command 0x%02x encountered\n", value);
|
||||
+bio->printd("[KBD] OUTB set and command 0x%02x encountered\n", value);
|
||||
break;
|
||||
}
|
||||
controller_enQ(0x00, 0);
|
||||
@ -253,18 +256,19 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
case 0xad: // disable keyboard
|
||||
set_kbd_clock_enable(0);
|
||||
- if (bx_dbg.keyboard) bx_printf("KBD: keyboard disabled\n");
|
||||
+ if (bio->getdbg().keyboard) bio->printf("[KBD] keyboard disabled\n");
|
||||
+ if (bio->getdbg().keyboard) bio->printd("[KBD] keyboard disabled\n");
|
||||
break;
|
||||
case 0xae: // enable keyboard
|
||||
set_kbd_clock_enable(1);
|
||||
- if (bx_dbg.keyboard) bx_printf("KBD: keyboard enabled\n");
|
||||
+ if (bio->getdbg().keyboard) bio->printf("[KBD] keyboard enabled\n");
|
||||
+ if (bio->getdbg().keyboard) bio->printd("[KBD] keyboard enabled\n");
|
||||
break;
|
||||
case 0xc0: // read input port
|
||||
// controller output buffer must be empty
|
||||
if (BX_KEY_THIS s.kbd_controller.outb) {
|
||||
-bx_panic("kbd: OUTB set and command 0x%02x encountered\n", value);
|
||||
+bio->printf("[KBD] OUTB set and command 0x%02x encountered\n", value);
|
||||
+ bio->printd("[KBD] OUTB set and command 0x%02x encountered\n",
|
||||
+ value);
|
||||
break;
|
||||
}
|
||||
// keyboard power normal
|
||||
@ -274,29 +278,29 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- if (bx_dbg.keyboard)
|
||||
- bx_printf("KBD: io write to port 64h, command d0h (partial)\n");
|
||||
+ if (bio->getdbg().keyboard)
|
||||
+ bio->printf("[KBD] io write to port 64h, command d0h (partial)\n");
|
||||
+ bio->printd("[KBD] io write to port 64h, command d0h (partial)\n");
|
||||
// controller output buffer must be empty
|
||||
if (BX_KEY_THIS s.kbd_controller.outb) {
|
||||
-bx_panic("kbd: OUTB set and command 0x%02x encountered\n", value);
|
||||
+bio->printf("[KBD] OUTB set and command 0x%02x encountered\n", value);
|
||||
+bio->printd("[KBD] OUTB set and command 0x%02x encountered\n", value);
|
||||
break;
|
||||
}
|
||||
controller_enQ(
|
||||
@@ -498,20 +504,20 @@ bx_panic("kbd: OUTB set and command 0x%0
|
||||
@@ -498,20 +508,20 @@ bx_panic("kbd: OUTB set and command 0x%0
|
||||
break;
|
||||
|
||||
case 0xd1: // write output port: next byte written to port 60h
|
||||
- if (bx_dbg.keyboard)
|
||||
- bx_printf("KBD: write output port\n");
|
||||
+ if (bio->getdbg().keyboard)
|
||||
+ bio->printf("[KBD] write output port\n");
|
||||
+ bio->printd("[KBD] write output port\n");
|
||||
// following byte to port 60h written to output port
|
||||
BX_KEY_THIS s.kbd_controller.expecting_port60h = 1;
|
||||
break;
|
||||
|
||||
case 0xd3: // write mouse output buffer
|
||||
- bx_panic("KBD: io write 0x64: command = 0xD3(write mouse outb)\n");
|
||||
+ bio->printf("[KBD] io write 0x64: command = 0xD3(write mouse outb)\n");
|
||||
+ bio->printd("[KBD] io write 0x64: command = 0xD3(write mouse outb)\n");
|
||||
BX_KEY_THIS s.kbd_controller.expecting_port60h = 1;
|
||||
break;
|
||||
|
||||
@ -304,16 +308,16 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- if (bx_dbg.mouse)
|
||||
- bx_printf("KBD: io write 0x64: command = 0xD4 (write to mouse)\n");
|
||||
+ if (bio->getdbg().mouse)
|
||||
+ bio->printf("[KBD] io write 0x64: command = 0xD4 (write to mouse)\n");
|
||||
+ bio->printd("[KBD] io write 0x64: command = 0xD4 (write to mouse)\n");
|
||||
// following byte written to port 60h
|
||||
BX_KEY_THIS s.kbd_controller.expecting_port60h = 1;
|
||||
break;
|
||||
@@ -522,32 +528,34 @@ bx_panic("kbd: OUTB set and command 0x%0
|
||||
@@ -522,32 +532,34 @@ bx_panic("kbd: OUTB set and command 0x%0
|
||||
case 0xc1: // Continuous Input Port Poll, Low
|
||||
case 0xc2: // Continuous Input Port Poll, High
|
||||
case 0xe0: // Read Test Inputs
|
||||
- bx_panic("KBD: io write 0x64: command = %02xh\n", (unsigned) value);
|
||||
+ bio->printf("[KBD] io write 0x64: command = %02xh\n", (unsigned) value);
|
||||
+ bio->printd("[KBD] io write 0x64: command = %02xh\n", (unsigned) value);
|
||||
break;
|
||||
|
||||
case 0xfe: // System Reset, transition to real mode
|
||||
@ -321,7 +325,7 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- bx_printf("KBD: system reset\n");
|
||||
- bx_panic("system reset via KBD ctrl command FEh\n");
|
||||
+ if (bio->getdbg().keyboard)
|
||||
+ bio->printf("[KBD] system reset via ctrl command FEh\n");
|
||||
+ bio->printd("[KBD] system reset via ctrl command FEh\n");
|
||||
+ bx_pc_system.ResetSignal( PCS_SET ); /* XXX is this right? */
|
||||
+ BX_CPU.reset(BX_RESET_HARDWARE);
|
||||
// Use bx_pc_system if necessary bx_cpu.reset_cpu();
|
||||
@ -335,12 +339,12 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- if (bx_dbg.keyboard)
|
||||
- bx_printf("KBD: io write to port 64h, useless command %02x\n",
|
||||
+ if (bio->getdbg().keyboard)
|
||||
+ bio->printf("[KBD] io write to port 64h, useless command %02x\n",
|
||||
+ bio->printd("[KBD] io write to port 64h, useless command %02x\n",
|
||||
(unsigned) value);
|
||||
return;
|
||||
}
|
||||
- bx_panic("KBD: unsupported io write to keyboard port %x, value = %x\n",
|
||||
+ bio->printf("[KBD] unsupported io write to keyboard port %x, value = %x\n",
|
||||
+ bio->printd("[KBD] unsupported io write to keyboard port %x, value = %x\n",
|
||||
(unsigned) address, (unsigned) value);
|
||||
break;
|
||||
}
|
||||
@ -348,35 +352,35 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
|
||||
- default: bx_panic("KBD: unknown address in bx_keyb_c::write()\n");
|
||||
+ default:
|
||||
+ bio->printf("[KBD] unknown address in bx_keyb_c::write()\n");
|
||||
+ bio->printd("[KBD] unknown address in bx_keyb_c::write()\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -557,15 +565,17 @@ bx_keyb_c::gen_scancode(Bit32u key)
|
||||
@@ -557,15 +569,17 @@ bx_keyb_c::gen_scancode(Bit32u key)
|
||||
{
|
||||
Bit8u scancode;
|
||||
|
||||
- if (bx_dbg.record_io) {
|
||||
- fprintf((FILE*)bx_dbg.record_io, "gen_scancode %lld %x\n", bx_pc_system.time_ticks(), key);
|
||||
+ if (bio->getdbg().record_io) {
|
||||
+ fprintf((FILE*)bio->getdbg().record_io, "gen_scancode %lld %x\n", bx_pc_system.time_ticks(), key);
|
||||
+ bio->printd("[KBD] gen_scancode %lld %x\n", bx_pc_system.time_ticks(), key);
|
||||
}
|
||||
|
||||
- if (!BX_KEY_THIS s.kbd_controller.scan_convert)
|
||||
- bx_panic("keyboard: gen_scancode with scan_convert cleared\n");
|
||||
+ if (!BX_KEY_THIS s.kbd_controller.scan_convert) {
|
||||
+ bio->printf("[KBD] gen_scancode with scan_convert cleared\n");
|
||||
+ bio->printd("[KBD] gen_scancode with scan_convert cleared\n");
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
- if (bx_dbg.keyboard)
|
||||
- bx_printf("KBD: gen_scancode(): scancode: %08x\n", (unsigned) key);
|
||||
+ if (bio->getdbg().keyboard)
|
||||
+ bio->printf("[KBD] gen_scancode(): scancode: %08x\n", (unsigned) key);
|
||||
+ bio->printd("[KBD] gen_scancode(): scancode: %08x\n", (unsigned) key);
|
||||
|
||||
// Ignore scancode if keyboard clock is driven low
|
||||
if (BX_KEY_THIS s.kbd_controller.kbd_clock_enabled==0)
|
||||
@@ -640,20 +650,21 @@ bx_keyb_c::gen_scancode(Bit32u key)
|
||||
@@ -640,20 +654,21 @@ bx_keyb_c::gen_scancode(Bit32u key)
|
||||
case BX_KEY_GRAVE: scancode = 0x29; break;
|
||||
|
||||
case BX_KEY_BACKSPACE: scancode = 0x0e; break;
|
||||
@ -386,23 +390,23 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
|
||||
case BX_KEY_LEFT:
|
||||
- //fprintf(stderr,"# Grey left-arrow key not on 83-key keyboard\n");
|
||||
+ //bio->printf("#KBD] Grey left-arrow key not on 83-key keyboard\n");
|
||||
+ //bio->printd("#KBD] Grey left-arrow key not on 83-key keyboard\n");
|
||||
scancode = 0x4b; break;
|
||||
case BX_KEY_RIGHT:
|
||||
- //fprintf(stderr,"# Grey right-arrow key not on 83-key keyboard\n");
|
||||
+ //bio->printf("#KBD] Grey right-arrow key not on 83-key keyboard\n");
|
||||
+ //bio->printd("#KBD] Grey right-arrow key not on 83-key keyboard\n");
|
||||
scancode = 0x4d; break;
|
||||
case BX_KEY_UP:
|
||||
- //fprintf(stderr,"# Grey up-arrow key not on 83-key keyboard\n");
|
||||
+ //bio->printf("#KBD] Grey up-arrow key not on 83-key keyboard\n");
|
||||
+ //bio->printd("#KBD] Grey up-arrow key not on 83-key keyboard\n");
|
||||
scancode = 0x48; break;
|
||||
case BX_KEY_DOWN:
|
||||
- //fprintf(stderr,"# Grey down-arrow key not on 83-key keyboard\n");
|
||||
+ //bio->printf("#KBD] Grey down-arrow key not on 83-key keyboard\n");
|
||||
+ //bio->printd("#KBD] Grey down-arrow key not on 83-key keyboard\n");
|
||||
scancode = 0x50; break;
|
||||
|
||||
case BX_KEY_KP_LEFT: scancode = 0x4b; break;
|
||||
@@ -661,43 +672,46 @@ bx_keyb_c::gen_scancode(Bit32u key)
|
||||
@@ -661,43 +676,46 @@ bx_keyb_c::gen_scancode(Bit32u key)
|
||||
case BX_KEY_KP_UP: scancode = 0x48; break;
|
||||
case BX_KEY_KP_DOWN: scancode = 0x50; break;
|
||||
|
||||
@ -425,22 +429,22 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- fprintf(stderr,"# Grey page-down key not on 83-key keyboard\n");
|
||||
- return;
|
||||
+ //case BX_KEY_INSERT:
|
||||
+ //bio->printf("#KBD] Grey insert key not on 83-key keyboard\n");
|
||||
+ //bio->printd("#KBD] Grey insert key not on 83-key keyboard\n");
|
||||
+ //return;
|
||||
+ //case BX_KEY_DELETE:
|
||||
+ //bio->printf("#KBD] Grey delete key not on 83-key keyboard\n");
|
||||
+ //bio->printd("#KBD] Grey delete key not on 83-key keyboard\n");
|
||||
+ //return;
|
||||
+ //case BX_KEY_HOME:
|
||||
+ //bio->printf("#KBD] Grey home key not on 83-key keyboard\n");
|
||||
+ //bio->printd("#KBD] Grey home key not on 83-key keyboard\n");
|
||||
+ //return;
|
||||
+ //case BX_KEY_END:
|
||||
+ //bio->printf("#KBD] Grey end key not on 83-key keyboard\n");
|
||||
+ //bio->printd("#KBD] Grey end key not on 83-key keyboard\n");
|
||||
+ //return;
|
||||
+ //case BX_KEY_PAGE_UP:
|
||||
+ //bio->printf("#KBD] Grey page-up key not on 83-key keyboard\n");
|
||||
+ //bio->printd("#KBD] Grey page-up key not on 83-key keyboard\n");
|
||||
+ //return;
|
||||
+ //case BX_KEY_PAGE_DOWN:
|
||||
+ //bio->printf("#KBD] Grey page-down key not on 83-key keyboard\n");
|
||||
+ //bio->printd("#KBD] Grey page-down key not on 83-key keyboard\n");
|
||||
+ //return;
|
||||
|
||||
+ case BX_KEY_INSERT:
|
||||
@ -464,87 +468,87 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- return;
|
||||
case BX_KEY_KP_MULTIPLY:
|
||||
- fprintf(stderr,"# Grey Multiply key not on 83-key keyboard\n");
|
||||
+ bio->printf("#KBD] Grey Multiply key not on 83-key keyboard\n");
|
||||
+ bio->printd("#KBD] Grey Multiply key not on 83-key keyboard\n");
|
||||
return;
|
||||
case BX_KEY_KP_DIVIDE:
|
||||
- fprintf(stderr,"# Grey Divide key not on 83-key keyboard\n");
|
||||
+ bio->printf("#KBD] Grey Divide key not on 83-key keyboard\n");
|
||||
+ bio->printd("#KBD] Grey Divide key not on 83-key keyboard\n");
|
||||
return;
|
||||
case BX_KEY_NUM_LOCK: scancode = 0x45; break;
|
||||
|
||||
@@ -713,7 +727,7 @@ bx_keyb_c::gen_scancode(Bit32u key)
|
||||
@@ -713,7 +731,7 @@ bx_keyb_c::gen_scancode(Bit32u key)
|
||||
case BX_KEY_F10: scancode = 0x44; break;
|
||||
|
||||
default:
|
||||
- fprintf(stderr, "# bx_keyb_c::gen_scancode : Unhandled %u\n",
|
||||
+ bio->printf("#KBD] bx_keyb_c::gen_scancode : Unhandled %u\n",
|
||||
+ bio->printd("#KBD] bx_keyb_c::gen_scancode : Unhandled %u\n",
|
||||
(unsigned) key);
|
||||
return;
|
||||
}
|
||||
@@ -750,8 +764,8 @@ bx_keyb_c::set_aux_clock_enable(Bit8u
|
||||
@@ -750,8 +768,8 @@ bx_keyb_c::set_aux_clock_enable(Bit8u
|
||||
{
|
||||
Boolean prev_aux_clock_enabled;
|
||||
|
||||
- if (bx_dbg.keyboard)
|
||||
- bx_printf("set_aux_clock_enable(%u)\n", (unsigned) value);
|
||||
+ if (bio->getdbg().keyboard)
|
||||
+ bio->printf("[KBD] set_aux_clock_enable(%u)\n", (unsigned) value);
|
||||
+ bio->printd("[KBD] set_aux_clock_enable(%u)\n", (unsigned) value);
|
||||
if (value==0) {
|
||||
BX_KEY_THIS s.kbd_controller.aux_clock_enabled = 0;
|
||||
}
|
||||
@@ -768,8 +782,8 @@ bx_keyb_c::set_aux_clock_enable(Bit8u
|
||||
@@ -768,8 +786,8 @@ bx_keyb_c::set_aux_clock_enable(Bit8u
|
||||
bx_keyb_c::get_kbd_enable(void)
|
||||
{
|
||||
#ifdef BX_DEBUG
|
||||
- if (bx_dbg.keyboard)
|
||||
- bx_printf("KBD: get_kbd_enable(): getting kbd_clock_enabled of: %02x\n",
|
||||
+ if (bio->getdbg().keyboard)
|
||||
+ bio->printf("[KBD] get_kbd_enable(): getting kbd_clock_enabled of: %02x\n",
|
||||
+ bio->printd("[KBD] get_kbd_enable(): getting kbd_clock_enabled of: %02x\n",
|
||||
(unsigned) BX_KEY_THIS s.kbd_controller.kbd_clock_enabled);
|
||||
#endif
|
||||
|
||||
@@ -781,16 +795,16 @@ bx_keyb_c::controller_enQ(Bit8u data,
|
||||
@@ -781,16 +799,16 @@ bx_keyb_c::controller_enQ(Bit8u data,
|
||||
{
|
||||
// source is 0 for keyboard, 1 for mouse
|
||||
|
||||
- if (bx_dbg.keyboard)
|
||||
- bx_printf("controller_enQ(%02x)\n", (unsigned) data);
|
||||
+ if (bio->getdbg().keyboard)
|
||||
+ bio->printf("[KBD] controller_enQ(%02x)\n", (unsigned) data);
|
||||
+ bio->printd("[KBD] controller_enQ(%02x)\n", (unsigned) data);
|
||||
|
||||
if (BX_KEY_THIS s.kbd_controller.outb)
|
||||
- bx_printf("KBD: controller_enQ(): OUTB set!\n");
|
||||
+ bio->printf("[KBD] controller_enQ(): OUTB set!\n");
|
||||
+ bio->printd("[KBD] controller_enQ(): OUTB set!\n");
|
||||
|
||||
// see if we need to Q this byte from the controller
|
||||
if (BX_KEY_THIS s.kbd_controller.outb) {
|
||||
if (BX_KEY_THIS s.controller_Qsize >= BX_KBD_CONTROLLER_QSIZE)
|
||||
- bx_panic("KBD: controller_enq(): controller_Q full!\n");
|
||||
+ bio->printf("[KBD] controller_enq(): controller_Q full!\n");
|
||||
+ bio->printd("[KBD] controller_enq(): controller_Q full!\n");
|
||||
BX_KEY_THIS s.controller_Q[BX_KEY_THIS s.controller_Qsize++] = data;
|
||||
BX_KEY_THIS s.controller_Qsource = source;
|
||||
return;
|
||||
@@ -820,7 +834,7 @@ bx_keyb_c::kbd_enQ_imm(Bit8u val)
|
||||
@@ -820,7 +838,7 @@ bx_keyb_c::kbd_enQ_imm(Bit8u val)
|
||||
int tail;
|
||||
|
||||
if (BX_KEY_THIS s.kbd_internal_buffer.num_elements >= BX_KBD_ELEMENTS) {
|
||||
- bx_panic("KBD: internal keyboard buffer full (imm)\n");
|
||||
+ bio->printf("[KBD] internal keyboard buffer full (imm)\n");
|
||||
+ bio->printd("[KBD] internal keyboard buffer full (imm)\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -841,18 +855,18 @@ bx_keyb_c::kbd_enQ(Bit8u scancode)
|
||||
@@ -841,18 +859,18 @@ bx_keyb_c::kbd_enQ(Bit8u scancode)
|
||||
{
|
||||
int tail;
|
||||
|
||||
- if (bx_dbg.keyboard)
|
||||
- bx_printf("enQ(%02x)\n", (unsigned) scancode);
|
||||
+ if (bio->getdbg().keyboard)
|
||||
+ bio->printf("[KBD] enQ(%02x)\n", (unsigned) scancode);
|
||||
+ bio->printd("[KBD] enQ(%02x)\n", (unsigned) scancode);
|
||||
|
||||
if (BX_KEY_THIS s.kbd_internal_buffer.num_elements >= BX_KBD_ELEMENTS) {
|
||||
- bx_printf("KBD: internal keyboard buffer full, ignoring scancode.(%02x)\n",
|
||||
+ bio->printf("[KBD] internal keyboard buffer full, ignoring scancode.(%02x)\n",
|
||||
+ bio->printd("[KBD] internal keyboard buffer full, ignoring scancode.(%02x)\n",
|
||||
(unsigned) scancode);
|
||||
return;
|
||||
}
|
||||
@ -553,16 +557,16 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- if (bx_dbg.keyboard)
|
||||
- bx_printf("KBD: enQ: putting scancode %02x in internal buffer\n",
|
||||
+ if (bio->getdbg().keyboard)
|
||||
+ bio->printf("[KBD] enQ: putting scancode %02x in internal buffer\n",
|
||||
+ bio->printd("[KBD] enQ: putting scancode %02x in internal buffer\n",
|
||||
(unsigned) scancode);
|
||||
tail = (BX_KEY_THIS s.kbd_internal_buffer.head + BX_KEY_THIS s.kbd_internal_buffer.num_elements) %
|
||||
BX_KBD_ELEMENTS;
|
||||
@@ -861,14 +875,14 @@ bx_keyb_c::kbd_enQ(Bit8u scancode)
|
||||
@@ -861,14 +879,14 @@ bx_keyb_c::kbd_enQ(Bit8u scancode)
|
||||
|
||||
if (!BX_KEY_THIS s.kbd_controller.outb && BX_KEY_THIS s.kbd_controller.kbd_clock_enabled) {
|
||||
activate_timer();
|
||||
-//fprintf(stderr, "# activating timer...\n");
|
||||
+//bio->printf("#KBD] activating timer...\n");
|
||||
+//bio->printd("#KBD] activating timer...\n");
|
||||
return;
|
||||
}
|
||||
-//fprintf(stderr, "# not activating timer...\n");
|
||||
@ -570,49 +574,49 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
-//fprintf(stderr, "# outb = %u\n", (unsigned) BX_KEY_THIS s.kbd_controller.outb);
|
||||
-//fprintf(stderr, "# clock_enab = %u\n", (unsigned) BX_KEY_THIS s.kbd_controller.kbd_clock_enabled);
|
||||
-//fprintf(stderr, "# out_buffer = %u\n", (unsigned) BX_KEY_THIS s.kbd_controller.kbd_output_buffer);
|
||||
+//bio->printf("#KBD] not activating timer...\n");
|
||||
+//bio->printf("#KBD] allow_irq1 = %u\n", (unsigned) BX_KEY_THIS s.kbd_controller.allow_irq1);
|
||||
+//bio->printf("#KBD] outb = %u\n", (unsigned) BX_KEY_THIS s.kbd_controller.outb);
|
||||
+//bio->printf("#KBD] clock_enab = %u\n", (unsigned) BX_KEY_THIS s.kbd_controller.kbd_clock_enabled);
|
||||
+//bio->printf("#KBD] out_buffer = %u\n", (unsigned) BX_KEY_THIS s.kbd_controller.kbd_output_buffer);
|
||||
+//bio->printd("#KBD] not activating timer...\n");
|
||||
+//bio->printd("#KBD] allow_irq1 = %u\n", (unsigned) BX_KEY_THIS s.kbd_controller.allow_irq1);
|
||||
+//bio->printd("#KBD] outb = %u\n", (unsigned) BX_KEY_THIS s.kbd_controller.outb);
|
||||
+//bio->printd("#KBD] clock_enab = %u\n", (unsigned) BX_KEY_THIS s.kbd_controller.kbd_clock_enabled);
|
||||
+//bio->printd("#KBD] out_buffer = %u\n", (unsigned) BX_KEY_THIS s.kbd_controller.kbd_output_buffer);
|
||||
}
|
||||
|
||||
Boolean
|
||||
@@ -878,7 +892,7 @@ bx_keyb_c::mouse_enQ_packet(Bit8u b1,
|
||||
@@ -878,7 +896,7 @@ bx_keyb_c::mouse_enQ_packet(Bit8u b1,
|
||||
return(0); /* buffer doesn't have the space */
|
||||
}
|
||||
|
||||
-//bx_printf("mouse: enQ_packet(%02x, %02x, %02x)\n",
|
||||
+//bio->printf("[MOUSE] enQ_packet(%02x, %02x, %02x)\n",
|
||||
+//bio->printd("[MOUSE] enQ_packet(%02x, %02x, %02x)\n",
|
||||
// (unsigned) b1, (unsigned) b2, (unsigned) b3);
|
||||
|
||||
mouse_enQ(b1);
|
||||
@@ -893,15 +907,15 @@ bx_keyb_c::mouse_enQ(Bit8u mouse_data)
|
||||
@@ -893,15 +911,15 @@ bx_keyb_c::mouse_enQ(Bit8u mouse_data)
|
||||
{
|
||||
int tail;
|
||||
|
||||
- if (bx_dbg.mouse)
|
||||
- bx_printf("mouse_enQ(%02x)\n", (unsigned) mouse_data);
|
||||
+ if (bio->getdbg().mouse)
|
||||
+ bio->printf("[MOUSE] mouse_enQ(%02x)\n", (unsigned) mouse_data);
|
||||
+ bio->printd("[MOUSE] mouse_enQ(%02x)\n", (unsigned) mouse_data);
|
||||
|
||||
if (BX_KEY_THIS s.mouse_internal_buffer.num_elements >= BX_MOUSE_BUFF_SIZE) {
|
||||
- bx_printf("mouse: internal mouse buffer full, ignoring mouse data.(%02x)\n",
|
||||
+ bio->printf("[MOUSE] internal mouse buffer full, ignoring mouse data.(%02x)\n",
|
||||
+ bio->printd("[MOUSE] internal mouse buffer full, ignoring mouse data.(%02x)\n",
|
||||
(unsigned) mouse_data);
|
||||
return;
|
||||
}
|
||||
-//fprintf(stderr, "# mouse_enq() aux_clock_enabled = %u\n",
|
||||
+//bio->printf("#MOUSE] mouse_enq() aux_clock_enabled = %u\n",
|
||||
+//bio->printd("#MOUSE] mouse_enq() aux_clock_enabled = %u\n",
|
||||
// (unsigned) BX_KEY_THIS s.kbd_controller.aux_clock_enabled);
|
||||
|
||||
/* enqueue mouse data in multibyte internal mouse buffer */
|
||||
@@ -912,33 +926,33 @@ bx_keyb_c::mouse_enQ(Bit8u mouse_data)
|
||||
@@ -912,33 +930,33 @@ bx_keyb_c::mouse_enQ(Bit8u mouse_data)
|
||||
|
||||
if (!BX_KEY_THIS s.kbd_controller.outb && BX_KEY_THIS s.kbd_controller.aux_clock_enabled) {
|
||||
activate_timer();
|
||||
-//fprintf(stderr, "# activating timer...\n");
|
||||
+//bio->printf("#MOUSE] activating timer...\n");
|
||||
+//bio->printd("#MOUSE] activating timer...\n");
|
||||
return;
|
||||
}
|
||||
-//fprintf(stderr, "# not activating timer...\n");
|
||||
@ -620,11 +624,11 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
-//fprintf(stderr, "# outb = %u\n", (unsigned) BX_KEY_THIS s.kbd_controller.outb);
|
||||
-//fprintf(stderr, "# clock_enab = %u\n", (unsigned) BX_KEY_THIS s.kbd_controller.aux_clock_enabled);
|
||||
-//fprintf(stderr, "# out_buffer = %u\n", (unsigned) BX_KEY_THIS s.kbd_controller.aux_output_buffer);
|
||||
+//bio->printf("#MOUSE] not activating timer...\n");
|
||||
+//bio->printf("#MOUSE] allow_irq12= %u\n", (unsigned) BX_KEY_THIS s.kbd_controller.allow_irq12);
|
||||
+//bio->printf("#MOUSE] outb = %u\n", (unsigned) BX_KEY_THIS s.kbd_controller.outb);
|
||||
+//bio->printf("#MOUSE] clock_enab = %u\n", (unsigned) BX_KEY_THIS s.kbd_controller.aux_clock_enabled);
|
||||
+//bio->printf("#MOUSE] out_buffer = %u\n", (unsigned) BX_KEY_THIS s.kbd_controller.aux_output_buffer);
|
||||
+//bio->printd("#MOUSE] not activating timer...\n");
|
||||
+//bio->printd("#MOUSE] allow_irq12= %u\n", (unsigned) BX_KEY_THIS s.kbd_controller.allow_irq12);
|
||||
+//bio->printd("#MOUSE] outb = %u\n", (unsigned) BX_KEY_THIS s.kbd_controller.outb);
|
||||
+//bio->printd("#MOUSE] clock_enab = %u\n", (unsigned) BX_KEY_THIS s.kbd_controller.aux_clock_enabled);
|
||||
+//bio->printd("#MOUSE] out_buffer = %u\n", (unsigned) BX_KEY_THIS s.kbd_controller.aux_output_buffer);
|
||||
}
|
||||
|
||||
void
|
||||
@ -633,7 +637,7 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- if (bx_dbg.keyboard)
|
||||
- bx_printf("KBD: controller passed byte %02xh to keyboard\n");
|
||||
+ if (bio->getdbg().keyboard)
|
||||
+ bio->printf("[KBD] controller passed byte %02xh to keyboard\n");
|
||||
+ bio->printd("[KBD] controller passed byte %02xh to keyboard\n");
|
||||
|
||||
if (BX_KEY_THIS s.kbd_internal_buffer.expecting_typematic) {
|
||||
BX_KEY_THIS s.kbd_internal_buffer.expecting_typematic = 0;
|
||||
@ -643,32 +647,32 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- case 1: bx_printf("KBD: setting delay to 250 mS\n"); break;
|
||||
- case 2: bx_printf("KBD: setting delay to 250 mS\n"); break;
|
||||
- case 3: bx_printf("KBD: setting delay to 250 mS\n"); break;
|
||||
+ case 0: bio->printf("[KBD] setting delay to 250 mS\n"); break;
|
||||
+ case 1: bio->printf("[KBD] setting delay to 250 mS\n"); break;
|
||||
+ case 2: bio->printf("[KBD] setting delay to 250 mS\n"); break;
|
||||
+ case 3: bio->printf("[KBD] setting delay to 250 mS\n"); break;
|
||||
+ case 0: bio->printd("[KBD] setting delay to 250 mS\n"); break;
|
||||
+ case 1: bio->printd("[KBD] setting delay to 250 mS\n"); break;
|
||||
+ case 2: bio->printd("[KBD] setting delay to 250 mS\n"); break;
|
||||
+ case 3: bio->printd("[KBD] setting delay to 250 mS\n"); break;
|
||||
}
|
||||
BX_KEY_THIS s.kbd_internal_buffer.repeat_rate = value & 0x1f;
|
||||
- bx_printf("KBD: setting repeat rate to %u\n", (unsigned) value);
|
||||
+ bio->printf("[KBD] setting repeat rate to %u\n", (unsigned) value);
|
||||
+ bio->printd("[KBD] setting repeat rate to %u\n", (unsigned) value);
|
||||
kbd_enQ(0xFA); // send ACK
|
||||
return;
|
||||
}
|
||||
@@ -946,7 +960,7 @@ bx_keyb_c::kbd_ctrl_to_kbd(Bit8u value
|
||||
@@ -946,7 +964,7 @@ bx_keyb_c::kbd_ctrl_to_kbd(Bit8u value
|
||||
if (BX_KEY_THIS s.kbd_internal_buffer.expecting_led_write) {
|
||||
BX_KEY_THIS s.kbd_internal_buffer.expecting_led_write = 0;
|
||||
BX_KEY_THIS s.kbd_internal_buffer.led_status = value;
|
||||
- bx_printf("KBD: LED status set to %02x\n",
|
||||
+ bio->printf("[KBD] LED status set to %02x\n",
|
||||
+ bio->printd("[KBD] LED status set to %02x\n",
|
||||
(unsigned) BX_KEY_THIS s.kbd_internal_buffer.led_status);
|
||||
kbd_enQ(0xFA); // send ACK %%%
|
||||
return;
|
||||
@@ -977,14 +991,14 @@ bx_keyb_c::kbd_ctrl_to_kbd(Bit8u value
|
||||
@@ -977,14 +995,14 @@ bx_keyb_c::kbd_ctrl_to_kbd(Bit8u value
|
||||
break;
|
||||
|
||||
case 0xf2: // identify keyboard
|
||||
- bx_printf("KBD: indentify keyboard command received\n");
|
||||
+ bio->printf("[KBD] indentify keyboard command received\n");
|
||||
+ bio->printd("[KBD] indentify keyboard command received\n");
|
||||
kbd_enQ(0xFA); // AT sends ACK, MFII sends ACK+ABh+41h
|
||||
return;
|
||||
break;
|
||||
@ -676,93 +680,93 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
case 0xf3: // typematic info
|
||||
BX_KEY_THIS s.kbd_internal_buffer.expecting_typematic = 1;
|
||||
- bx_printf("KBD: setting typematic info\n");
|
||||
+ bio->printf("[KBD] setting typematic info\n");
|
||||
+ bio->printd("[KBD] setting typematic info\n");
|
||||
kbd_enQ(0xFA); // send ACK
|
||||
return;
|
||||
break;
|
||||
@@ -1000,7 +1014,7 @@ bx_keyb_c::kbd_ctrl_to_kbd(Bit8u value
|
||||
@@ -1000,7 +1018,7 @@ bx_keyb_c::kbd_ctrl_to_kbd(Bit8u value
|
||||
resetinternals(1);
|
||||
kbd_enQ(0xFA); // send ACK
|
||||
BX_KEY_THIS s.kbd_internal_buffer.scanning_enabled = 0;
|
||||
- bx_printf ("KBD: reset-disable command received\n");
|
||||
+ bio->printf ("[KBD] reset-disable command received\n");
|
||||
+ bio->printd ("[KBD] reset-disable command received\n");
|
||||
return;
|
||||
break;
|
||||
|
||||
@@ -1008,7 +1022,7 @@ bx_keyb_c::kbd_ctrl_to_kbd(Bit8u value
|
||||
@@ -1008,7 +1026,7 @@ bx_keyb_c::kbd_ctrl_to_kbd(Bit8u value
|
||||
resetinternals(1);
|
||||
kbd_enQ(0xFA); // send ACK
|
||||
BX_KEY_THIS s.kbd_internal_buffer.scanning_enabled = 1;
|
||||
- bx_printf ("KBD: reset-enable command received\n");
|
||||
+ bio->printf ("[KBD] reset-enable command received\n");
|
||||
+ bio->printd ("[KBD] reset-enable command received\n");
|
||||
return;
|
||||
break;
|
||||
|
||||
@@ -1026,12 +1040,12 @@ bx_keyb_c::kbd_ctrl_to_kbd(Bit8u value
|
||||
@@ -1026,12 +1044,12 @@ bx_keyb_c::kbd_ctrl_to_kbd(Bit8u value
|
||||
break;
|
||||
|
||||
case 0xfe: // resend. aiiee.
|
||||
- bx_panic ("KBD: got 0xFE (resend)\n");
|
||||
+ bio->printf("[KBD] got 0xFE (resend)\n");
|
||||
+ bio->printd("[KBD] got 0xFE (resend)\n");
|
||||
return;
|
||||
break;
|
||||
|
||||
case 0xff: // reset: internal keyboard reset and afterwards the BAT
|
||||
- bx_printf("KBD: rest command received\n");
|
||||
+ bio->printf("[KBD] rest command received\n");
|
||||
+ bio->printd("[KBD] rest command received\n");
|
||||
kbd_enQ(0xFA); // send ACK
|
||||
kbd_enQ(0xAA); // BAT test passed
|
||||
return;
|
||||
@@ -1042,7 +1056,7 @@ case 0xd3:
|
||||
@@ -1042,7 +1060,7 @@ case 0xd3:
|
||||
return;
|
||||
|
||||
default:
|
||||
- bx_panic("KBD: kbd_ctrl_to_kbd(): got value of %02x\n",
|
||||
+ bio->printf("[KBD] kbd_ctrl_to_kbd(): got value of %02x\n",
|
||||
+ bio->printd("[KBD] kbd_ctrl_to_kbd(): got value of %02x\n",
|
||||
(unsigned) value);
|
||||
kbd_enQ(0xFA); /* send ACK ??? */
|
||||
return;
|
||||
@@ -1085,14 +1099,14 @@ bx_keyb_c::periodic( Bit32u usec_delta
|
||||
@@ -1085,14 +1103,14 @@ bx_keyb_c::periodic( Bit32u usec_delta
|
||||
|
||||
/* nothing in outb, look for possible data xfer from keyboard or mouse */
|
||||
if (BX_KEY_THIS s.kbd_controller.kbd_clock_enabled && BX_KEY_THIS s.kbd_internal_buffer.num_elements) {
|
||||
-//fprintf(stderr, "# servicing keyboard code\n");
|
||||
- if (bx_dbg.keyboard)
|
||||
- bx_printf("KBD: service_keyboard: key in internal buffer waiting\n");
|
||||
+//bio->printf("#KBD] servicing keyboard code\n");
|
||||
+//bio->printd("#KBD] servicing keyboard code\n");
|
||||
+ if (bio->getdbg().keyboard)
|
||||
+ bio->printf("[KBD] service_keyboard: key in internal buffer waiting\n");
|
||||
+ bio->printd("[KBD] service_keyboard: key in internal buffer waiting\n");
|
||||
BX_KEY_THIS s.kbd_controller.kbd_output_buffer =
|
||||
BX_KEY_THIS s.kbd_internal_buffer.buffer[BX_KEY_THIS s.kbd_internal_buffer.head];
|
||||
BX_KEY_THIS s.kbd_controller.outb = 1;
|
||||
BX_KEY_THIS s.kbd_controller.auxb = 0;
|
||||
-//fprintf(stderr, "# ___kbd::periodic kbd\n");
|
||||
+//bio->printf("#KBD] ___kbd::periodic kbd\n");
|
||||
+//bio->printd("#KBD] ___kbd::periodic kbd\n");
|
||||
BX_KEY_THIS s.kbd_internal_buffer.head = (BX_KEY_THIS s.kbd_internal_buffer.head + 1) %
|
||||
BX_KBD_ELEMENTS;
|
||||
BX_KEY_THIS s.kbd_internal_buffer.num_elements--;
|
||||
@@ -1100,26 +1114,26 @@ bx_keyb_c::periodic( Bit32u usec_delta
|
||||
@@ -1100,26 +1118,26 @@ bx_keyb_c::periodic( Bit32u usec_delta
|
||||
BX_KEY_THIS s.kbd_controller.irq1_requested = 1;
|
||||
}
|
||||
else if (BX_KEY_THIS s.kbd_controller.aux_clock_enabled && BX_KEY_THIS s.mouse_internal_buffer.num_elements) {
|
||||
-//fprintf(stderr, "# servicing mouse code\n");
|
||||
- if (bx_dbg.mouse)
|
||||
- bx_printf("KBD: service_keyboard: key in internal buffer waiting\n");
|
||||
+//bio->printf("#MOUSE] servicing mouse code\n");
|
||||
+//bio->printd("#MOUSE] servicing mouse code\n");
|
||||
+ if (bio->getdbg().mouse)
|
||||
+ bio->printf("[KBD] service_keyboard: key in internal buffer waiting\n");
|
||||
+ bio->printd("[KBD] service_keyboard: key in internal buffer waiting\n");
|
||||
BX_KEY_THIS s.kbd_controller.aux_output_buffer =
|
||||
BX_KEY_THIS s.mouse_internal_buffer.buffer[BX_KEY_THIS s.mouse_internal_buffer.head];
|
||||
|
||||
BX_KEY_THIS s.kbd_controller.outb = 1;
|
||||
BX_KEY_THIS s.kbd_controller.auxb = 1;
|
||||
-//fprintf(stderr, "# ___kbd:periodic aux\n");
|
||||
+//bio->printf("#KBD] ___kbd:periodic aux\n");
|
||||
+//bio->printd("#KBD] ___kbd:periodic aux\n");
|
||||
BX_KEY_THIS s.mouse_internal_buffer.head = (BX_KEY_THIS s.mouse_internal_buffer.head + 1) %
|
||||
BX_MOUSE_BUFF_SIZE;
|
||||
BX_KEY_THIS s.mouse_internal_buffer.num_elements--;
|
||||
-//fprintf(stderr, "# allow12 = %u\n", (unsigned) BX_KEY_THIS s.kbd_controller.allow_irq12);
|
||||
+//bio->printf("#KBD] allow12 = %u\n", (unsigned) BX_KEY_THIS s.kbd_controller.allow_irq12);
|
||||
+//bio->printd("#KBD] allow12 = %u\n", (unsigned) BX_KEY_THIS s.kbd_controller.allow_irq12);
|
||||
if (BX_KEY_THIS s.kbd_controller.allow_irq12)
|
||||
BX_KEY_THIS s.kbd_controller.irq12_requested = 1;
|
||||
}
|
||||
@ -770,54 +774,54 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
-//fprintf(stderr, "# servicing no code\n");
|
||||
- if (bx_dbg.keyboard) {
|
||||
- bx_printf("KBD: service_keyboard(): no keys waiting\n");
|
||||
+//bio->printf("#KBD] servicing no code\n");
|
||||
+//bio->printd("#KBD] servicing no code\n");
|
||||
+ if (bio->getdbg().keyboard) {
|
||||
+ bio->printf("[KBD] service_keyboard(): no keys waiting\n");
|
||||
+ bio->printd("[KBD] service_keyboard(): no keys waiting\n");
|
||||
}
|
||||
}
|
||||
return(retval);
|
||||
@@ -1141,13 +1155,13 @@ bx_keyb_c::activate_timer(void)
|
||||
@@ -1141,13 +1159,13 @@ bx_keyb_c::activate_timer(void)
|
||||
void
|
||||
bx_keyb_c::kbd_ctrl_to_mouse(Bit8u value)
|
||||
{
|
||||
-bx_printf("MOUSE: kbd_ctrl_to_mouse(%02xh)\n", (unsigned) value);
|
||||
-bx_printf(" enable = %u\n", (unsigned) BX_KEY_THIS s.mouse.enable);
|
||||
-bx_printf(" allow_irq12 = %u\n",
|
||||
+bio->printf("[MOUSE] kbd_ctrl_to_mouse(%02xh)\n", (unsigned) value);
|
||||
+bio->printf("[MOUSE] enable = %u", (unsigned) BX_KEY_THIS s.mouse.enable);
|
||||
+bio->printf("[MOUSE] allow_irq12 = %u\n",
|
||||
+bio->printd("[MOUSE] kbd_ctrl_to_mouse(%02xh)\n", (unsigned) value);
|
||||
+bio->printd("[MOUSE] enable = %u", (unsigned) BX_KEY_THIS s.mouse.enable);
|
||||
+bio->printd("[MOUSE] allow_irq12 = %u\n",
|
||||
(unsigned) BX_KEY_THIS s.kbd_controller.allow_irq12);
|
||||
-bx_printf(" aux_clock_enabled = %u\n",
|
||||
+bio->printf("[MOUSE] aux_clock_enabled = %u\n",
|
||||
+bio->printd("[MOUSE] aux_clock_enabled = %u\n",
|
||||
(unsigned) BX_KEY_THIS s.kbd_controller.aux_clock_enabled);
|
||||
-//fprintf(stderr, "# MOUSE: kbd_ctrl_to_mouse(%02xh)\n", (unsigned) value);
|
||||
+//bio->printf("#MOUSE] kbd_ctrl_to_mouse(%02xh)\n", (unsigned) value);
|
||||
+//bio->printd("#MOUSE] kbd_ctrl_to_mouse(%02xh)\n", (unsigned) value);
|
||||
|
||||
// an ACK (0xFA) is always the first response to any valid input
|
||||
// received from the system other than Set-Wrap-Mode & Resend-Command
|
||||
@@ -1158,8 +1172,8 @@ bx_printf(" aux_clock_enabled = %u\n",
|
||||
@@ -1158,8 +1176,8 @@ bx_printf(" aux_clock_enabled = %u\n",
|
||||
switch (BX_KEY_THIS s.kbd_controller.last_mouse_command) {
|
||||
case 0xf3: // Set Mouse Sample Rate
|
||||
BX_KEY_THIS s.mouse.sample_rate = value;
|
||||
- if (bx_dbg.mouse)
|
||||
- bx_printf("[mouse] Sampling rate set: %d Hz\n", value);
|
||||
+ if (bio->getdbg().mouse)
|
||||
+ bio->printf("[mouse] Sampling rate set: %d Hz\n", value);
|
||||
+ bio->printd("[mouse] Sampling rate set: %d Hz\n", value);
|
||||
controller_enQ(0xFA, 1); // ack
|
||||
break;
|
||||
|
||||
@@ -1178,18 +1192,19 @@ bx_printf(" aux_clock_enabled = %u\n",
|
||||
@@ -1178,18 +1196,19 @@ bx_printf(" aux_clock_enabled = %u\n",
|
||||
BX_KEY_THIS s.mouse.resolution_cpmm = 8;
|
||||
break;
|
||||
default:
|
||||
- bx_panic("[mouse] Unknown resolution %d\n", value);
|
||||
+ bio->printf("[mouse] Unknown resolution %d\n", value);
|
||||
+ bio->printd("[mouse] Unknown resolution %d\n", value);
|
||||
break;
|
||||
}
|
||||
- if (bx_dbg.mouse)
|
||||
- bx_printf("[mouse] Resolution set to %d counts per mm\n",
|
||||
+ if (bio->getdbg().mouse)
|
||||
+ bio->printf("[mouse] Resolution set to %d counts per mm\n",
|
||||
+ bio->printd("[mouse] Resolution set to %d counts per mm\n",
|
||||
BX_KEY_THIS s.mouse.resolution_cpmm);
|
||||
|
||||
controller_enQ(0xFA, 1); // ack
|
||||
@ -825,19 +829,19 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
|
||||
default:
|
||||
- bx_panic("MOUSE: unknown last command (%02xh)\n", (unsigned) BX_KEY_THIS s.kbd_controller.last_mouse_command);
|
||||
+ bio->printf("[MOUSE] unknown last command (%02xh)\n", (unsigned) BX_KEY_THIS s.kbd_controller.last_mouse_command);
|
||||
+ bio->printd("[MOUSE] unknown last command (%02xh)\n", (unsigned) BX_KEY_THIS s.kbd_controller.last_mouse_command);
|
||||
+ break;
|
||||
}
|
||||
} else {
|
||||
BX_KEY_THIS s.kbd_controller.expecting_mouse_parameter = 0;
|
||||
@@ -1198,15 +1213,15 @@ bx_printf(" aux_clock_enabled = %u\n",
|
||||
@@ -1198,15 +1217,15 @@ bx_printf(" aux_clock_enabled = %u\n",
|
||||
case 0xe6: // Set Mouse Scaling to 1:1
|
||||
controller_enQ(0xFA, 1); // ACK
|
||||
BX_KEY_THIS s.mouse.scaling = 2;
|
||||
- if (bx_dbg.mouse)
|
||||
- bx_printf("[mouse] Scaling set to 1:1\n");
|
||||
+ if (bio->getdbg().mouse)
|
||||
+ bio->printf("[mouse] Scaling set to 1:1\n");
|
||||
+ bio->printd("[mouse] Scaling set to 1:1\n");
|
||||
break;
|
||||
|
||||
case 0xe7: // Set Mouse Scaling to 2:1
|
||||
@ -846,29 +850,29 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- if (bx_dbg.mouse)
|
||||
- bx_printf("[mouse] Scaling set to 2:1\n");
|
||||
+ if (bio->getdbg().mouse)
|
||||
+ bio->printf("[mouse] Scaling set to 2:1\n");
|
||||
+ bio->printd("[mouse] Scaling set to 2:1\n");
|
||||
break;
|
||||
|
||||
case 0xe8: // Set Mouse Resolution
|
||||
@@ -1217,8 +1232,8 @@ bx_printf(" aux_clock_enabled = %u\n",
|
||||
@@ -1217,8 +1236,8 @@ bx_printf(" aux_clock_enabled = %u\n",
|
||||
case 0xf2: // Read Device Type
|
||||
controller_enQ(0xFA, 1); // ACK
|
||||
controller_enQ(0x00, 1); // Device ID
|
||||
- if (bx_dbg.mouse)
|
||||
- bx_printf("[mouse] Read mouse ID\n");
|
||||
+ if (bio->getdbg().mouse)
|
||||
+ bio->printf("[mouse] Read mouse ID\n");
|
||||
+ bio->printd("[mouse] Read mouse ID\n");
|
||||
break;
|
||||
|
||||
case 0xf3: // Set Mouse Sample Rate (sample rate written to port 60h)
|
||||
@@ -1229,15 +1244,15 @@ bx_printf(" aux_clock_enabled = %u\n",
|
||||
@@ -1229,15 +1248,15 @@ bx_printf(" aux_clock_enabled = %u\n",
|
||||
case 0xf4: // Enable (in stream mode)
|
||||
BX_KEY_THIS s.mouse.enable = 1;
|
||||
controller_enQ(0xFA, 1); // ACK
|
||||
- if (bx_dbg.mouse)
|
||||
- bx_printf("[mouse] Mouse enabled (stream mode)\n");
|
||||
+ if (bio->getdbg().mouse)
|
||||
+ bio->printf("[mouse] Mouse enabled (stream mode)\n");
|
||||
+ bio->printd("[mouse] Mouse enabled (stream mode)\n");
|
||||
break;
|
||||
|
||||
case 0xf5: // Disable (in stream mode)
|
||||
@ -877,43 +881,43 @@ $OpenBSD: patch-iodev_keyboard_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- if (bx_dbg.mouse)
|
||||
- bx_printf("[mouse] Mouse disabled (stream mode)\n");
|
||||
+ if (bio->getdbg().mouse)
|
||||
+ bio->printf("[mouse] Mouse disabled (stream mode)\n");
|
||||
+ bio->printd("[mouse] Mouse disabled (stream mode)\n");
|
||||
break;
|
||||
|
||||
case 0xff: // Reset
|
||||
@@ -1250,8 +1265,8 @@ bx_printf(" aux_clock_enabled = %u\n",
|
||||
@@ -1250,8 +1269,8 @@ bx_printf(" aux_clock_enabled = %u\n",
|
||||
controller_enQ(0xFA, 1); // ACK
|
||||
controller_enQ(0xAA, 1); // completion code
|
||||
controller_enQ(0x00, 1); // ID code (normal mouse, wheelmouse has id 0x3)
|
||||
- if (bx_dbg.mouse)
|
||||
- bx_printf("[mouse] Mouse reset\n");
|
||||
+ if (bio->getdbg().mouse)
|
||||
+ bio->printf("[mouse] Mouse reset\n");
|
||||
+ bio->printd("[mouse] Mouse reset\n");
|
||||
break;
|
||||
|
||||
case 0xe9: // Get mouse information
|
||||
@@ -1260,12 +1275,12 @@ bx_printf(" aux_clock_enabled = %u\n",
|
||||
@@ -1260,12 +1279,12 @@ bx_printf(" aux_clock_enabled = %u\n",
|
||||
controller_enQ(BX_KEY_THIS s.mouse.get_status_byte(), 1); // status
|
||||
controller_enQ(BX_KEY_THIS s.mouse.get_resolution_byte(), 1); // resolution
|
||||
controller_enQ(BX_KEY_THIS s.mouse.sample_rate, 1); // sample rate
|
||||
- if (bx_dbg.mouse)
|
||||
- bx_printf("[mouse] Get mouse information\n");
|
||||
+ if (bio->getdbg().mouse)
|
||||
+ bio->printf("[mouse] Get mouse information\n");
|
||||
+ bio->printd("[mouse] Get mouse information\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
- bx_panic("MOUSE: kbd_ctrl_to_mouse(%02xh)\n", (unsigned) value);
|
||||
+ bio->printf("[MOUSE] kbd_ctrl_to_mouse(%02xh)\n", (unsigned) value);
|
||||
+ bio->printd("[MOUSE] kbd_ctrl_to_mouse(%02xh)\n", (unsigned) value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1289,7 +1304,7 @@ bx_keyb_c::mouse_motion(int delta_x, int
|
||||
@@ -1289,7 +1308,7 @@ bx_keyb_c::mouse_motion(int delta_x, int
|
||||
if ( (delta_y < -1) || (delta_y > 1) )
|
||||
delta_y /= 2;
|
||||
|
||||
- //fprintf(stderr, "# MOUSE: Dx=%d Dy=%d\n",
|
||||
+ //bio->printf("#MOUSE] Dx=%d Dy=%d\n",
|
||||
+ //bio->printd("#MOUSE] Dx=%d Dy=%d\n",
|
||||
// delta_x, delta_y);
|
||||
|
||||
b1 = (button_state & 0x0f) | 0x08; // bit3 always set
|
||||
|
@ -1,6 +1,6 @@
|
||||
$OpenBSD: patch-main_cc,v 1.1 2001/02/02 16:59:12 todd Exp $
|
||||
$OpenBSD: patch-main_cc,v 1.2 2001/03/30 16:47:03 todd Exp $
|
||||
--- main.cc.orig Sat Mar 25 21:23:20 2000
|
||||
+++ main.cc Mon Oct 23 22:12:22 2000
|
||||
+++ main.cc Fri Mar 30 09:56:02 2001
|
||||
@@ -26,10 +26,12 @@
|
||||
|
||||
|
||||
@ -736,13 +736,13 @@ $OpenBSD: patch-main_cc,v 1.1 2001/02/02 16:59:12 todd Exp $
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
@@ -906,5 +782,241 @@ bx_signal_handler( int signum)
|
||||
@@ -906,5 +782,251 @@ bx_signal_handler( int signum)
|
||||
}
|
||||
#endif
|
||||
|
||||
- bx_panic("SIGNAL %u caught\n", signum);
|
||||
+ bio->printf("SIGNAL %u caught\n", signum);
|
||||
}
|
||||
+}
|
||||
+
|
||||
+bxio::bxio(FILE *fs) {
|
||||
+ //fprintf(stderr,"bxio::bxio(%s)\n",fn);
|
||||
@ -864,7 +864,19 @@ $OpenBSD: patch-main_cc,v 1.1 2001/02/02 16:59:12 todd Exp $
|
||||
+ showtick = 0;
|
||||
+}
|
||||
+
|
||||
+ void
|
||||
+void
|
||||
+bxio::printd(char *fmt, ...)
|
||||
+{
|
||||
+ va_list ap;
|
||||
+
|
||||
+ if(debug) {
|
||||
+ va_start(ap, fmt);
|
||||
+ this->printf(fmt, ap);
|
||||
+ va_end(ap);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+bxio::printf(char *fmt, ...)
|
||||
+{
|
||||
+ va_list ap;
|
||||
@ -947,8 +959,8 @@ $OpenBSD: patch-main_cc,v 1.1 2001/02/02 16:59:12 todd Exp $
|
||||
+}
|
||||
+
|
||||
+ void
|
||||
+bxio::init_debug(void)
|
||||
+{
|
||||
+bxio::init_debug(void) {
|
||||
+ this->debug = 0;
|
||||
+ this->dbg.floppy = 0;
|
||||
+ this->dbg.keyboard = 0;
|
||||
+ this->dbg.video = 0;
|
||||
@ -976,6 +988,4 @@ $OpenBSD: patch-main_cc,v 1.1 2001/02/02 16:59:12 todd Exp $
|
||||
+ this->dbg.record_io = 0;
|
||||
+ this->dbg.serial = 0;
|
||||
+ this->dbg.cdrom = 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
$OpenBSD: patch-memory_misc_mem_cc,v 1.1 2001/02/02 16:59:12 todd Exp $
|
||||
$OpenBSD: patch-memory_misc_mem_cc,v 1.2 2001/03/30 16:47:03 todd Exp $
|
||||
--- memory/misc_mem.cc.orig Sat Mar 25 21:46:43 2000
|
||||
+++ memory/misc_mem.cc Thu Oct 19 11:27:34 2000
|
||||
+++ memory/misc_mem.cc Fri Mar 30 10:20:20 2001
|
||||
@@ -35,7 +35,7 @@
|
||||
Bit32u
|
||||
BX_MEM_C::get_memory_in_k(void)
|
||||
@ -36,7 +36,7 @@ $OpenBSD: patch-memory_misc_mem_cc,v 1.1 2001/02/02 16:59:12 todd Exp $
|
||||
// memory not already allocated, do now...
|
||||
- bx_printf("(%u) BX_MEM_C::init_memory(int): allocating memory.\n", BX_SIM_ID);
|
||||
- bx_printf("(%u) memsize = %u\n", BX_SIM_ID, (unsigned) memsize);
|
||||
+ bio->printf("[CPU%u] BX_MEM_C::init_memory(int): allocating memory.\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] BX_MEM_C::init_memory(int): allocating memory.\n", BX_SIM_ID);
|
||||
+ bio->printf("[CPU%u] memsize = %u\n", BX_SIM_ID, (unsigned) memsize);
|
||||
BX_MEM_THIS vector = new Bit8u[memsize];
|
||||
BX_MEM_THIS len = memsize;
|
||||
@ -52,39 +52,41 @@ $OpenBSD: patch-memory_misc_mem_cc,v 1.1 2001/02/02 16:59:12 todd Exp $
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -132,19 +132,19 @@ BX_MEM_C::load_ROM(const char *path, Bit
|
||||
@@ -132,20 +132,17 @@ BX_MEM_C::load_ROM(const char *path, Bit
|
||||
#endif
|
||||
);
|
||||
if (fd < 0) {
|
||||
- fprintf(stderr, "load_ROM: couldn't open ROM image file '%s'.\n", path);
|
||||
+ bio->printf("[load_ROM] couldn't open ROM image file '%s'.\n", path);
|
||||
exit(1);
|
||||
- exit(1);
|
||||
+ bio->panic("[load_ROM] couldn't open ROM image file '%s'.\n", path);
|
||||
}
|
||||
ret = fstat(fd, &stat_buf);
|
||||
if (ret) {
|
||||
- fprintf(stderr, "load_ROM: couldn't stat ROM image file '%s'.\n", path);
|
||||
+ bio->printf("[load_ROM] couldn't stat ROM image file '%s'.\n", path);
|
||||
exit(1);
|
||||
- exit(1);
|
||||
+ bio->panic("[load_ROM] couldn't stat ROM image file '%s'.\n", path);
|
||||
}
|
||||
|
||||
size = stat_buf.st_size;
|
||||
|
||||
if ( (romaddress + size) > BX_MEM_THIS len ) {
|
||||
- fprintf(stderr, "load_ROM: ROM address range > physical memsize!\n");
|
||||
+ bio->printf("[load_ROM] ROM address range > physical memsize!\n");
|
||||
exit(1);
|
||||
- exit(1);
|
||||
+ bio->panic("[load_ROM] ROM address range > physical memsize!\n");
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ BX_MEM_C::load_ROM(const char *path, Bit
|
||||
offset = 0;
|
||||
@@ -160,8 +157,7 @@ BX_MEM_C::load_ROM(const char *path, Bit
|
||||
ret = read(fd, (bx_ptr_t) &BX_MEM_THIS vector[romaddress + offset], size);
|
||||
#endif
|
||||
if (ret <= 0) {
|
||||
- fprintf(stderr, "load_ROM: read failed on ROM BIOS image\n");
|
||||
+ bio->printf("[load_ROM] read failed on ROM BIOS image\n");
|
||||
exit(1);
|
||||
- exit(1);
|
||||
+ bio->panic("[load_ROM] read failed on ROM BIOS image\n");
|
||||
}
|
||||
size -= ret;
|
||||
@@ -169,13 +169,13 @@ BX_MEM_C::load_ROM(const char *path, Bit
|
||||
offset += ret;
|
||||
@@ -169,13 +165,13 @@ BX_MEM_C::load_ROM(const char *path, Bit
|
||||
close(fd);
|
||||
#if BX_PCI_SUPPORT
|
||||
if (bx_options.i440FXSupport)
|
||||
@ -101,7 +103,7 @@ $OpenBSD: patch-memory_misc_mem_cc,v 1.1 2001/02/02 16:59:12 todd Exp $
|
||||
BX_SIM_ID, path, (unsigned) stat_buf.st_size, (unsigned) romaddress);
|
||||
#endif // #if BX_PCI_SUPPORT
|
||||
}
|
||||
@@ -204,15 +204,15 @@ BX_MEM_C::dbg_fetch_mem(Bit32u addr, uns
|
||||
@@ -204,15 +200,15 @@ BX_MEM_C::dbg_fetch_mem(Bit32u addr, uns
|
||||
switch (bx_pci.rd_memType (addr)) {
|
||||
case 0x0: // Fetch from ShadowRAM
|
||||
*buf = BX_MEM.vector[addr];
|
||||
|
Loading…
Reference in New Issue
Block a user