[NTLK] Einstein on Android - doing away with ARM emulation?

Matthias Melcher mm at matthiasm.com
Sun Mar 13 09:00:02 EDT 2011


Almost all of the MessagePad hardware is virtualized thanks to a great feature of the NewtonOS. An additional ROM provides replacement routines for 90% of the hardware related routines, so that sound, screen, digitizer, etc. all run at full native speed. That's about 50% of what Einstein does.

We have two things that need to emulated though: all the CPU instructions, and the MMU.

The MMU translates all read and write operations from any virtual memory address to a physical address. This sounds simple, but it isn't. NewtonOS generates memory pages that are not mapped to any RAM at all to save memory. Only when a resource is actually needed, the MMU causes an fault which then triggers a very complex order of events that generates whatever the RAM at that address should have been.

This makes emulating the CPU instructions so expensive: whenever there is a memory access (and just reading an instruction is already a memory access!), there is the possibility that the instruction fails. The Newton then simply suspends the task and schedules a whole new task that will eventually remove the error condition. The task will then continue exactly where it left of. To emulate that in C++ is very VERY complicated.

The Amiga for example never had an MMU. This makes life so much easier. 

So, yes, we must get to the point where we virtualize the NewtonOS instead of emulating it, but for that we first need to solve everything related to the MMU and how it's used in NewtonOS.

 - Matthias


On 13.03.2011, at 11:05, Joseph Reilly wrote:

> My understanding of how android works is that all apps run through a virtual machine 
> which keeps everything sandboxed pretty well and away from direct contact with the
> core os/hardware. I'd guess if this was to be tried you'd have to have a rooted device  
> (if you don't already). Another issue my be the various arm chips in the many android 
> devices, they may not all support the same features so you might have to tune for 
> each chip... but I'm just guessing until a knowledgable person chimes in :-) I don't know a 
> lot about the inner workings of android or newton so I may be way off base 
> (and making myself look like a fool) :-/
> 
> Joe Reilly
> 
> On Mar 12, 2011, at 9:57 PM, Michael wrote:
> 
>> Since both the Newton and Android devices use ARM processors, would it
>> be possible to do away with the ARM processor emulation within
>> Einstein and have the host device execute the ARM instructions
>> natively (virtualization-style)?
>> 
>> Years back, there were Mac emulators for the Amiga & Atari that did
>> just that, using a Mac ROM and executing 68k instructions directly.  I
>> think that VirtualBox & SheepShaver do a similar thing.
>> 
>> Would this be feasible?  Any other thoughts?  I imagine it would allow
>> for incredibly fast performance...
>> 
>> Michael
>> 
>> ==================================================================== 
>> The NewtonTalk Mailing List - http://newtontalk.net/
>> The Official Newton FAQ     - http://splorp.com/newton/faq/
>> The Newton Glossary         - http://splorp.com/newton/glossary/
>> WikiWikiNewt                - http://tools.unna.org/wikiwikinewt/
>> ====================================================================
> 
> 
> ==================================================================== 
> The NewtonTalk Mailing List - http://newtontalk.net/
> The Official Newton FAQ     - http://splorp.com/newton/faq/
> The Newton Glossary         - http://splorp.com/newton/glossary/
> WikiWikiNewt                - http://tools.unna.org/wikiwikinewt/
> ====================================================================




More information about the NewtonTalk mailing list