mfld-fr / emu86

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

Add trace filter and PC/XT/AT target #56

Closed mfld-fr closed 3 years ago

mfld-fr commented 3 years ago

Closes #30

ghaerr commented 3 years ago

@mfld-fr : Lots of nice changes in this PR :)

Having a "reference" BIOS is a good idea, although we might want to think about how/whether to share some routine code, like disk I/O outside of INT 13h, and the ongoing code maintenance issues. But for now, it will help a lot keeping the other targets minimal.

The reference BIOS will allow routines to be removed from rom-elks.c, which I will do, to keep it strictly dependent on what ELKS uses.

The trace filter looks very interesting: does it just show instruction tracing that hasn't occurred before?

Thanks!

mfld-fr commented 3 years ago

The trace filter looks very interesting: does it just show instruction tracing that hasn't occurred before?

When trying to find out what was wrong with the FreeDOS boot, I used the trace mode, but I got a ~50 MB trace log, with many iterations on the same instructions, resulting in ~1 M lines to analyze. So I applied that filter that makes the instruction to be printed only one time. For example, REP MOVS is printed once, even if CX contains a large value.

The resulting log after filtering was ~ 80 KB, so easier to analyze. By the way, I also saw that one could easily output the assembly code by just sorting the filtered trace log.

ghaerr commented 3 years ago

The trace filter sounds promising. I will play around with it after it's finished. It has a command line option, right?

For example, REP MOVS is printed once, even if CX contains a large value.

It is still interesting to trace instructions without the new filter. But I've been thinking that all REP instructions may want to, by default, not show repeated execution. This saves lots of time when single stepping through code that is moving data around, such as the f/memcpy routines in ELKS.

mfld-fr commented 3 years ago

Added filter option and make con_put_char more portable in latest commit

ghaerr commented 3 years ago

Looks good, thanks for adding BIOS Console fixes to reference BIOS.

Maybe commit this now, since it is getting kind of large and API changed for con_put_char. This will allow me to continue working on getting EGA text color modes implemented and test overall PR changes on ELKS.

mfld-fr commented 3 years ago

OK, thanks for the review !