mfld-fr / emu86

Intel IA16 emulator for embedded development
35 stars 6 forks source link

Fix INT 13h disk error vs unimplemented function #53

Closed ghaerr closed 3 years ago

ghaerr commented 3 years ago

@mfld-fr : This fixes the INT 13h handler, which was broken by a commit that returned 'err' rather than 0 for implemented subfunctions.

Fixes #52.

The implementation is a little tricky: programs may call INT 13h and get failure returned by CF, for instance, when querying drive status to determine if drive exists. This "error" condition cannot be interpreted by EMU86 as INT 13h failure.

Now, INT 13h only stops emulator on unimplemented functions.

Also fixes INT 13h AH=0 (reset).

mfld-fr commented 3 years ago

By the way you could also remote INT 11h that ELKS does not need, as the hooks needed to boot DOS will be implemented in another `rom-.c`, as stated in #51.

ghaerr commented 3 years ago

By the way you could also remote INT 11h that ELKS does not need, as the hooks needed to boot DOS will be implemented in another rom-.c, as stated in #51.

Yes, good idea. I will do that in a seperate PR.

ghaerr commented 3 years ago

as the hooks needed to boot DOS will be implemented in another rom-.c, as stated in #51.

It would be nice to get this rom-elks.c working correctly before @cocus applies his changes to it for rom-.c, as this rom bios is currently buggy and rejects ELKS which boots on real ROM BIOS.

ghaerr commented 3 years ago

Thanks.

I had prepared a enhancement/fix for issue #15, which removes the assert()'s from rom-elks.c and rom-advtech.c. However, this leaves the cases where the INT routine returns 0, but the "default switch" case (which indicates unimplemented) returns -1. Would you like me to post it? This would allow the emulator to reject the INT and stop emulation, but not terminate emu86 itself.

mfld-fr commented 3 years ago

Please leave the rom-advtech.c as is, I am currently working on it, and it might collide. But as you want for the ELKS part...