On Mon, 8 May 2000, Steffen Winterfeldt wrote:
> my changes to David's patch are available (or should shortly be) from
>
> ftp://ftp.suse.com/pub/people/snwint/dosemu/dosemu-1.0.0-pl4.diff
>
> The patch is against a plain dosemu 1.0.0.
I got it. After more testing I found some more issues and ideas:
1. Some emulated int 0x10 routines try to write to the video memory and
get a page fault. This causes "strange" hangups. For instance:
VGAEmu: vga_emu_fault: write access to bank region, address 0xa7b60, page
0xa7, vga page 0x7
VGAEmu: vga_emu_fault: cs:eip = 313e:6baf, instr: 26 86 2d e8 c9 fc 07 5f
c3 a1 42 75 b9 50 00 33
VGAEmu: eax=00006060 ebx=00000000 ecx=00000e20 edx=000003cf esi=000006d0
edi=00007b60
VGAEmu: eip=00006baf cs=313e/000313e0 ds=3ffd/0003ffd0 es=a000/000a0000
VGAEmu: vga_emu_fault: 3 bytes simulated: xchg ch,es:[di] fault
addr=000a7b60
VGAEmu: eax=00006060 ebx=00000000 ecx=00008020 edx=000003cf esi=000006d0
edi=00007b60
VGAEmu: eip=00006bb2 cs=313e/000313e0 ds=3ffd/0003ffd0 es=a000/000a0000
VGAEmu: GFX_write_value: bitmask = 0xff
VGAEmu: GFX_write_value: write mode = 0 (ignored)
scroll up 0 0, 79 30, 0, 0
VID: Scroll parameters out of bounds, in Scroll!
VID: Attempting to fix with clipping!
VGAEmu: vga_emu_fault: write access to bank region, address 0xa0000, page
0xa0, vga page 0x0
VGAEmu: vga_emu_fault: cs:eip = f000:0102, instr: cf 00 00 00 00 00 00 00
00 00 00 00 00 00 cd 11
VGAEmu: eax=00000600 ebx=00000000 ecx=00000000 edx=00001e4f esi=00000364
edi=0000b3de
VGAEmu: eip=00000102 cs=f000/000f0000 ds=3ffd/0003ffd0 es=97ff/00097ff0
VGAEmu: vga_emu_fault: 1 bytes not simulated: iret fault addr=000a0000
VGAEmu: eax=00000600 ebx=00000000 ecx=00000000 edx=00001e4f esi=00000364
edi=0000b3de
VGAEmu: eip=00000103 cs=f000/000f0000 ds=3ffd/0003ffd0 es=97ff/00097ff0
VGAEmu: vga_emu_fault: write access to bank region, address 0xa0000, page
0xa0, vga page 0x0
VGAEmu: vga_emu_fault: cs:eip = f000:0103, instr: 00 00 00 00 00 00 00 00
00 00 00 00 00 cd 11 cf
VGAEmu: eax=00000600 ebx=00000000 ecx=00000000 edx=00001e4f esi=00000364
edi=0000b3de
VGAEmu: eip=00000103 cs=f000/000f0000 ds=3ffd/0003ffd0 es=97ff/00097ff0
VGAEmu: vga_emu_fault: 2 bytes not simulated: add [bx+si],al fault
addr=000a0000
The obvious place to fix this is the file which contains the int 10h
routines, src/base/bios/int10.c
2. Emulation using a limited modr/m decode table should avoid long case
statements and still catch a lot of different cases, something like:
case 0x86: /* Instruction is 26 86 .. : xchg byte */
if (cp[2]<0x40 && (cp[2] & 7 != 6)) {
mem = mems[cp[2] & 7];
reg = regs[(cp[2] & 0x38) >> 3];
memptr = U_CHAR(x86->es_base + (*mem & 0xffff));
uc = Logical_VGA_read(memptr);
Logical_VGA_write(memptr, (unsigned char)(*reg));
(unsigned char)(*reg) = uc;
return 3;
}
regs = {&(x86->al),&(x86->cl), ... }
mems = {&(x86->bx+x86->si) , ... }
I'll volunteer do this kind of stuff and would welcome any suggestions.
Bart