mfld-fr / emu86

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

Add symbols to disassembly listing #70

Open ghaerr opened 3 years ago

ghaerr commented 3 years ago

Hello @mfld-fr,

I was successful in a quick first pass at enhancing the disassembler to convert address values to symbol names, including private static symbols in the ELKS kernel. For instance, here's a trace of ELKS ROM kernel returning from a timer interrupt. You can see the scheduler timer list being checked and then the PIC EOI and register restore, with symbols from C and ASM. This greatly enhances the ability to see what is going on:

Screen Shot 2021-05-15 at 7 40 34 PM

I haven't added the far text segment or data segment symbol lookup yet. There might be some issues determining when a data reference should be converted to a data symbol or not. The current implementation is a hack that uses a conversion of an ia16-elf-nm namelist of the ELF system file (before elf2elks conversion) to C and compiles it in, which isn't really what we want. I was thinking of a -M mapfile option or something like that, along with the -f system image. We will need a way to specify the near vs far code segment, which I haven't thought of how to handle yet.

Is this something you are interested in? I've produced this with a 20-line hack, but it needs work and my hands are a bit full over at ELKS right now. You probably have your own ideas about how this should be implemented.

Thank you!

mfld-fr commented 3 years ago

Very interesting idea ! Please provide your hack through a PR, I would merge it into a WIP branch, so that we all could contribute to a nice feature.

mfld-fr commented 3 years ago

Concept PR is #71

mfld-fr commented 2 years ago

Improved in #80