i seriously appreciate your readiness to always help me and the other folks on here out, chuck. there's a fair bit of code in the main file cpu.c, so feel free to back out of this. i don't want anybody to waste their time unless they actually like bug-hunting.
if you run the exe in the zip, start it like this:
fake86.exe -fd0 dos201.dsk -csip
the
-csip causes the emulator to keep the current CS:IP of the emulation to be shown at the top right as it runs. this just runs in 80x25 text mode under DOS. you'll see it running the BIOS from the xtbios.bin file as it POSTs. (or maybe you wont see it if you're on a modern computer, it goes by extremely quickly)
it is set to emulate a 48 KB memory space, and you'll see that after the BIOS code runs it boots the DOS 2.01 floppy image correctly. you can play around with it and see that everything runs properly. then, start the emulator over again using the same command line but this time add
-m 256 to the end, and it will try to emulate a 256 KB memory space.
at this point you should see that the BIOS POST has found a memory error. i've also tried a modified version of the BIOS where i made it ignore the memory error and attempt to boot the floppy image anyway, but it just hangs there unable to load DOS correctly. i've also tried it with a DOS 6.22 floppy image, and that one will display "Starting MS-DOS..." correctly but then it also hangs.
you will see the CS:IP that the emu is running continue to change, which shows that it is still running, but something is broken that stops DOS from working. if you were to recompile the same watcom project but set it to build a 32-bit version, and then run that using the exact same command line with
-m 256 it works perfectly.
i'm still going through the code myself as well, seeing if something eventually jumps out at me that would cause a problem in a 16-bit program. the header files are a little messy, this was just a quick 'n dirty attempt at making a scaled down DOS version of this program from the regular windows/linux codebase. there are some remnants that i didn't bother removing from the headers. i was just curious as to how quickly it would run on (very) old machines.
EDIT: if you actually did recompile it for 32-bit, a couple changes would have to be made. interrupt calls to the host system would need to be changed. when the code being emulated tries to do an interrupt call to 10h or 16h, it just passes those through to the host system interrupt handlers and resumes emulation. all other interrupts are handled normally by pushing the flags/CS/IP and jumping to the location specified in the IVT.
the keyboard stuff would have to be changed to use kbhit() and getch() stuff, and a quick way to see that it's printing the right stuff out is to have a printf("%c", regs.byteregs[regal]) when a call is made to int 10h for function 0Eh. all of this stuff would be done in the intcall86(uint8_t intnum) function.
the farmalloc would also have to be changed to a regular malloc in main() where it allocates the memory. all in all, it's far more trouble than it's worth, so you can just trust me when i say that it does work correctly as a 32-bit app.