[NTLK] ROM patches, ROM Extensions, and Watson

Matthias Melcher m.melcher at robowerk.de
Mon Mar 21 07:38:44 PDT 2022


A detailed explanation on NewtonOS ROM Extensions (also called REx)

When Apple developed NewtonOS 2, they were very hopeful that they would get licensees for their OS. Just like with Android today, they wanted other companies to license the core NewtonOS, but also give them a chance to customise logos (like the lightbulb at boot), and add and override functionality.

Well, letting licensees modify the core OS was out of the question. It would have required to give them the source code, have them make changes that would have to go through quality control, etc. etc. . 

So Apple came up with a great system: companies license the bare bones system without any apps or any drivers. They can extend the capabilities and license the Apple apps like the address book, and a standard set of drivers that works with the current hardware (MP2x00, eMate). This would be "Extension 0", and since it's in ROM, it's called the ROM Extension 0, and since software engineers don't like long words, it's REx0. And then the licensee can override existing stuff and add new packages using REx1, 2, or 3.

Now, if I were to license NewtonOS to run it on my own system - let's call it Einstein for example - I may not want the drivers that come with the system because I have a different hardware. So I can write another ROM Extension with a higher priority, REx 1, and _override_ all the drivers that are in the original ROM. I also may want to add software to my new system, for example NewtTest11i.pkg, so I add that to my ROM Extension as well.

Now, if my new Newton boots, it loads the core first, then it loads all the Apple drivers and graphics and apps form REx0, and then if loads everything in REx1. And if there are different drivers by the same name in REx0 and REX1, the highest REx will get priority and replace all lower priority drivers. In this way, Paul wrote a driver that replaces the original Apple Screen driver, making t possible to have a higher resolution screen than the original. And he wrote many more drivers to make Einstein run so nicely.

When Apple wrote the core of the operating system, they did not know what kind of REx's their licensees would write and how big they were going to be. But they wrote a paper, explaining to licensees in which places the core OS was going to look for them. And that's were our ROM boards come into play. The ROM board places Flash memory exactly at those addresses. By generating a REx, we basically become and unlicensed licensee, and we can add apps and override drivers and even some of the graphics, for example the lightbulb logo at boot time.


Now, if you are still with me, I did mention the Watson in the headline. When Schlumberger licensed NewtonOS, they had Apple do the translation to French, I assume, because those are all changes in the core. And they added their own REx1 to override functionality of the original ROM. The only thing they replaced though is the validation process for installing new packages. Schlumberger wanted to have total control over what apps can be installed, which is probably a good thing, since Watsons were used as medical devices.

But with our new Flash ROM, this function can be easily patched away. Luckily, 90's programmers did not boather much with encryption, so it took about 30 minutes in Einstein to find the places that must be changed. If you have a Watson ROM and a Hex Editor, change:

0x007F3284: 0xE3A00000 // mov r0, #0
0x007F3288: 0xE1A0f00E // mov pc, lr

The next version of Einstein will do this automatically. For the ROM Boards, I will publish a program that will do it for you.


- Matthias


PS: changing the ROM will always erase all data and apps on your machine! Backup first! I will try to fix that.






More information about the NewtonTalk mailing list