On Wednesday, July 10th, 2024 at 7:12 AM, Marc Donner <marc.donner@gmail.com> wrote:
> The basic technique was to load pages of 360 machine code unmodified into Power PC memory, marking the pages as dirty. If the machine branched into one of these pages the VM trap handler would take the page and translate all of its code from 370 instructions to Power PC instructions. Once that was done the branch, suitably recalculated, was reinstated.
>
> ...
>
> Marc
> =====
> nygeek.net
> mindthegapdialogs.com/home
Was this under the assumption everything else going on (bus architecture, memory map, exception/trap handling, etc.) was exactly the same or was the MMU for instance in the picture translating from 370 addresses to their equivalents on whatever PowerPC machine was in play?
That or was this only expected to work on PIC, user-level code and anything touching for instance privilege escalation or with explicit address pointers, I/O port access, etc. just understood to not be applicable to such a direct translation? To tie it back to UNIX, for instance, was this thing also able to detect that a UNIX system call was being made and translate the 370 syscall mechanism into the PowerPC syscall mechanism?
My main experience with emulation is console video games so in that realm, you're dealing not only with a different CPU architecture but system bus, memory map, peripheral controllers, etc. Essentially you're not just speaking another language, you're on another planet entirely. This has lead to a entrenched belief in my mind that this sort of "direct translation" of CPU operations is a non-starter in emulation hence my curiosity. If there's some historic approach to emulation efficiently handling system architecture diversity beyond just CPU instructions, I'm certainly interested!
- Matt G.
P.S. Feeling trepid about continuing this thread on TUHS rather than COFF, but resisting the urge to bump it (again). To keep it on topic, I'd mostly be interested in how this sort of thing would handle the UNIX system call mechanism, because that would certainly illuminate the general idea of translating something more complicated than an algorithm.