September 18, 2020, 09:32:21 am

The shoutbox is currently out of service. Join us on Discord instead.
You can help CodeWalrus stay online by donating here.

WARNING: If you upgrade your TI-83 Premium CE or TI-84 Plus CE to OS 5.5.1 and higher, it removes all compatibility with most games and removes ASM/C programming. You will need a jailbreak tool called ArTIfiCE in order to add ASM/C support back and some games such as First Fantasy and 1000 Bornes also requires ASMHOOK. Downgrading new hardware revisions is impossible and older ones requires a special tool. Likewise, do NOT update your TI-Nspire CX past OS 4.5.0, else using Ndless and ASM/C programs will be impossible.

dynamic linking PoC for the TI nspire

Started by nspiredev500, November 09, 2019, 09:24:25 pm

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


I managed to get a system working (in firebird, not yet tested on hardware) that lets programms request function tables from libraries (sort-of dynamic linking from what I understand, maybe I'll do a proper dynamic linker with resolving missing symbols in the files, but I currently don't know enough about that).
When handled by header files to define function pointers with the right names and parameters, a programm doesn't have to include the functions, thus reducing the size of the binary and the size occupied in RAM if multiple programms use the same library.
It would also make it easier to update a library inside a program, you would just update your library.
I have a PoC on a github repo along with a short screen recoding showing that it works.

If you're interested, it works by replacing itself as the system call handler and then catches system calls that have a certain signature and runs them.
There are 2 system calls: registering a function table as a library with a specific name, and requesting a function table with a name.
It searches in a path (in this case /documents/ndless/) for a library with that name and runs it. The library should register itself with its name and the functions it wants to export.
Because the swi handler address isn't os-specific, this PoC should work on every hardware and software version. I testet it in firebid with 4.5 CX CAS HW W, 4.5 CX HW W and 4.5 HW J.

For anyone wondering why I even did this, I plan to make a programm that is divided up into modules, and these modules should be easily replacable by a user without recompilation (no one would do that and it is some work to get the ndless-sdk running).
In this case it would be as easy as swapping out one file.

Powered by EzPortal