Removed disasm patch already committed in CVS

Added two patches from bochs-developers mailing list
This commit is contained in:
Stanislav Shwartsman 2003-05-07 19:12:10 +00:00
parent 8fa3111f3c
commit d01a789269
3 changed files with 148 additions and 157 deletions

View File

@ -0,0 +1,68 @@
----------------------------------------------------------------------
Patch name: Disassmble relative jumps correctly
Author: Dirk Thierbach
Date: 4/30/2003
Status: new
Detailed description:
Patch was created with:
cvs diff -u
Apply patch to what version:
cvs checked out on DATE, release version VER
Instructions:
To patch, go to main bochs directory.
Type "patch -p0 < THIS_PATCH_FILE".
----------------------------------------------------------------------
--- dis_groups.cc.ORIG 2003-01-21 14:23:47.000000000 +0100
+++ dis_groups.cc 2003-04-30 12:46:36.000000000 +0200
@@ -418,12 +418,12 @@
{
if (db_32bit_opsize) {
Bit32s imm32;
- imm32 = fetch_dword();
+ imm32 = (Bit32s) fetch_dword();
dis_sprintf("%08x", (unsigned) (imm32 + db_eip));
}
else {
Bit16s imm16;
- imm16 = fetch_word();
+ imm16 = (Bit16s) fetch_word();
dis_sprintf("%04x", (unsigned) ((imm16 + db_eip) & 0xFFFF));
}
}
@@ -522,17 +522,17 @@
{
#if BX_CPU_LEVEL > 2
if (db_32bit_opsize) {
- Bit32u imm32;
+ Bit32s imm32; /* JMP rel32 is signed */
- imm32 = fetch_dword();
+ imm32 = (Bit32s) fetch_dword();
dis_sprintf("%08x", (unsigned) (imm32 + db_eip));
}
else
#endif
{
- Bit16u imm16;
+ Bit16s imm16; /* JMP rel16 is signed */
- imm16 = fetch_word();
+ imm16 = (Bit16s) fetch_word();
dis_sprintf("%04x", (unsigned) ((imm16 + db_eip) & 0xFFFF));
}
}
@@ -591,9 +591,9 @@
void
bx_disassemble_c::Jb(void)
{
- Bit8u imm8;
+ Bit8s imm8; /* JMP rel8 is signed */
- imm8 = fetch_byte();
+ imm8 = (Bit8s) fetch_byte();
#if BX_CPU_LEVEL > 2
if (db_32bit_opsize) {
dis_sprintf("%08x", (unsigned) (imm8 + db_eip));

View File

@ -1,157 +0,0 @@
----------------------------------------------------------------------
Patch name: patches/patch.disasm-luizshiguno
Author: Luiz Henrique Shigunov (
Date: Tue Jan 21 10:44:27 CET 2003
Status: applied to main code
Detailed description:
I've implemented functions ALOb(), ObAL(), YbAL(),
ALXb() and eAXXv() from dis_groups.cc.
I've also changed dis_decode.cc to print cmpsd if code
is 32 bits and cmpsw if code is 16 bits. The same with
stosd, lodsd and scasd.
Patch was created with:
cvs diff -u
Apply patch to what version:
cvs checked out on Tue Jan 21 10:44:27 CET 2003
Instructions:
To patch, go to main bochs directory.
Type "patch -p0 < THIS_PATCH_FILE".
----------------------------------------------------------------------
Index: disasm/dis_decode.cc
===================================================================
RCS file: /cvsroot/bochs/bochs/disasm/dis_decode.cc,v
retrieving revision 1.12
diff -u -r1.12 dis_decode.cc
--- disasm/dis_decode.cc 19 Nov 2002 05:47:44 -0000 1.12
+++ disasm/dis_decode.cc 21 Jan 2003 09:42:54 -0000
@@ -960,16 +960,54 @@
goto done;
case 0xA6: dis_sprintf("cmpsb "); XbYb(); goto done;
- case 0xA7: dis_sprintf("cmpsw "); XvYv(); goto done;
+
+ case 0xA7:
+ if (db_32bit_opsize) {
+ dis_sprintf("cmpsd ");
+ }
+ else {
+ dis_sprintf("cmpsw ");
+ }
+ XvYv();
+ goto done;
+
case 0xA8: dis_sprintf("test AL, "); Ib(); goto done;
case 0xA9: dis_sprintf("test "); eAX(); dis_sprintf(", "); Iv(); goto done;
case 0xAA: dis_sprintf("stosb "); YbAL(); goto done;
- case 0xAB: dis_sprintf("stosw "); YveAX(); goto done;
+
+ case 0xAB:
+ if (db_32bit_opsize) {
+ dis_sprintf("stosd ");
+ }
+ else {
+ dis_sprintf("stosw ");
+ }
+ YveAX();
+ goto done;
+
case 0xAC: dis_sprintf("lodsb "); ALXb(); goto done;
- case 0xAD: dis_sprintf("lodsw "); eAXXv(); goto done;
- case 0xAE: dis_sprintf("scasb "); ALXb(); goto done;
- case 0xAF: dis_sprintf("scasw "); eAXXv(); goto done;
+ case 0xAD:
+ if (db_32bit_opsize) {
+ dis_sprintf("lodsd ");
+ }
+ else {
+ dis_sprintf("lodsw ");
+ }
+ eAXXv();
+ goto done;
+
+ case 0xAE: dis_sprintf("scasb "); YbAL(); goto done;
+
+ case 0xAF:
+ if (db_32bit_opsize) {
+ dis_sprintf("scasd ");
+ }
+ else {
+ dis_sprintf("scasw ");
+ }
+ YveAX();
+ goto done;
case 0xB0: dis_sprintf("mov AL, "); Ib(); goto done;
case 0xB1: dis_sprintf("mov CL, "); Ib(); goto done;
Index: disasm/dis_groups.cc
===================================================================
RCS file: /cvsroot/bochs/bochs/disasm/dis_groups.cc,v
retrieving revision 1.7
diff -u -r1.7 dis_groups.cc
--- disasm/dis_groups.cc 19 Nov 2002 05:47:44 -0000 1.7
+++ disasm/dis_groups.cc 21 Jan 2003 09:42:57 -0000
@@ -337,11 +337,57 @@
}
void
-bx_disassemble_c::YbAL(void) {dis_sprintf("*** YbAL() unfinished ***");}
+bx_disassemble_c::YbAL(void)
+{
+ char *edi;
+
+ if (db_32bit_addrsize) {
+ edi = "EDI";
+ }
+ else {
+ edi = "DI";
+ }
+
+ dis_sprintf("ES:[%s], AL", edi);
+}
+
void
-bx_disassemble_c::ALXb(void) {dis_sprintf("*** ALXb() unfinished ***");}
+bx_disassemble_c::ALXb(void)
+{
+ char *esi;
+
+ if (db_32bit_addrsize) {
+ esi = "ESI";
+ }
+ else {
+ esi = "SI";
+ }
+
+ dis_sprintf("AL, [%s]", esi);
+}
+
void
-bx_disassemble_c::eAXXv(void) { dis_sprintf("*** eAXXv() unfinished ***"); }
+bx_disassemble_c::eAXXv(void)
+{
+ char *eax, *esi;
+
+ if (db_32bit_opsize) {
+ eax = "EAX";
+ }
+ else {
+ eax = "AX";
+ }
+
+ if (db_32bit_addrsize) {
+ esi = "ESI";
+ }
+ else {
+ esi = "SI";
+ }
+
+ dis_sprintf("%s, [%s]", eax, esi);
+}
+
void
bx_disassemble_c::Es(void) {dis_sprintf("*** Es() unfinished ***");}
void

View File

@ -0,0 +1,80 @@
----------------------------------------------------------------------
Patch name: BIOS Int 15 Func D8 (EISA CMOS)
Author: Dirk Thierbach
Date: 4/30/2003
Status: new
Detailed description:
Patch was created with:
cvs diff -u
Apply patch to what version:
cvs checked out on DATE, release version VER
Instructions:
To patch, go to main bochs directory.
Type "patch -p0 < THIS_PATCH_FILE".
----------------------------------------------------------------------
--- rombios.c.ORIG 2003-04-29 23:31:20.000000000 +0200
+++ rombios.c 2003-04-30 00:11:48.000000000 +0200
@@ -3799,6 +3799,60 @@
#endif
break;
+ case 0xd8: /* EISA configuration */
+ /* Ralf's interrupt list http://www-2.cs.cmu.edu/~ralf/files.html
+ * gives a few more details about this interrupt. I haven't been
+ * able to find an in-depth description, but for example
+ * http://docsrv.caldera.com/cgi-bin/man/man?eisa+D4
+ * http://www.rcnp.osaka-u.ac.jp/unix/DOCUMENTATION/HTML/AA-Q0R6C-TET1_html/TOC.html
+ * give a few hints, though only in the context of writing unix device
+ * drivers.
+ *
+ * For now, we just indicate empty slots. Shouldn't be a big difference
+ * from leaving it unimplemented, but who knows...
+ */
+ switch (regs.u.r8.al) {
+ case 0x00: /* Read slot configuration information */
+ case 0x80: /* Read slot configuration information, 32bit CS */
+ BX_INFO ("int15: func=%04x slot=%02x, returning empty slot error\n",
+ (unsigned) regs.u.r16.ax, (unsigned) regs.u.r8.cl);
+ SET_CF();
+ regs.u.r8.ah = 0x83; /* empty slot */
+ break;
+ case 0x01: /* Read function configuration information */
+ case 0x81: /* Read function configuration information, 32bit CS */
+ BX_INFO ("int15: func=%04x slot=%02x func=%02x, returning empty slot error\n",
+ (unsigned) regs.u.r16.ax, (unsigned) regs.u.r8.cl,
+ (unsigned) regs.u.r8.ch);
+ SET_CF();
+ regs.u.r8.ah = 0x83; /* empty slot */
+ break;
+ case 0x02: /* Clear nonvolatile memory (EISA CMOS) */
+ case 0x82: /* Clear nonvolatile memory (EISA CMOS), 32bit CS */
+ BX_INFO ("int15: func=%04x rev=%04x, returning success\n",
+ (unsigned) regs.u.r16.ax, (unsigned) regs.u.r16.bx);
+ CLEAR_CF();
+ regs.u.r8.ah = 0x00; /* success */
+ break;
+ case 0x03: /* Write nonvolatile memory */
+ case 0x83: /* Write nonvolatile memory, 32bit CS */
+ BX_INFO ("int15: func=%04x len=%04x, returning CMOS full error\n",
+ (unsigned) regs.u.r16.ax, (unsigned) regs.u.r16.cx);
+ SET_CF();
+ regs.u.r8.ah = 0x85; /* EISA CMOS full */
+ break;
+ case 0x04: /* Read physical slot */
+ case 0x84: /* Read physical slot, 32bit CS */
+ BX_INFO ("int15: func=%04x slot=%02x, returning empty slot error\n",
+ (unsigned) regs.u.r16.ax, (unsigned) regs.u.r8.cl);
+ SET_CF();
+ regs.u.r8.ah = 0x83; /* empty slot */
+ break;
+ default:
+ goto int15_unimplemented;
+ }
+ break;
+
case 0xe8:
switch(regs.u.r8.al)
{