mfld-fr / emu86

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

Add support for ELKS BIOS console #42

Closed ghaerr closed 3 years ago

ghaerr commented 3 years ago

This PR still contains some debugging statements useful for reproducing #41. They will be removed before merge.

Adds BIOS cursor position and scroll capabilities for ELKS; used by SDL and Emscripten backends to properly emulate ELKS when compiled with BIOS console.

ghaerr commented 3 years ago

Note: the check fail is the result of PLATFORM=emscripten in config.mk. I left that in so that the PR could be easily used to reproduce #41. It will be changed before merge.

ghaerr commented 3 years ago

Last commit fixes all problems in #41.

This PR is ready for merge.

mfld-fr commented 3 years ago

Hello @ghaerr, just for my understanding : how did you compute the timer max value ? Based on the average number of instructions per second of a 5 MHz 8086 ?

ghaerr commented 3 years ago

Hi @mfld-fr, yes, originally I did a quick computation.

But those values got changed when I was building the SDL/Emscripten support and we should recalculate to make sure we have a reasonable timer interrupt value based on instruction count. I think my original estimate was 20,000. This got changed to 3,000 with SDL and that ended up revealing the kernel/emu86 bug.

Or this timer value could be changed based on the two bytes sent to the 8254 PIT (which are not currently emulated).

ghaerr commented 3 years ago

At 4.77mhz and 4 cycles per average instruction = 4 / 4.77 = 0.839us per instruction byte.

mfld-fr commented 3 years ago

OK thanks, merging it now.