[NTLK] Geek Alert: NewtonOS

Matthias Melcher mm at matthiasm.com
Wed Jul 23 06:23:40 EDT 2014


 Update:


I have uploaded a new version of Einstein for OS X. The same version can be built for Linux using the current GoogleCode SVN.

http://www.matthiasm.com/Einstein_07_23_2014.app.zip

This version features to new things in the builtin debugger "Monitor".


1: I added Watchpoints. Watchpoints are a way to mark points in memory that trigger a breakpoint when they are read or written.

Example:

Let's say you want to know who reads the variable "gCurrentGlobals" located at 0x0C10105C in RAM. Start Einstein, open the Monitor (Al+Cmd+M) and type "stop". Now enter "wpr 0C10105C", then type "run". The next time, this address is read, execution will stop and you can find the function that reads this variable (in my sample case, it was "IRQCleanUp()").


2: I added retargeting commands to the Monitor. These commands create "C" code that replaces individual functions inside the ROM using code as it would be generated by the JIT compiler. You can immediately drop-in that code, or hand-optimize it if you wish.

Example:

Launch Einstein, open the Monitor. Type "help rt" to see your options.
Type "rt open /Users/<my name>/test" to create two files, test.h and test.cp, to receive the transcoded function.
Type "rt cjit 0009C77C-0009C7C4 TDoubleQContainer::Remove(...)" to create the "C" code
Type "rt close" to close the files.

Take a look at test.cp and test.h . These files should contain code that you can simply copy into "Newt/SimCollection1.cp" and "Newt/SimCollection1.h" in your Einstein Source Tree. The code will hook itself into the Newton ROM and will be executed instead of the ROM code.

I will write more about the limitations of this method on elektriktrick.com soon.

Happy Hacking.

 - Matthias





More information about the NewtonTalk mailing list