This week, I found myself busy with midterms and interviews. Nonetheless, I’m ahead of where I expected on emulation (so far) and working on the design report.
I’ve pulled in Martin Hellspong’s `r68k` CPU emulator as an EC000 stand-in for the time being. I’m not sure if this will be viable for the final integration, as we may have tight margins on CPU performance. However, this allows me to work on emulation and package/IO integration simultaneously, because r68k defines an interface for memory/flash/MMIO and interrupt controller that also works for my version. (Memory, being a hot path, will almost certainly need tighter integration on the integrated board, but I don’t have data to prove that yet.) I’ve also completed further work on my version of the emulator, being able to decode the whole instruction set and execute a subset.
The net result is that we can run the test programs I’ve written, outputting to a MMIO-configured UART. We can also run about 25 million instructions of PalmOS before we hit a yet-to-beimplemented device (one of the GPIO controllers). The challenge right now is mimicing the VZ memory bus: in order to get this far in boot, I have 9 virtual devices (lumping the GPIOs into one, which is not quite true, because they all correspond to different external devices!)
We’re not far enough in boot to draw on the screen yet, so… Here’s a smiley face I drew on the LCD controller! My first drawing in 68k assembly. Brings me back to learning to write code in Small Basic.

A fun fact: we’re targeting PalmOS 4.X, which does not do memory management in the traditional sense. It can run 4 groups of memory, and system registers (in the VZ package) are mapped into the top of the address space. PalmOS 6.X was supposed to introduce memory protection, but came only towards the end of Palm’s success. (This is a major factor in why we’re running PalmOS, and not just the apps, since they do not have not a modern expectation of isolated memory.) I wonder if they are the last popular general-purpose computers to lack an MMU, but I have not pursued this line of research.
I’m quite happy with the results this week! Now on my end, the goal is to keep squashing discrepancies with the VZ so we can keep booting. Part of that will be setting up a debugging system so I don’t have to keep flipping between the emulator and my disassembler. The major risk at this point is in emulator speed: I intend to update our schedule with time for benchmarking r68k on our dev board.

