As for handling the hooks, again, why do you think this is even a problem? It is no different from handling any other part of the system - you need to trap any attempted read/writes from/to the "host" and translate appropriately. Tedious, sure, but not much more.
If you think it can be done in filesystem context, ok. I was thinking it would be too slow and thought about implementing ExAll() emulation in Emumiga. My mistake.
But more importantly, since the number of possible applications is small and finite, if there are any particularly troublesome applications you can add workarounds for that specific application.
This is a shortcut for rewriting a subset of applications - it doesn't need to be perfect. It needs to work for the m68k applications a reasonable number of people still care about and where it's not easier to port an existing alternative application instead. For the rest there's UAE.
There arent that many applications indeed. But dont assume people wont try all kind of exotic applications.
I think a lot of those of you that think this is so hard are massively overestimating the scope of this.
I think you just dont know Amiga software very well. If AmigaOS design was kept easy and simple like it was in Kickstart 1.3 it could even work. In release 2.0 Commodore developers really screwed it up.
We don't need Emumiga to be able to run every legal m68k Amiga app - the only reason to do that would be just to say you can -, just ones already in existence. We don't need Emumiga to even be able to run all of the ones in existence, only the ones that people want to be able to run regularly on AROS with tight integration.
So Emumiga will be tailored for each application? My wish list would be very short: Blacks Editor because it is still the best text editor for Amiga. AmiNetRadio and dynAMIte could be nice to have, too. I can not remember any other useful 68k applications/games anymore.
There's no doubt Emumiga will be a lot of work, but even if you have to add manual workarounds for a lot of the applications in the "interesting" set, it'd still be feasible.
When working on OS4Emu I added manual workaround for every known hook in MUI (this because ABI is different in MorphOS). If you love that kind of stuff, nice. I can compile list of MUI hooks if it is any help with Emumiga development.
It's fairly simple to automatically create thunks to handle this. I've written enough compilers with custom object systems to have done far nastier things than that.
Hmm? Do you realize how often OO application are going to have context switch between 68k and AROS native code? You can not even figure out when 68k code is calling native AROS code because it is nothing but jsr() to a pointer. Nothing is going to tell you 68k code is trying to call AROS BOOPSI dispatcher code. This is not only Zune/MUI related issue but concerns all BOOPSI driven applications and classes.
This problem is related to 68k hook implementation. BOOPSI dispatcher is an extension of struct Hook -- if there is any chance that 68k code could call your BOOPSI dispatcher or hook function you are in trouble.
Just ask how many problems the OS4 dev team had with their MMU driven context switch code. It never worked properly and they went to trap based implementation. Since AROS can not use traps I dont see how this could be handled at all.
But back to data endianess problem. How do you can really know what kind of data structure there is behind Object pointer? Depending on object type its data structure extension is different. Are you going to detect data structure format based on its pointer + allocated space for object?
(Obviously naive endianess swap in 68k emulation code can not work because data could be written to the disk for example.)
Since the m68k side is emulated, you can easily lazily mutate data first when it's actually needed on the m68k side. Will it be slower than "just" emulating everything in UAE? Maybe, but frankly it doesn't matter with the performance of modern x86 hardware.
Anything that executes 68k code faster than real 060 is already enough and 020 level of performance is still acceptable. It could be an issue in the operating system code i.e. when executing layer hooks where multitasking is suspended.