RePalm – Hardware Emulation of PalmOS

RePalm is project to do Hardware Emulation of a PalmOS. Pretty much still a work in progress but the site contains a lot of details on how PalmOS works.

Website link

Hacker News discussion on the project

4 Likes

Great find! IIUC, it turns out PalmOS started life on 68k then was ported to ARM, so there was already a mini emulation layer in there to support old programs. And there’s a device adaptation layer which contains all the device specific code, with a mere 200 undocumented facilities in the API.

RePalm runs UNMODIFIED OS, with only DAL.prc replaced. Literally: use the T|T3 rom and you get a tungsten t3. Use a Sony TH55 rom, and clie organizer runs as on a real TH55

The time had come. I rewrote the drawing code. Function by function. Line by line. Assembly statement by assembly statement. I tested it after replacing every function as best as I could. Along the way I gained the understanding of how PalmOS draws, what shortcuts for what common cases there are, etc. This effort took two months, after them, 30,000 lines of uncommented assembly turned into 8,000 lines of C. rePalm finally was once again purely my own code!

1 Like

I have a working Palm III. I have used it as a comparison for a PDP-11; it’s a 16 MHz 68000 w/ 1 MB of RAM and several MB of FLASH ROM. I’ve never bought into the “68000 is 16-bit” claim, but still, as a rough approximation it’s nearly 4x the computer that my PDP 11/34As at something like 5 MHz (I’ve not found a precise reference for the 11/34A clock) with 256 kB of RAM.

1 Like

About a possible PDP-11 connection to the 68000, see this usenet thread where Clem Cole writes (emphasis added):

As the one of the 68K designers (Les Crudele) said to me once, when they wrote the microcode, there were not thinking about instruction restart - so the issue was that Nick did not save enough state to do it.

The model for the 68000 that they were using was the base/limit PDP-11 and the original PDP-10. Also at the time, the competition was the 6800, the 8080, Z80, 6502. They were trying to put a PDP-11/70 on chip (without getting into trouble like CalData did - which Les, Nick and team were very aware having been DEC and CalData customers before they were at Moto]. While we think of the 68000 family has being 32 bit, the fact is inside it is a 16 bit system (the barrel shifter and execution functions are 16). And it was a skunk works project – the 6809 was Moto’s real processor. It was an experiment done by a couple of rogue engineers that said - hey we can do better, The fact was they made a chip that was good enough to actually compete with the Vax in the end, because it was fast enough AND they had the wisdom to define 32 bits of address space and 32 bit operations (again having been PDP-11 users), but as Les used to say - part of the thinking was that while DEC was moving to the Vax, they had hoped to break into the area that they 16 bits minis claimed - which they in-fact did.

Elsewhere, Clem Cole again writes something similar:

Interesting- the 68000 should remind you of the PDP-11. What would become the 68K (remember it was a skunk works project and not an official one), was a definite reaction to the 6800/6809 not being good enough (single accumulator system; not general registers). As someone that cut his teeth with the 6502 (and 6800) at the same time as I learned the 11, I never considered them similar.

That said, the 68K guys were all PDP-11 programmers (in fact the CAD system as it were, was an 11/70 running a V6 flavor). Les Crudele (Lead designer of the 68000) once told me that they wanted to use the PDP-11 instructions set, but KO had just put Cal Data out business for using the same instruction set on a the same (Uni)bus. So you can definitely see the Unibus influence in their “experiment” but part of why it has A and D registers was to make sure it was different enough from the 11 that no one could claim a rip off.

I asked Les why they did not try to license it from DEC, and he said they were afraid the project was going to shut down, so they kept a low profile. They just wanted to prove that they could make a chip with a 16 bit barrel shifter (which is the major real estate issue when you look at the 68K - is the big array in the center of the chip), and a real bus. BTW: one of the other really good things that the 68K inherited from DEC that it’s brethren at Moto and MOS Tech lacked was the idea of an unimplemented op code generating an exception.

2 Likes

Very interesting! I’ve never thought of the PDP-11 when looking at M68k, but I’ve also not used M68k assembler in the way that I have 6800 (in college) or ARM (in the real world), for example. I’ll have to look again.

I use my Tungsten T3 daily. There’s only a single application I still need, and that’s a timesheet tool that I’ve not been able to find the equivalent of anywhere. And I’ve looked… really looked. Android has tons if you search for timesheet, and they’re all basically useless compared to what I use on the Palm.

Although Timesheet is the only application I still use, I also get birthday notifications etc. because the T3 has a calendar application and I added info there a very long time ago. But I could fire up the tomtom sat nav app and it would work as excellent as always (albeit with old maps), better than the actual Tomtom devices at that time.

This T3 is still running on its original 15 year old battery… and it keeps for a couple of weeks between charges still. I have a second T3 too, slightly older, I replaced that one’s battery with a larger one some 10-12 years ago. I kept them in sync with a common CardBkup to and from SD card. I used the ‘old’ T3 much more than the one I use now, so that one’s replacement battery (Li-Polymer, not Li-Ion as the original) eventually worn out. This one I expect to run for a few years more.

Eventually I’ll need a replacement for that timesheet application. Either something that is usable and runs on my phone, or the hardware replacement Dmitry is working on :slight_smile: (I wonder btw if that Dmitry is the Dmitry that did all kinds of Palm hacks back when I was reading Brighthand? I didn’t check).

3 Likes

That’s amazing. Since you haven’t yet found a replacement for that application, being able to emulate a T3 on a new hardware platform and continue using the app might work for you for many years to come. :slight_smile: