π
<-
Chat plein-écran
[^]

ndless memory map

C, C++, ASM...

ndless memory map

Message non lude parisse » 26 Mai 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?
Avatar de l’utilisateur
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 77.2%
 
Messages: 3502
Inscription: 13 Déc 2013, 16:35
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile

Re: ndless memory map

Message non lude Vogtinator » 26 Mai 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
Avatar de l’utilisateur
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)
Niveau 9: IC (Compteur Infatigable)
Prochain niv.: 1.6%
 
Messages: 217
Inscription: 29 Mar 2014, 15:55
Genre: Homme
Calculatrice(s):
MyCalcs profile

Re: ndless memory map

Message non lude parisse » 27 Mai 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?
Avatar de l’utilisateur
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 77.2%
 
Messages: 3502
Inscription: 13 Déc 2013, 16:35
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile

Re: ndless memory map

Message non lude Vogtinator » 27 Mai 2020, 15:43

parisse a écrit: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.
Avatar de l’utilisateur
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)
Niveau 9: IC (Compteur Infatigable)
Prochain niv.: 1.6%
 
Messages: 217
Inscription: 29 Mar 2014, 15:55
Genre: Homme
Calculatrice(s):
MyCalcs profile

Re: ndless memory map

Message non lude parisse » 27 Mai 2020, 16:55

Vogtinator a écrit: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.
Avatar de l’utilisateur
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 77.2%
 
Messages: 3502
Inscription: 13 Déc 2013, 16:35
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile

Re: ndless memory map

Message non lude Vogtinator » 27 Mai 2020, 18:07

parisse a écrit:
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.
Avatar de l’utilisateur
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)
Niveau 9: IC (Compteur Infatigable)
Prochain niv.: 1.6%
 
Messages: 217
Inscription: 29 Mar 2014, 15:55
Genre: Homme
Calculatrice(s):
MyCalcs profile

Re: ndless memory map

Message non lude parisse » 27 Mai 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.
Avatar de l’utilisateur
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 77.2%
 
Messages: 3502
Inscription: 13 Déc 2013, 16:35
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile

Re: ndless memory map

Message non lude nspiredev500 » 03 Juil 2020, 12:50

If you want low power consumption, you could just disable the LCD and go into a loop:
Code: Tout sélectionner
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
Avatar de l’utilisateur
nspiredev500
Niveau 4: MC (Membre Confirmé)
Niveau 4: MC (Membre Confirmé)
Prochain niv.: 16%
 
Messages: 17
Inscription: 03 Juil 2020, 12:22
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile
GitHub: nspiredev500

Re: ndless memory map

Message non lude Ti64CLi++ » 03 Juil 2020, 12:55

You can disable the screen, by lowering the contrast to its minimum.
Here is a code which does exactly that :
Code: Tout sélectionner
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
Avatar de l’utilisateur
Ti64CLi++Modo
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Prochain niv.: 32.3%
 
Messages: 3441
Images: 75
Inscription: 04 Juil 2014, 14:40
Localisation: Clermont-Ferrand 63
Genre: Homme
Calculatrice(s):
MyCalcs profile
Classe: ENS Rennes
GitHub: Ti64CLi

Re: ndless memory map

Message non lude parisse » 03 Juil 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.
Avatar de l’utilisateur
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 77.2%
 
Messages: 3502
Inscription: 13 Déc 2013, 16:35
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile

Suivante

Retourner vers Native: Ndless, Linux, ...

Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 9 invités

-
Rechercher
-
Social TI-Planet
-
Sujets à la une
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
-
Faire un don / Premium
Pour plus de concours, de lots, de tests, nous aider à payer le serveur et les domaines...
Faire un don
Découvrez les avantages d'un compte donateur !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partenaires et pub
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
965 utilisateurs:
>951 invités
>10 membres
>4 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)
-
Autres sites intéressants
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)