Tucker’s Status Report for 2026-12-05

This week, we had final presentations and received our final PCB. I worked on the software integration, testing, and some data analysis for our tests. I also updated the housing design. I am on schedule for software and behind schedule on fabricating the new housing. However, that’s not a huge risk, because I’ve already fabricated one for the last version of the board. I have some more testing to do with the whole package together. Therefore, this week I’ll print the new housing, attempt a new strategy for software performance, and finish up remaining testing.

We’re still seeing some slowness of software, which appears to be mostly due to high utilization of the (relatively simply pipelined) P4 CPU, which keeps me from pushing the timer interrupt frequency up. (For fun, I also measured on my laptop; I noticed a bottleneck in branch predictor errors.) My conclusion is that I can speed up the P4 by reducing the number of instructions per emulated instruction. There’s room to do so by hand, but I can scale it better by cross-compiling functions, removing many emulator branches and potentially allowing optimizations.

I’m hesitant to run a full JIT unless absolutely necessary, because that’s a massive surface for errors. In particular, there’s some sensitivity around JITing code without a fixed address, and I worry that this would introduce risk into our system given the limited time left to test. Instead, we can achieve a different speedup by pre-cross-compiling the PalmOS binary.

I sampled ~2 minute interactive runs of the emulator on my laptop where I used various apps, and it appears that the system spends at least 96% of its time in the ROM at steady-state (PC sampled every ~1k instructions post-boot. 96% in a graphics-heavy trace, 99% in a random trace), so any speedup here will result in an overall improvement.

It’s nontrivial to find all function entrypoints, but we don’t need to find all of them — just enough to be meaningful. My first strategy was to sample the IVT to get a list of ROM entrypoints. Turns out, it’s quite noisy, but the noise is predominantly from user-defined interrupts (115k writes/18k unique values vs 66 writes/65 unique values), so we can focus on system interrupts. Further, it turns out that trap 15 (vector 47 at 0xBC) dominates with 98% of dispatches in an informal experiment going to trap 15. That’s because it’s the entrypoint for system operations, such as reading and writing files. It’s a good first target!

We need to fabricate the new case. Our case for the previous revision determined that the design fits the screen and USB port well, but I made the space for keys too large, and I need to avoid some ledges that printed poorly. This is mostly bottlenecked by print time, but the whole package is only a few hours on a medium quality setting, so there’s still time to iterate if necessary.

Tucker’s Status Report for 2026-11-21

This week I’m finishing up running the emulator on the P4 microcontroller. I also worked on performance. Next week, I’m working on validation and performance. The emulator is on schedule, and the risks around it are well-known and unsurprising by now.

We’re now running the emulator as a FreeRTOS task. I achieve this by linking the emulator with our FreeRTOS code and using FFI to call into it. This is slightly unusual, but prevents us from requiring larger architectural changes to the emulator for now. We are having some difficulty with the hardware, so we write the framebuffer out to serial. It is unfortunately slow to write frames, but compressing with miniz gets this time to around 1 second at the cost of running compression.

Performance on the P4 is unsurprisingly worse than on my Mac. Now that we’re running in FreeRTOS, my measurements are more faithful than running on bare-metal (which will tend optimistic). Boot-up is the most intensive section, as it clears memory and spends a lot of time doing device writes. It takes about 75 seconds (with frame streaming on), which is about 3-4x larger than reasonable. The emulator takes 16 seconds on my laptop, so we’re looking at about a 5x disadvantage. Interactions appear within about 1.5 seconds: some amount is due to emulator speed, yet this is confounded by: time to send frames over serial, the (emulated) timer interval, the scheduler, and compute overhead of compressing and streaming frames. I’ll discuss more in the next paragraph: I’ve learned that I don’t have the right tooling to measure practical latency yet.

I demonstrated this week that boot time is not a good predictor of usability. I planned several changes for performance (reducing allocations, updating rustc, LTO, using a single compilation unit, switching to m68k as CPU backend, using JIT) and measured almost every change to increase boot time, ending up with what appears to be a 50% regression in boot. Yet, after every change I also used the emulator interactively, and I observed a notable speedup in touch and frame latency. This has added unanticipated work, as I want to understand why the discrepancy exists (JIT is obvious: time compiling up front, time saved later; why updating rustc caused a major regression is less clear) and I need to write benchmarks against interaction latency.

Much of the knowledge needed for the emulator is in interface specs: the DragonBall VZ, the SED1376 display driver, etc. Architectural details about the m515 are largely not documented; some I’ve figured out through reverse engineering, some through the writings of reverse engineers like Dmitry Grinberg. The interface between PalmOS applications and the kernel is well-documented in prose by Palm. Similarly, m68k toolchains (I used gcc) are well-documented in manuals by their authors (though I often find the gcc manuals confusing and spend a lot of time on them). My strategy here has largely been to read a wide swath of online literature to extract high-level details during design, and then close read the most relevant sources during implementation.

It is difficult to disentangle what systems knowledge I’ve learned specifically for this project; I am already focused on systems and will work full-time on OS performance. Therefore, I’ll focus on my learning strategy this semester. I’ve acquired a lot of general embedded, systems, and performance knowledge through book learning and coursework. I read Remzi and Andrea Arpaci-Dusseau’s Operating Systems: Three Easy Pieces and am reading Hennessy and Patterson’s Computer Architecture: A Quantitative Approach (3rd Edition). While less specifically applicable, Stevens and Rago’s Advanced Programming in the Unix Environment presented broad ideas that have been useful here. I’ve read some of Brendan Gregg’s work (and have plans to read his book Systems Performance). Finally, I drew upon things I learned in 18-349 Embedded Systems course, 18-213 Computer Systems, and 15-441 Compilers, as well as parts of 15-445 Databases and 15-410 OS; I also drew upon performance and RISC-V knowledge developed in a hobby OS and in my compilers project. Most of this material either has exercises included or has been used towards a project of mine at some point, so my strategy here has been to work through closely and gradually over months.

I’ve mostly learned about FreeRTOS through their website. I skimmed their docs early on because I care mostly about the high-level architecture; other details I’ve picked up from their website later on and from Maggie’s code. I’ve learned about the ESP32-P4 and ESP-IDF toolchain through their documentation. This has mostly been understanding interfaces, so the strategy has been to search when the need arises.

In the interest of preparing to work in an industry heavily using LLMs, I have experimented with using Google’s Gemini-3.X and OpenAI’s Sol-6.2 to dig up facts and further reading. I was hoping that given their large training sets, they would be effective at identifying likely high-quality sources. I am not satisfied. In these cases, I’ve independently researched and come to a conclusion to compare against. For facts that are not “common knowledge,” the Gemini models appear to regularly hallucinate details and bias towards suggestions by the user, regardless of sources given or found. The OpenAI models appear to report facts reliably, but since I’m looking for obscure details, it tends to use the most direct option available — pulling someone else’s github code and scanning it — and this is uncomfortable in terms of integrity and licensing. Therefore, I’ve avoided using either as a search engine or for source discovery. It is possible that the situation has changed in recent weeks, especially having seen the recent Riemann news. In general, though, I’ve found that the sources and strategies that stuck with me the most were human recommendations, and I would be interested in hearing about teams and people that are effectively using LLMs to find sources.

Tucker’s Status Report for 2026-11-14

This week, we gave our interim demos and received our new dev board. I worked on SMD soldering for the dev board and on emulator support, in addition to more testing of the emulator.

Our new PCB is here! We ordered small components pre-assembled, and did the MCU, radio, some pull-ups, and through-hole components ourselves. We cut our stencil for paste application, which worked, but had some of its own issues. Any solder bridges here would present a major risk, as we want to minimize the additional runs through the reflow oven or in rework. In the end, I spent a while fixing the paste layer with tweezers and a knife, then on placement under a microscope. It worked out, as we didn’t bridge anything, but we had a few joints on the MCU fail to flow correctly and need fix-up.

I was hoping to test the emulator interactively on-device over the weekend, but due to further work soldering, and an unforeseen work bringing up the PCB, I don’t think I will get to this point. However, I’ve made progress on the dev board tests. This is the same test suite that runs on my laptop: testing device stubs, boot, app injection, and correct interactivity. This is still the largest risk for me!

I also performed further extensive testing of the emulator on PC, cumulating in demonstrating that the device reliably functions, including correct functionality of first-party and third-party apps, under regular interaction, for at least an hour. This is more intense than anything we demoed, but assures us of correctness, and is practical for the final demo. I found an issue where the emulator stopped after being left idle for several minutes, and I believe I’ve corrected it, though it’s hard to validate that an intermittent bug is fixed (especially when waiting for it to potentially reappear takes minutes, and I need to try repeatedly).

The next big milestone for verification on the emulator subsystem is on the intergrated device. Emulated devices and the interrupt controller need to interface with hardware and firmware, which means more code to test, and a “fuzzier” view of the overall system. We become more sensitive to MCU and peripheral throughput and latency. Therefore, we need to check the integration against the concrete specifications laid out in our proposal, and we need to interact with it and extract subjective results. I’ve done some UI tests with friends, and I’m tentatively doing the same with local family friends (with parental consent). If that falls through, I’ll increase the rigor and span of testing with peers.

Tucker’s Status Report for 2026-11-07

This week I was scheduled to work on running the emulator on the dev board, and third-party applications on the emulator.

We have demos during the coming week. Our new PCB got delayed, so our dev boards right now have no display. While seeing tests pass without a screen is meaningful to me, it doesn’t provide a very good demo. Therefore, I’ll show the emulator executing on my laptop for the demo. As a consequence, I’ve prioritized running third-party apps over dev board work, and so I’ll extend that by another week.

We can install apps now! Out of the box, PalmOS stores applications along with other persistent data in half of RAM. Typically, apps are installed over HotSync, which I believe is backed by the VZ’s UART. However, the UART device is not sufficiently fleshed out to use HotSync, and I don’t have a HotSync client. Setting it up would take a great deal of work. On the other hand, we could develop a library that writes the correct database entries to persistent memory without involving PalmOS at all – but this requires digging into implementation-specific behavior.

Fortunately, we can exploit a different well-understood interface: the PalmOS ABI! I mentioned previously that it’s a massive surface to emulate, and that there isn’t really any user/supervisor separation in PalmOS, which is why we aren’t reimplementing the ABI. These disadvantages are actually advantageous here: to install an app, we can inject a sequence of traps into the ABI to persist the app binary! It feels a bit like black magic to hijack the guest OS to upload an app, but it has the least room for error of our options.

For running on the P4, I’ve reworked the system to receive events on channels. That’s sufficient for testing, and for interactive use it will just take a refactor to use FreeRTOS queues instead. I’m not truly processing interrupts yet; I still wait for the last interrupt to finish before delivering the next, regardless of priority. But it works! It also lets me add debouncing, in case e.g. touchscreen interrupts on the P4 are too frequent.

The coming week will focus on pulling a lot of different apps from PalmDB and testing them, to try and smoke out bugs in the implementation. I will also be continuing work on the dev board.

Please enjoy my game of 2048, and politely ignore the parts where I have to stop and think after not having played since 2017 🙂

Tucker’s Status Report for 2026-10-31

Last week, I reported that I was slightly behind schedule. I’m happy to report that the emulator stack is back on track, and it’s been a fun challenge to get to this point.

I am very excited to report that it is now interactive, and performance is good on my laptop! PalmOS takes around 340 million instructions to initialize and check its internal state and all peripherals. To complete this process, we mimic the peripherals accurately enough that the software can’t tell it is sandboxed. Afterwards, the CPU sleeps (which we need to communicate up the stack to the host OS so it can sleep). Touch events are the first interrupt implemented, and the interrupt most critical to interactivity of the device. (NB: because PalmOS does not multitask, general interaction does not require timer interrupts, so they have not been high on my priority list.)

I ran into an emulator bug with PalmOS shutting down after interrupts. For simplicity earlier, I spoofed some GPIO reads to zero when the initialization process does not depend on realistic values. As it happens, GPIO Port D measures the battery level. PalmOS reads battery level during boot, but does not stop the boot process if the battery level is too low. However, it does check after the first interrupt, so the first touch caused the device to assume it had no battery left and shut down. Now we provide a fake charge level.

There are two more steps to take in the immediate future. One is to implement more interrupts, which has a very concrete “success” outcome. The other is more design-heavy: asynchronous delivery of interrupts. I’ve forgone this for now, because the most performant and power-aware design for my laptop is almost certainly not the right choice for our ESP32-P4 processor running FreeRTOS. (After all, targeting our specific package is a major advantage of writing our own components.) I’ve been sketching this out throughout the week; currently, I plan on sync points between every few instruction executions where we check a queue. I’m eager to play around with a properly async design with multiple tasks, I suspect it won’t be worth performing as an optimization (and could potentially hurt performance) and it would only be worth trying as a learning exercise. We will see!

Having seen comfortable performance margins (despite running on a much more capable core), my assessment of the risk of performance has gone down. I have confidence in my ability to achieve fully performant execution. By the end of Monday, I’ll have complete data about performance on the P4, and will adjust the emulator schedule appropriately. I think storage carries some risk – we are working with finite flash on the device, and I’m worried about the complexity of emulating an SD card to PalmOS – but our current forecasts look good, and we have back-up plans for these problems. On the emulator side, the risks I’m aware of are manageable!

I do not any adjustments to the schedule of emulator work at this time, but will reevaluate depending on performance data.

Tucker’s Status Report for 2026-10-24

Hello again! This week, I kept working on the emulator and have new plans for the housing. We received most of our parts, and will be doing integration soon. Over the next two weeks, my job is to bring up the emulated Palm OS on the dev board, not just on my laptop!

I’ve been refining our model of the m515 components based on areas I know mismatch real hardware and where the PalmOS image stops making progress. One thing that I’m deliberately not faithfully recreating is the chip-select system. This version of PalmOS initially runs without the chip-select system set up (and thus truncates all addresses) and then initializes it to a known pattern (lower half of ram for ephemeral memory, upper half for storage, and a 4MB flash). The only changes after this are write-protecting and un-protecting the storage half of memory, as a rudimentary way to detect accidental writes. (This does not protect against a malicious app, as all programs are run in supervisor mode.) Instead of fully implementing the chip-select system, I hard-code the chip-select configuration for performance.

I measured instruction/data memory time as making up nearly 90% of execution time in warm optimized builds, because the emulator must do an operation for every instruction and data access, and a naïve approach has indirection and branches. (I would like to research what the ratio is in real hardware…) Therefore, my hypothesis that it’s the first place to look for performance improvements is correct! My (yet-to-measure) theories on the best way to optimize: emit separate emulator code for pre-chip-select and post-chip-select code to avoid branches, emit separate code paths for instruction fetches and data read/write, and try catching MMIO accesses with hardware traps instead of a branch (which may be less performant during boot, but I hypothesize that it will be more performant later). We can make a lot of improvements since accurate hardware-timing is a non-goal (and we can always slow it down later if it becomes a goal). More work to come!

We decided to use low-profile low-actuation-distance keyboard key switches for buttons: they’re very easy to source (my house is full of them), very reliable, have a convenient post for mounting a cap, and of course feel great. As a result, the case will have a different button spacing and needs less structure for keeping the buttons captive.

Next week, I’m still working on the emulator, especially on the dev board. Performance continues to be a major risk here, and I’m contemplating setting up more benchmark measurement infrastructure. I’m excited to see how our hardware integration goes!

Tucker’s Status Report for 2026-10-10

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 smile drawn in m68k assembly

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.

Tucker’s Status Report for 2026-09-26

We are on track for work this week. In particular, we’ve narrowed down a lot about our design and component selection, including some fortunate changes towards the end.

We’re aiming roughly for Palm m515 compatibility, as it’s later-generation and fulfills our needs while still being of reasonable scope for a capstone. The m515 has 16MB RAM and 4MB flash, as well as a 33MHz processor. Very few embedded packages have this amount of RAM; for this reason, some prior art upgrades to a Raspberry Pi. This is certainly workable, but it’s overkill for our purposes. However, we don’t want to adopt the complexity of routing our own RAM chip.

I found a ESP32-P4/32 based board in stock with 32MB RAM and 32MB flash, and Sophia found stock of the chip. 400MHz will give us sufficient overhead for emulation, and the MCU has a low-power core appropriate for idle work. I developed a pin map to ensure feasibility, and I’ve started working with the HAL in Espressif’s `esp_hal` crate.

As mentioned last week, I’ve been understanding the 68k landscape. I’ve written a few simple programs using the Easy68k assembler/simulator, written by Brad Krupp and The Great Emerson.

My plan for the following week is:
– Case sketches by Monday night
– Practice using the 68k disassembler by Wednesday night
– Case model; instruction decoding in the hypervisor by Saturday night.

In case of unexpected delays, this schedule has quite a bit of room to flex, as it’s still ahead of our global schedule. I’d like to save that flexibility for future risks, if possible.

Tucker’s Status Report for 2026-09-19

I’m writing an update for a week and change, since this is my first update!

At the top of my mind has been the proposal. We received great feedback on our abstract, and this led us to focus our problem statement and update our design. Ultimately, we were able to improve in areas we were given feedback and in areas we personally found weak. I presented, and planned for the points I wanted to hit — especially in making it clear to a student audience, most of whom have not used PDAs, why they’d care — and for the questions I expected to come up.

Slightly ahead of schedule, I’ve been exploring the M68k ISA and laying out the foundation for an emulator. I expect a large part of the challenge in running PalmOS apps will be understanding what assumptions they make: it would be costly to replicate every platform quirk, but insufficient to throw timing and other observable-but-flexible behaviors to the wind. Therefore, I want to understand what we’re looking at early.

As an aside: we’d like to improve upon processor speed if possible, to open the ecosystem to new capabilities. If PalmOS or particular apps depend on timing behavior, we might not be able to do this. We will find out!

This week, I’m working on the device housing design, and looking ahead to the emulator. While the deadlines are relatively lax (as the next critical dependency is ordering our PCB), this will account for software needing more time than expected.