Subject: filthy, evil bochs patches
To: None <soren@netbsd.org>
From: Julian Assange <proff@iq.org>
List: port-i386
Date: 10/27/1999 15:58:09
I've managed to get the latest bochs working under -current. The
problem in all cases is that NetBSD is stimulating the production of
what seems to be unexpected, but harmless values in the virtual bochs
drivers (e.g reading from a vga port that bochs doesn't know about).
This patch is just a disgusting proof-of-concept. More attention needs to
be given as to whether NetBSD should be causing these values to (a) occur
at all, and (b) whether simply ignoring them is acceptable. My feeling is
that (b) is fine, but that (a) needs looking at.

Thus far I've managed to emulate a 1.4.1 install without problem.

diff --minimal -u -r t/bochs-991023a/iodev/harddrv.cc bochs-991023a/iodev/harddrv.cc
--- t/bochs-991023a/iodev/harddrv.cc    Sat Oct 23 15:57:51 1999
+++ bochs-991023a/iodev/harddrv.cc      Tue Oct 26 22:50:17 1999
@@ -488,7 +488,7 @@
       if (BX_SELECTED_CONTROLLER.current_command==0x20 ||
           BX_SELECTED_CONTROLLER.current_command==0x21 ||
           BX_SELECTED_CONTROLLER.current_command==0x30 ||
-          BX_SELECTED_CONTROLLER.current_command==0xa0) {
+          BX_SELECTED_CONTROLLER.current_command==0xa0 || 1) {
         value8 = BX_SELECTED_CONTROLLER.sector_count;
         goto return_value8;
         }
diff --minimal -u -r t/bochs-991023a/iodev/keyboard.cc bochs-991023a/iodev/keyboard.cc
--- t/bochs-991023a/iodev/keyboard.cc   Sun Sep 26 03:24:41 1999
+++ bochs-991023a/iodev/keyboard.cc     Tue Oct 26 23:25:30 1999
@@ -1038,8 +1038,10 @@
   return;

     default:
+/*
       bx_panic("KBD: kbd_ctrl_to_kbd(): got value of %02x\n",
         (unsigned) value);
+*/
       kbd_enQ(0xFA); /* send ACK ??? */
       return;
       break;
diff --minimal -u -r t/bochs-991023a/iodev/vga.cc bochs-991023a/iodev/vga.cc
--- t/bochs-991023a/iodev/vga.cc        Sat Oct 23 16:29:47 1999
+++ bochs-991023a/iodev/vga.cc  Tue Oct 26 23:36:59 1999
@@ -582,7 +582,9 @@
     case 0x03c7: /* */
     case 0x03c8: /* */
     default:
+/*
       bx_panic("*** io read from vga port %x\n", (unsigned) address);
+*/
       RETURN(0); /* keep compiler happy */
     }