This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Messages - quadratic77
1
« on: June 16, 2014, 06:26:30 pm »
Streetwalrus, is an OS considered a "large project" that OOP would be good for? A lot of people think C++ isn't good for an OS, that C is better.
2
« on: June 16, 2014, 06:22:54 pm »
Thank you, it works. This is great!
3
« on: June 16, 2014, 06:18:51 pm »
Shouldn't you quote?
Who? Linus?
4
« on: June 16, 2014, 02:59:53 pm »
Oh yes, C is way better than C++. Even Linus agrees. I'm not going against OOP, just against the C++ language.
5
« on: June 16, 2014, 02:28:29 pm »
My calculator (Nspire CX CAS 3.6) crashes and hard-reboots after I run Khicas. Any ideas?
6
« on: May 07, 2014, 02:16:53 pm »
336K to 435K, I have no idea why it changes when I make a very small addition or subtraction.
As for debugging, how? gdb?
7
« on: May 07, 2014, 01:54:46 pm »
Just to make sure I didn't mess something up by changing things I re-built the source with no modifications except for changing printf in the example to nspireio's functions, setting up console, etc. It still gave "Not enough memory.". No mallocs that I can find earlier on...all it does it make a couple of variables, setup the global variables, etc. Nothing big, and no mallocs that I can see. Oh, and crafti is very nice amazed at how fast it goes.
8
« on: May 07, 2014, 01:29:22 pm »
Didn't I find how much it was allocating (2400)? (and breakpoints don't do me much good seeming as I've never figured out how to use a debugger very well)
9
« on: May 07, 2014, 01:22:39 pm »
It's not a breakpoint, it's a return value. The original function:
int init_mem(void) { if (n_tokens <= 0) return false; if ((scratch = (token_type *) malloc(((n_tokens * 3) / 2) * sizeof(token_type))) == NULL || (tes = (token_type *) malloc(n_tokens * sizeof(token_type))) == NULL || (tlhs = (token_type *) malloc(n_tokens * sizeof(token_type))) == NULL || (trhs = (token_type *) malloc(n_tokens * sizeof(token_type))) == NULL) { return false; } if (alloc_next_espace() < 0) { /* make sure there is at least 1 equation space */ return false; } clear_all(); return true; }
I edited the return values to be 1, (((n_tokens * 3 )/ 2 ) * sizeof(token_type)), 3, and 0, respectively, and edited the function that init_mem(); returned to so it would print the return values, and continue without error if the value was 0. Therefore I could track where the fail was coming from.
I don't think the "breakpoint" was intentional: it was in the code to begin with. Maybe I'm misunderstanding you.
10
« on: May 07, 2014, 01:09:15 pm »
Any ideas? It fails at that block of code, so I expected it was malloc's fault.
11
« on: May 07, 2014, 01:01:13 pm »
Instead of putting a breakpoint in malloc I did this:
if ((scratch = (token_type *) malloc(((n_tokens * 3) / 2) * sizeof(token_type))) == NULL || (tes = (token_type *) malloc(n_tokens * sizeof(token_type))) == NULL || (tlhs = (token_type *) malloc(n_tokens * sizeof(token_type))) == NULL || (trhs = (token_type *) malloc(n_tokens * sizeof(token_type))) == NULL) { return (((n_tokens * 3 )/ 2 ) * sizeof(token_type)); }
So if that block (the one that is failing) fails, I'll know the largest block size it's allocating. The return value is 2400. Is that what you were asking for?
Quadratic77
12
« on: May 07, 2014, 11:12:17 am »
Hello,
On my nspire CX CAS with ndless 3.6 and OS 3.6.0.546, when I run nPDF it runs fine the first time and freezes up the second time I try to run it. It freezes after about 10 seconds of the clock turning.
Could this be because of ndless 3.6 and nPDF uses 3.1 stuff (hooks, etc.)?
13
« on: April 26, 2014, 05:45:15 pm »
Yes, I saved the flash as nand.img (maybe I saved it in the wrong location, where should I?). And when I loaded the emulator up again, it said to "press I to load default operating system" or something like that. And it did load the default OS again, just like the first time. Now, if I change DEFAULT_N_TOKENS to 10 and make the "out of bounds" error to <10, it fails at this: if (n_tokens <= 0){ return false; } (in init_mem() -um, that's supposed to be a ';' and a ')', not a smiley... So it seems like the DEFAULT_N_TOKENS HAS to be at least 100....and, the documentation says mathomatic can run on a few mb's of RAM, so I shouldn't have to hack it down lower.
14
« on: April 26, 2014, 03:55:35 pm »
Ok, tracking it down to this: ((scratch = (token_type *) malloc(((n_tokens * 3) / 2) * sizeof(token_type))) == NULL || (tes = (token_type *) malloc(n_tokens * sizeof(token_type))) == NULL || (tlhs = (token_type *) malloc(n_tokens * sizeof(token_type))) == NULL || (trhs = (token_type *) malloc(n_tokens * sizeof(token_type))) == NULL) That block returns false. As for malloc, putting a puts into it crashes the calc. The emulator worked fine until I restarted it. Lost my ndless and ndless folder on the emulator and I don't care to re-do everything right now. And I can't find the malloc function. "system" folder in where? Sorry if I'm asking too many questions and not doing the work myself. And congratulations on reaching the 700 post mark .
15
« on: April 26, 2014, 10:21:48 am »
What do I want to do with exceptions in C? I don't know, but the makefile that came with mathomatic apparently had it in.
Debug it: I can't. The emulator requires boot1 and boot2 and polydumper only dumps my boot1 for some reason, which I can't figure out.
And please pardon my apparent stupidity on this:
nspire-gcc -Og -g -Wall -Wshadow -Wno-char-subscripts -Wno-unused-variable -marm -mlong-calls -fno-exceptions -DLIBRARY -DVERSION=\"`cat ../VERSION`\" -DSILENT=1 -DSECURE -DHANDHELD -c -o lib.o lib.c cc1.exe: error: argument to '-O' should be a non-negative integer make: *** [lib.o] Error 1
-Og throws the error I expected it too...where am I wrong here?
Oh, and if I compile with arm-none-eabi-gcc, the calc freezes on the document screen right when I click on mathomaticndless.tns. I'm curious: why then and not after it loads the console?
|