Hi, I think I found the *bug in EMM386* which makes it FDXXMS
incompatible...
EMM_ENTRY PROC NEAR
...
cmp ah,087h
jne normal_emm_functions
pop ecx
CALL SIMULATE_INT1587
jmp @@BYECX
...
There must be a "push ecx" right before the "call simulate_int1587",
and you must jump to "byeems", not to "byeecx". Otherwise, the DEFINE
V8086_ES EQU <ESP+34> ; ES on the Level-0-Stack
does not work out right. In other words:
EMM386 1.15 calls SIMULATE_INT1587 with one dword too little on the
stack, which makes the alledged "read caller ES" go wrong (caller DS
instead of caller ES is read) inside SIMULATE_INT1587 itself.
This means that EMM386 is incompatible with all programs which call
int 15.87 with ES!=DS, because the caller should pass a data structure
at ES:SI, while EMM386 erroneously reads from DS:SI.
FreeDOS himem happens to set DS=ES=CS before calling int 15,
which made it immune to the EMM386 bug.
Wow. That problem has been hunting me since 8/2003, maybe even somewhere
back in 2001. A big cheers to the people behind Bochs 2.2pre1 :-)).
And of course to myself, yesterday I recognized that I had, by accident,
tried to do DEVICE=lbacache.COM, after a long session of Bochs debugging,
trying to travel back in time (processing had run into the go_protected
of emm386 after jumping into the void because lbacache.com has no device
header, which in turn could be traced back to the execrh code of the
kernel (with Tom's typical patch for the "bloody f... rtsnd").
Open source really makes the impossible possible - you can surf CPU
registers and stack traces, link them back to the source code, and
finally realize that at one tiny instruction, something has a result
which differs from the INTENDED result.
Now it is time to stop Bochsing for a while and enjoy the spring
wheather outside, even though I have not figured out how to see through
the very fabric of that "Matrix" yet =8-)).
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel