ndless memory map
34 posts
• Page 1 of 4 • 1, 2, 3, 4
ndless memory map
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?
-
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)- Posts: 3721
- Joined: 13 Dec 2013, 16:35
- Gender:
- Calculator(s):→ MyCalcs profile
Re: ndless memory map
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
-
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)- Posts: 217
- Joined: 29 Mar 2014, 15:55
- Gender:
- Calculator(s):→ MyCalcs profile
Re: ndless memory map
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?
How much RAM on the heap?
And BTW, do you know if it's possible to power off the calc inside a ndless app?
-
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)- Posts: 3721
- Joined: 13 Dec 2013, 16:35
- Gender:
- Calculator(s):→ MyCalcs profile
Re: ndless memory map
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.
-
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)- Posts: 217
- Joined: 29 Mar 2014, 15:55
- Gender:
- Calculator(s):→ MyCalcs profile
Re: ndless memory map
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.
-
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)- Posts: 3721
- Joined: 13 Dec 2013, 16:35
- Gender:
- Calculator(s):→ MyCalcs profile
Re: ndless memory map
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.
-
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)- Posts: 217
- Joined: 29 Mar 2014, 15:55
- Gender:
- Calculator(s):→ MyCalcs profile
Re: ndless memory map
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.
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.
-
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)- Posts: 3721
- Joined: 13 Dec 2013, 16:35
- Gender:
- Calculator(s):→ MyCalcs profile
Re: ndless memory map
If you want low power consumption, you could just disable the LCD and go into a loop:
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
- 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
Lua io and os libraries: https://github.com/nspiredev500/nspire-lua
OSExt: https://github.com/nspiredev500/OSExt
n-as on-calc assembler: https://github.com/nspiredev500/nspire- ... g/n-asv1.0
OSExt: https://github.com/nspiredev500/OSExt
n-as on-calc assembler: https://github.com/nspiredev500/nspire- ... g/n-asv1.0
-
nspiredev500
Niveau 4: MC (Membre Confirmé)- Posts: 17
- Joined: 03 Jul 2020, 12:22
- Gender:
- Calculator(s):→ MyCalcs profile
- GitHub: nspiredev500
Re: ndless memory map
You can disable the screen, by lowering the contrast to its minimum.
Here is a code which does exactly that :
0x100 is the minimum value for the contrast, which is when the screen is turned off
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

-
Ti64CLi++Modo
Niveau 16: CC2 (Commandeur des Calculatrices)- Posts: 3446
- Images: 75
- Joined: 04 Jul 2014, 14:40
- Location: Clermont-Ferrand 63
- Gender:
- Calculator(s):→ MyCalcs profile
- Class: ENS Rennes
- GitHub: Ti64CLi
Re: ndless memory map
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.
-
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)- Posts: 3721
- Joined: 13 Dec 2013, 16:35
- Gender:
- Calculator(s):→ MyCalcs profile
34 posts
• Page 1 of 4 • 1, 2, 3, 4
Return to Native: Ndless, Linux, ...
Who is online
Users browsing this forum: ClaudeBot [spider] and 5 guests