[NTLK] Einstein Xcode project cleanup
mm at matthiasm.com
Thu Dec 4 17:41:20 EST 2014
> On Dec 4, 2014, at 11:10 PM, Steven Frank <stevenf at panic.com> wrote:
> Thanks for all the info. It sounds like you are in the middle of some pretty hairy stuff and I'm not sure I'd be capable of helping with it without just being in the way. I'll keep looking for stuff around the edges that I can contribute.
Don;t worry, just play around with the code you are interested in. The nice thing about SVN/GIT is, that we can revert easily if anything goes wrong.
> One other question I had about Einstein: It allocates 2 banks of 4 MB flash storage for a total of 8 MB. As we know, a real MP2100 has 4 MB total flash storage. Does Einstein have more just "because we can" or is there some other reason? On a real MP2100, does it map out as a single 4 MB bank or 2 x 2MB banks or ...?
Einstein does not emulate the Flash RAM, but instead adds a Flash driver to the OS via a custom REx. In plain speak, Einstein uses the Flash access API to convert Flash RAM access into accessing a memory mapped Unix style disk file.
> Finally, I was noting on your wishlist an interest in learning more about some of the large data blocks in the ROM. I remembered that I had a license for the Hopper Disassembler, and used symbols.txt as the basis of a script to symbolicate the ROM inside a Hopper database. This should allow us some interesting abilities, such as being able to see what functions reference which data blocks, and so on. The script was still running when I left work yesterday and I haven't made it back to see the final result yet... but soon!
Very cool. Looking forward to the results!
Two issues with static disassembly that I encountered:
1: virtual function calls through a vtable are really difficult to find and trace
2: NewtonOS maps a huge jump table for pretty much every function into memory using the MMU. This is a great scheme to allow ROM patches and bug fixes permanently in Flash. All function call are routed through these jump tables. In a static disassembly, these tables must be provided at the correct address somehow (I'll be happy to share details on request). When looking at the Symbol file, you will find most C/C++ symbols twice: once for the original function, and once more for the jump vector.
More information about the NewtonTalk