π
<-
Chat plein-écran
[^]

ndless memory map

C, C++, ASM...
Online

ndless memory map

Unread postby parisse » 26 May 2020, 18:15

How much memory is available for the stack and the heap? It seems there is less than 64K stack. Is this customizable in ndless-sdk/system/ldscript?
User avatar
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Level up: 77.2%
 
Posts: 3500
Joined: 13 Dec 2013, 16:35
Gender: Not specified
Calculator(s):
MyCalcs profile

Re: ndless memory map

Unread postby Vogtinator » 26 May 2020, 18:23

This is managed by the OS, but on 4.2 and later Ndless adds an extra 128K: https://github.com/ndless-nspire/Ndless ... ook.c#L156
User avatar
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)
Niveau 9: IC (Compteur Infatigable)
Level up: 1.6%
 
Posts: 217
Joined: 29 Mar 2014, 15:55
Gender: Male
Calculator(s):
MyCalcs profile

Online

Re: ndless memory map

Unread postby parisse » 27 May 2020, 05:38

Thanks, that's enough (I just found that the giac parser was misconfigured).
How much RAM on the heap?
And BTW, do you know if it's possible to power off the calc inside a ndless app?
User avatar
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Level up: 77.2%
 
Posts: 3500
Joined: 13 Dec 2013, 16:35
Gender: Not specified
Calculator(s):
MyCalcs profile

Re: ndless memory map

Unread postby Vogtinator » 27 May 2020, 15:43

parisse wrote:Thanks, that's enough (I just found that the giac parser was misconfigured).
How much RAM on the heap?

I know that on OS 3.9 on Touchpad there was just barely more than 8MiB free, so on a CX it's probably below 32MiB.
There's quite a bit of fragmentation though, so it's possible that only a ~10MiB continuous allocation works.

And BTW, do you know if it's possible to power off the calc inside a ndless app?

It might be, but there is no syscall. To do it properly (i.e. like the OS, with saving the scratchpad and so on) would probably need some more complex event loop integration.
Or maybe a function which sends a poweroff event after returning from main() would be possible.
User avatar
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)
Niveau 9: IC (Compteur Infatigable)
Level up: 1.6%
 
Posts: 217
Joined: 29 Mar 2014, 15:55
Gender: Male
Calculator(s):
MyCalcs profile

Online

Re: ndless memory map

Unread postby parisse » 27 May 2020, 16:55

Vogtinator wrote:I know that on OS 3.9 on Touchpad there was just barely more than 8MiB free, so on a CX it's probably below 32MiB.
There's quite a bit of fragmentation though, so it's possible that only a ~10MiB continuous allocation works.

That's much much more than on the Numworks or Casio Prizm, normal school usage of KhiCAS should be memory-proof...

It might be, but there is no syscall. To do it properly (i.e. like the OS, with saving the scratchpad and so on) would probably need some more complex event loop integration.
Or maybe a function which sends a poweroff event after returning from main() would be possible.

Does it mean that the RAM is not kept (I mean refreshed) in OFF mode? Otherwise it should be possible to power off and on again without taking care of the OS data. Well, sending a poweroff event would not spare much time to the user, because he would still have to re-enter KhiCAS after ON.

BTW, I just discovered that the RTC clock of the nspire seems very accurate (probably more than my Casio watch...), I wonder why TI does not display the time.
User avatar
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Level up: 77.2%
 
Posts: 3500
Joined: 13 Dec 2013, 16:35
Gender: Not specified
Calculator(s):
MyCalcs profile

Re: ndless memory map

Unread postby Vogtinator » 27 May 2020, 18:07

parisse wrote:
It might be, but there is no syscall. To do it properly (i.e. like the OS, with saving the scratchpad and so on) would probably need some more complex event loop integration.
Or maybe a function which sends a poweroff event after returning from main() would be possible.

Does it mean that the RAM is not kept (I mean refreshed) in OFF mode? Otherwise it should be possible to power off and on again without taking care of the OS data. Well, sending a poweroff event would not spare much time to the user, because he would still have to re-enter KhiCAS after ON.

Do you mean standby mode? That might be simpler to implement, but there's no syscall for that either.
User avatar
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)
Niveau 9: IC (Compteur Infatigable)
Level up: 1.6%
 
Posts: 217
Joined: 29 Mar 2014, 15:55
Gender: Male
Calculator(s):
MyCalcs profile

Online

Re: ndless memory map

Unread postby parisse » 27 May 2020, 19:13

Yes, standby mode is what I'd like to have when I press Ctrl-off inside KhiCAS.
If you are working on a math problem, you might need to do some computations or graph representations or a small program for a few minutes, then you work on your paper and during that time you don't want to keep the calc on. Currently you must press menu menu to leave KhiCAS then ctrl off to shutdown the calc, and then on, 2, enter to launch KhiCAS and wait 15 seconds before the shell is ready.
User avatar
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Level up: 77.2%
 
Posts: 3500
Joined: 13 Dec 2013, 16:35
Gender: Not specified
Calculator(s):
MyCalcs profile

Re: ndless memory map

Unread postby nspiredev500 » 03 Jul 2020, 12:50

If you want low power consumption, you could just disable the LCD and go into a loop:
Code: Select all
while (! isKeyPressed(KEY_NSPIRE_HOME))
{
  msleep(100);
}

To get the OS standby mode, you could save all your state into a file and exit the application when ctrl + ON is pressed.
The only problem would be starting it again after the calculator exits standby mode.
Or you could do the research and figure out how the standby mode works and implement it yourself.
There is only little information about this on Hackspire: https://hackspire.org/index.php?title=Memory-mapped_I/O_ports_on_CX#900B0000_-_Power_management
User avatar
nspiredev500
Niveau 4: MC (Membre Confirmé)
Niveau 4: MC (Membre Confirmé)
Level up: 16%
 
Posts: 17
Joined: 03 Jul 2020, 12:22
Gender: Not specified
Calculator(s):
MyCalcs profile
GitHub: nspiredev500

Re: ndless memory map

Unread postby Ti64CLi++ » 03 Jul 2020, 12:55

You can disable the screen, by lowering the contrast to its minimum.
Here is a code which does exactly that :
Code: Select all
unsigned short *pContrast = (unsigned short *)0x900F0020;
*pContrast = 0x100;


0x100 is the minimum value for the contrast, which is when the screen is turned off ;)
Image
User avatar
Ti64CLi++Modo
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 32.3%
 
Posts: 3441
Images: 75
Joined: 04 Jul 2014, 14:40
Location: Clermont-Ferrand 63
Gender: Male
Calculator(s):
MyCalcs profile
Class: ENS Rennes
GitHub: Ti64CLi

Online

Re: ndless memory map

Unread postby parisse » 03 Jul 2020, 13:56

That's what I do, but it's far from perfect : you can still guess that there is something on the screen, and the batteries do not last for long in that mode (perhaps 1 or 2 days). It's reasonably good if you don't forget to leave KhiCAS once you have finished your daywork.
User avatar
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Level up: 77.2%
 
Posts: 3500
Joined: 13 Dec 2013, 16:35
Gender: Not specified
Calculator(s):
MyCalcs profile

Next

Return to Native: Ndless, Linux, ...

Who is online

Users browsing this forum: No registered users and 7 guests

-
Search
-
Social TI-Planet
-
Featured topics
Comparaisons des meilleurs prix pour acheter sa calculatrice !
Aidez la communauté à documenter les révisions matérielles en listant vos calculatrices graphiques !
Phi NumWorks jailbreak
123
-
Donations / Premium
For more contests, prizes, reviews, helping us pay the server and domains...
Donate
Discover the the advantages of a donor account !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partner and ad
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
1044 utilisateurs:
>1023 invités
>16 membres
>5 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)
-
Other interesting websites
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)