π
<-
Chat plein-écran
[^]

iostream et STL

C, C++, ASM...

Re: iostream et STL

Message non lude Excale » 30 Mar 2014, 09:55

Maybe the malloc() for storing a 7 MB large giac.tns fails
Il est possible que le malloc() pour caser giac.tns rate sur 7Mo.

Can you see "ndless_load: can't malloc" or "Failed to alloc binary memory" in the terminal output
Est ce que tu vois: "ndless_load: can't malloc" ou bien "Failed to alloc binary memory" en console?

If you do, then we'll have to be smart, the CX has much more than enough RAM (but it needs to be contiguous)
Si oui, il va falloir ruser un peu, la Nspire CX a largement assez de RAM libre (le tout étant de la rendre contiguë).

EDIT Lionel: English spoken in this topic ;)

EDIT²: I can run it with Ndless 3.1 and type things. It crashes when I press enter (which is probably what it is supposed to do since Ndless 3.1 may be missing some of features you use)
Avatar de l’utilisateur
ExcaleAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Prochain niv.: 3.9%
 
Messages: 2955
Images: 3
Inscription: 10 Sep 2010, 00:00
Genre: Homme
Calculatrice(s):
MyCalcs profile

Re: iostream et STL

Message non lude parisse » 30 Mar 2014, 10:41

Yes, if I run it without the debugger, I get ndless_load: can't malloc. Which means that the reboot is probably a bad interaction with the malloc and gdb.
So I should definitively try it with the 3.1 OS, since it reaches the console input at the beginning of main(), then it crashes while calling giac parser, there is hope I can debug it and find what fails.
Avatar de l’utilisateur
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 80.1%
 
Messages: 3551
Inscription: 13 Déc 2013, 16:35
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile

Re: iostream et STL

Message non lude Excale » 30 Mar 2014, 11:13

parisse a écrit:Yes, if I run it without the debugger, I get ndless_load: can't malloc. Which means that the reboot is probably a bad interaction with the malloc and gdb.

The file is probably just too big and malloc cannot find enough contiguous memory for it (OS 3.1 is smaller so it leaves more free RAM for programs). If it happens to be that issue for sure, we can patch Ndless and ask the OS to malloc enough room for you soon enough in the OS boot sequence so it doesn't fail (but that's not a very good solution, there must be better. This could at least allow you to test on OS 3.6.).
Avatar de l’utilisateur
ExcaleAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Prochain niv.: 3.9%
 
Messages: 2955
Images: 3
Inscription: 10 Sep 2010, 00:00
Genre: Homme
Calculatrice(s):
MyCalcs profile

Re: iostream et STL

Message non lude ExtendeD » 30 Mar 2014, 11:53

Excale, do you mean pre-reserving memory space for Ndless programs? I'm not sure it's a good idea as this space would be lost for OS use. And how much should be reserved this way?
Anyway a 7M allocation on 64M system is much. Would bFLT library support help? or nl_exec() to run another program? ( http://hackspire.unsads.com/wiki/index. ... _functions )
Avatar de l’utilisateur
ExtendeDPremium
Niveau 8: ER (Espèce Rare: nerd)
Niveau 8: ER (Espèce Rare: nerd)
Prochain niv.: 64.1%
 
Messages: 204
Inscription: 30 Déc 2004, 00:00
Genre: Homme
Calculatrice(s):
MyCalcs profile
Classe: N/A

Re: iostream et STL

Message non lude parisse » 30 Mar 2014, 12:28

I have set the emulator with the 3.1 os and ndless, and I can start a debugging session, but as soon as I try to debug in the parser code, the system reboots. More precisely when I enter s in the gdb console for stepping in giac_yyparse, then it reboots. I suspect that the memory is almost full, and a memory allocation fails at the begin of the parser code.
Avatar de l’utilisateur
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 80.1%
 
Messages: 3551
Inscription: 13 Déc 2013, 16:35
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile

Re: iostream et STL

Message non lude Vogtinator » 30 Mar 2014, 12:31

ExtendeD a écrit:Excale, do you mean pre-reserving memory space for Ndless programs? I'm not sure it's a good idea as this space would be lost for OS use. And how much should be reserved this way?
Anyway a 7M allocation on 64M system is much. Would bFLT library support help? or nl_exec() to run another program? ( http://hackspire.unsads.com/wiki/index. ... _functions )

I don't think that's much actually. It's just a bit more than a tenth of 64MiB. Did you compile giac with "-Os"? And you need "-fpic -mlong-calls -fno-exceptions" (for every file, also ustl and libtommath) if you're not using nspire-g++, otherwise some function calls go into the wrong direction...

parisse a écrit:Is there some howto that describes what needs to be done? Or even better a tarball of a working toolchain?
On my side, I could compile giac with ustl (modified), nspire-io and os.h, the resulting binary is 7M large, but it does not work. I tried to set a breakpoint at the beginning of main, but reboot happens before, it happens during static initializations, despite the fact I turned on all flags to compile giac without static object initializations. And I can't find how to set a breakpoint before main.

Clone my fork on github and run "build_toolchain.sh" in the ndless-sdk/toolchain directory. Uploading my toolchain takes too long, over 70MiB compressed. You should be able to compile it without os.h. Does it work then?
The easiest way to set a breakpoint at program startup is by adding "bkpt" in crt0.S in ndless-sdk/system. And set the "/W" flag when running nspire_emu, sometimes it helps debugging.

I haven't got much time today, but I'll try to compile giac as well.
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: iostream et STL

Message non lude parisse » 30 Mar 2014, 13:00

I make another try with some optimization template code disabled in giac. I'll try newlib later (but I'm afraid the code will take more memory).
I can't see the option -mlong-call in nspire-g++ shell script? Two other questions: can I use -mthumb in nspire-g++ (--mthumb-interwork is not recognized)? Can I remove -fno-rtti?
Avatar de l’utilisateur
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 80.1%
 
Messages: 3551
Inscription: 13 Déc 2013, 16:35
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile

Re: iostream et STL

Message non lude Excale » 30 Mar 2014, 13:00

parisse a écrit:I have set the emulator with the 3.1 os and ndless, and I can start a debugging session, but as soon as I try to debug in the parser code, the system reboots. More precisely when I enter s in the gdb console for stepping in giac_yyparse, then it reboots. I suspect that the memory is almost full, and a memory allocation fails at the begin of the parser code.


I cannot start a debugging session on OS 3.1 when it is running. It always crashes the emulator.
So... I start it, wait until the reboot is done then debug what I want to debug.

Also, did you give the large RAM switch to Nspire emu? (/R)
Avatar de l’utilisateur
ExcaleAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Prochain niv.: 3.9%
 
Messages: 2955
Images: 3
Inscription: 10 Sep 2010, 00:00
Genre: Homme
Calculatrice(s):
MyCalcs profile

Re: iostream et STL

Message non lude parisse » 30 Mar 2014, 15:22

Ok, compiling with -Os, giac.tns is now 3.9M, and it runs with 3.6, at least for 1/2+1/3... But I can not set a breakpoint in main, it reboots, perhaps a problem with -Os -g and gdb.
I have updated the giac.tgz archive (without the large gdb file, I have limited net access today).
Avatar de l’utilisateur
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 80.1%
 
Messages: 3551
Inscription: 13 Déc 2013, 16:35
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile

Re: iostream et STL

Message non lude Lionel Debroux » 30 Mar 2014, 15:30

giac.tns is now 3.9M, and it runs with 3.6, at least for 1/2+1/3

Great :)
Membre de la TI-Chess Team.
Co-mainteneur de GCC4TI (documentation en ligne de GCC4TI), TIEmu et TILP.
Avatar de l’utilisateur
Lionel DebrouxSuper Modo
Niveau 14: CI (Calculateur de l'Infini)
Niveau 14: CI (Calculateur de l'Infini)
Prochain niv.: 11.2%
 
Messages: 6859
Inscription: 23 Déc 2009, 00:00
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
Classe: -
GitHub: debrouxl

PrécédenteSuivante

Retourner vers Native: Ndless, Linux, ...

Qui est en ligne

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

-
Rechercher
-
Social TI-Planet
-
Sujets à la une
"1 calculatrice pour tous", le programme solidaire de Texas Instruments. Reçois gratuitement et sans aucune obligation d'achat, 5 calculatrices couleur programmables en Python à donner aux élèves les plus nécessiteux de ton lycée. Tu peux recevoir au choix 5 TI-82 Advanced Edition Python ou bien 5 TI-83 Premium CE Edition Python.
Enseignant(e), reçois gratuitement 1 exemplaire de test de la TI-82 Advanced Edition Python. À demander d'ici le 31 décembre 2024.
Offre de test des nouveautés de rentrée 2024 par Casio. Enseignant(e), reçois gratuitement 1 exemplaire, à ton choix, de la Graph Light ou bien de la Graph Math+
14€ remboursés par Casio sur l'achat de ta calculatrice Graph 35 d'ici le 31 Octobre 2024
10€ remboursés par Casio sur l'achat de ta calculatrice Graph 90+E d'ici le 31 Décembre 2024
10€ remboursés par Casio sur l'achat de ta calculatrice Graph 25 d'ici le 31 Décembre 2024
8€ remboursés par Casio sur l'achat de ta calculatrice Graph Math+ d'ici le 31 Octobre 2024
Reprise de ton ancienne fx-92 Collège ou Graph 25/35/90 à 3€ peu importe son état. Même non fonctionnelle et donc invendable, même ancienne Graph 35 non conforme aux programmes (pas de Python), même ancienne Graph 25/35 inutilisable aux examens (pas de mode examen) et donc invendable. Etiquette de retour fournie, pas de frais de port à payer.
3€ remboursés par Casio sur l'achat de ta calculatrice fx-92 Collège d'ici le 30 Septembre 2024
5€ de remise immédiate sur l'achat de ta calculatrice TI-83 Premium CE Edition Python chez les revendeurs partenaires
4€ de remise immédiate sur l'achat de ta calculatrice TI-82 Advanced Edition Python chez les revendeurs partenaires
3€ de remise immédiate sur l'achat de ta calculatrice TI-82 Advanced chez les revendeurs partenaires
Comparaisons des meilleurs prix pour acheter sa calculatrice !
Aidez la communauté à documenter les révisions matérielles en listant vos calculatrices graphiques !
1234567891011121314
-
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.
1597 utilisateurs:
>1572 invités
>20 membres
>5 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)