Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's Technology & Calculator Open Topic subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Community News & Discuss Nspire => Technology & Calculator Open Topic
Author Message
bwang


Member


Joined: 15 Mar 2009
Posts: 128

Posted: 18 Jun 2010 03:16:26 pm    Post subject:

Does anyone have any tips on how to find the standard library functions on the Nspire?
Also, what do we have right now?
Back to top
ExtendeD


Advanced Newbie


Joined: 30 Aug 2009
Posts: 91

Posted: 18 Jun 2010 03:41:18 pm    Post subject:

Here are the latest symbols for OS 1.1 non-CAS and boot 2, in IDA format. The standard functions were planned to be included in Ndless header files.
All the symbols found in boot 2 have not yet been searched in boot 2, but this shouldn't be too difficult, a binary search succeeds most of the time.
There are probably much more POSIX functions in the OS: a good disassembler is the tool you need.

Please share any possible new symbol you find.
Back to top
bsl


Advanced Newbie


Joined: 09 Jan 2010
Posts: 94

Posted: 21 Jun 2010 03:14:20 am    Post subject:

One method is to dump the entire memory core using the emulator debug> w memory.raw 0x10000000 0x2000000.
Then do a binary search of the entry points given above in boot2.raw to match in the file memory.raw using a good file editor.

Here are some untested matches I found in only a half hour for noncas1.1 .
Put these in os_1.1.9253.h :

Code:

#define fseek_   0x10185330
#define strchr_  0x101860e8
#define strcmp_   0x10186114
#define strlen_   0x10186154
#define strncmp_  0x101861c0
#define strncpy_  0x10186220
#define strpbrk_  0x1018627c
#define strrchr_  0x101862bc
#define strcpy_   0x10187388
#define strtoul_  0x10257c10  // I am less certain about this one

Whats left is defining these standard library functions in os.h(find there prototypes anywhere) and test them in small programs


Last edited by Guest on 21 Jun 2010 03:18:19 am; edited 1 time in total
Back to top
Levak


Advanced Newbie


Joined: 11 Nov 2009
Posts: 94

Posted: 18 Sep 2010 12:33:08 pm    Post subject:

ExtendeD wrote:

Here are the latest symbols for OS 1.1 non-CAS and boot 2, in IDA format. The standard functions were planned to be included in Ndless header files.
All the symbols found in boot 2 have not yet been searched in boot 2, but this shouldn't be too difficult, a binary search succeeds most of the time.
There are probably much more POSIX functions in the OS: a good disassembler is the tool you need.

Please share any possible new symbol you find.


Hi,
I'm looking for those same file for OS 1.7 Nspire and Nspire CAS that you mention in the Nspire 1.7 make helper.
Thus, is it possible to make a public share, or is it only reserved for beta-users ?

Thanks.
Back to top
bsl


Advanced Newbie


Joined: 09 Jan 2010
Posts: 94

Posted: 18 Sep 2010 10:48:13 pm    Post subject:

Levak wrote:

Hi,
I'm looking for those same file for OS 1.7 Nspire and Nspire CAS that you mention in the Nspire 1.7 make helper.
Thus, is it possible to make a public share, or is it only reserved for beta-users ?

Thanks.


Copy and Paste from the very long thread: Désassemblage du boot2
which has both boot2 and NONCAS 1.7 . I thought they where for the CAS1.7 , but they are for the noncas.
I don't know how much of that list is updated since then.
Leave it French, the Google translator messes up the page formatting, and you will miss information.
Back to top
ExtendeD


Advanced Newbie


Joined: 30 Aug 2009
Posts: 91

Posted: 19 Sep 2010 03:59:55 am    Post subject:

Here are the same in IDC format for non-CAS: http://www.mirari.fr/oDM7

Last edited by Guest on 19 Sep 2010 04:01:10 am; edited 1 time in total
Back to top
Levak


Advanced Newbie


Joined: 11 Nov 2009
Posts: 94

Posted: 19 Sep 2010 05:00:40 am    Post subject:

ExtendeD wrote:

Here are the same in IDC format for non-CAS: http://www.mirari.fr/oDM7


Thank you.
I believe that you don't have the CAS one, or, do I have good reasons to think it is the same file ?
Back to top
ExtendeD


Advanced Newbie


Joined: 30 Aug 2009
Posts: 91

Posted: 19 Sep 2010 10:15:35 am    Post subject:

The addresses are different on CAS but I don't have them yet.
They can easily be ported with a binary search.
Back to top
bsl


Advanced Newbie


Joined: 09 Jan 2010
Posts: 94

Posted: 08 Dec 2010 09:53:30 pm    Post subject:

Here are some functions I found personally on OS1.1 and found again on OS1.7:

Code:

function                  NCAS1.7     CAS1.7       prototype
----------------------------------------------------------------------------
ftell                     102a513c    102a714c   standard lib
freopen                   102a4db4    102a6dc4   standard lib
read_unaligned_longword   1019ACAC    1019ccc4   ulong read_unaligned_longword( void *addr) 
read_unaligned_word       1019ACCC    1019cce4   int read_unaligned_word( void *addr)       
write_unaligned_word      1019b470    1019d488   void write_unaligned_word(void *addr, int word )   
write_unaligned_longword  1019b488    1019d4a0   void write_unaligned_longword(void *addr, ulong dword )
stdin                     10858880    1081c870   standard handle
stdout                    108588CC    1081c8bc   standard handle
stderr                    10858918    1081C908   standard handle

I have a tool in development the finds standard library functions.
It is in part a modified version of the emulator. You set breakpoints in a memory range on entry points,
and run the emulator under normal use. As breakpoints are hit and automatically continued,
r0,r1,r2,r3, and to 16 bytes [r0],[r1],[r2],[r3] are dumped to file.
You examine the results and make an educated guess at which standard
library function it is.
Back to top
ExtendeD


Advanced Newbie


Joined: 30 Aug 2009
Posts: 91

Posted: 09 Dec 2010 03:46:14 pm    Post subject:

Thanks bsl.

You can also start from the up-to-date IDC files.
What we are now really missing is an update of Ndless's os.h and Hackspire for all the standard functions whose addresses have been found.
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are GMT - 5 Hours

 

Advertisement