mfld-fr / emu86

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

Optionalize the target support #3

Closed mfld-fr closed 3 years ago

mfld-fr commented 7 years ago

Today EMU86 is used in two cases : testing MON86 / SYS86 before flashing it into the real target, and testing ELKS on an emulated PC platform. So build two versions of EMU86 : emu86-pc for PC platform, and emu86-sbc for Advantech SNMP-1000 SBC, each one with it specific INT, MEM and IO support.

ghaerr commented 3 years ago

Hello @mfld-fr,

This would be a useful addition.

I am in the process of implementing a "headless" console option in ELKS, where ELKS is built on top of just two BIOS calls for console I/O, instead of using the full ELKS BIOS Console, which has problems because of emulated cursor management, etc.

The other headless configuration would be a true "serial console", where console I/O uses a serial port. This option is different that the current CONFIG_CONSOLE_SERIAL, which just directs kernel output to the serial port.

For EMU86, ELKS could be verified running on a much smaller set of BIOS routines, something much closer to bare metal. With optionable EMU86 target support, that development process could made easier and quicker.

It could make sense to use #ifdefs/#ifndefs in emu-int.c, rather than completely separate source files per target. This would allow an "all" version that had everything, for porting new code, while the target could be changed during development and adaptation of the OS as well to the real hardware.

mfld-fr commented 3 years ago

@ghaerr : Sounds good ! About the target selection, I just pushed my working branch to show you my latest changes to implement a more low-level emulation at device level, rather than BIOS level, for you to figure out why I am currently wondering about the way to cleany unify the code for all targets : https://github.com/mfld-fr/emu86/tree/sys86

ghaerr commented 3 years ago

why I am currently wondering about the way to cleany unify the code for all targets

You have a lot going on, I will have to think more about it too.

A couple thoughts on your working branch (these are just general thoughts for a possibly organization):

mfld-fr commented 3 years ago

Finally, keeping the same executable name, but with options in Makefile to select the emulated target : 'elks' for standard PC, and 'advtech' for SNMP-1000 SBC. Done in #14 (first commit).