On 05.09.2012, at 11:03, "MacArthur, Ian (SELEX GALILEO, UK)" <[email protected]> wrote:
> >> Sorry, I clicked the worng address field. This was of course supposed to >> go to the Einstein Newton emulator group. ;-) > > Though there are folk here too who would like to see a "native" > Einstein/Newton... > > That said, I doubt I can help - I can't get on with Xcode at all, still have > 3.2.6, and am only using the CLI anyway... > > This is implementing your idea of creating a "clean room" native code object > that presents the same API as the Newton ROM, but with your own code inside > it so it can build on "any" host, and duck around the Apple license issues? > > Does sound interesting though - would love it if it worked! > > Though... IIRC the Newton ROM presented some API in C++ (or ObjC?) based on > the calling convention of some obscure obsolete compiler... so creating code > to the same ABI might be, um, "tricky"...? Yes, it is tricky. I need interfaces between the Just In TIme compiler and the native code. Those interfaces convert from register notation into a correctly formed C+ call, also taking care of the return value. But all that has been working for a year now. The major issue is the extensive use of the MMU by Newton OS: a memory access fault can happen at any time. The JIT takes care of that very well, but native code would need to call the JIT, causing a recursion in the JIT system. But then I found this neat thing call "fibers". A fiber is a thread without the ability to run at the same time as another thread (Since NewtonOS was never meant to run on multiple cores, it has very limited thread protection). Or, looking at it from the other side, the ability to have two or more stacks and environments inside a single "C" program. The solution now is using a fiber when changing into native code. If a memory violation happens, we simply jump back to the original fiber, handle the exception, and jump back to the native fiber. To the JIT, the whole procedure appears just like two instructions, not knowing anything about all the native stuff going on in the other fiber. Is it easy to tell by the long EMails today, that I try to avoid work? - Matthias _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

