Order of the Butterfly
Posts: 408 from 2004/7/15
From: Russia, Moscow
Quote:
Crumb wrote:
The possibility of making Quark calls is also very interesting. It would allow you to protect/un-protect the areas you need, or maybe to remap memory areas... that would be very useful to port SheepShaver.
At least not current Quark version i guess (however, just guess, may be i'm wrong).
You can see many interesting information on your serial port if you specify some qdebugflags on the kernel's command line. Unfortunately i don't remember their names but you can find them out yourself. To do this ungzip your kernel, load it into hex editor and search for "QDEBUGFLAGS" string. You'll fing a ReadArgs() template used to parse kernel command line then (yes, ReadArgs() is also part of Quark now

). It will be followed by 3 more templates. First of them is embedded template for qdebugflags (Quark), second - for edebugflags (exec.library) and third - for ddebugflags (dos.library). These arguments (except Quark) correspond to switches in "Debug" section of your MorphOS system prefs, however setting these flags at boottime allows you to get some init-time information which is hidden otherwise.
The flag names are pretty self-explanatory.
In short, amongst other things, this will tell you about how memory mapping is set up. You'll see that it's setup during startup and exec.library doesn't change it after that. It's really an "A-Box", an operating system inside another operaring system (Quark), this is the same situation as Linux-hosted AROS, you can't get into Linux's side from within AROS, it runs in a completely virtualized isolated environment.
So i guess current Quark doesn't provide calls to do it just because noone needs it. Even if it does, we would have to disassemble Quark in order to understand them, but this is impossible (A-Box just doesn't see it, for it Quark's memory space doesn't exist, we just get hits when we try to get there).
Modules inside the kernel are compressed (debug log tells about this), so disassembling a raw kernel binary doesn't discover the kernel implementation itself.
PCI interrupts are not true interrupts, they are emulated. This means you're not a true supervisor inside them and you can't do more than you can usually do. I guess they are implemented as bottom halves.
Also the kernel really doesn't use even OpenFirmware's RTAS, despite you can find its methods names in the kernel, i've checked it by replacing "system-reboot" string with "shutdown"; after this rebooting function inside MorphOS gave reboot as before, this means this RTAS method is not used, obviously other methods aren't used also. This means my previous suggestions were wrong and it's impossible to introduce "virtual firmware" layer which would intercept some calls from within the kernel.
All we can learn about Quark are syscalls numbers which implement AmigaOS libraries functionality (like rebooting, PCI access, etc). However this won't have any practical application since these functions can be accomplished in a system-friendly manner using libraries. Moreover, noone guarantees that Quark API will not change in future MorphOS versions/revisions.
Further reverse engineering would require a giant effort of modifying MOL to make it running MorphOS. After this we could have a complete virtual machine to look what's inside.

However, personally i have neither time nor enough motivation to do it. In addition i'm enough busy with other projects.
iPod, iBook, iMac,... iRobot?