PDA

Bekijk de volledige versie : how many characters is safe to write with nvram to one variable???



megy
07-04-2004, 20:24
how many characters is safe to write with nvram to one variable???

I've learned on the killed unit that it's impossible to write
the whole bunch of data(10kB) into one variable, so I want to
write it this way:


etcxx=M>7,O:V5R;F5L+VAO='!L=6<*"FEF(%L@+60@+VUN="]U<V)F<R]I;FET<F0@

where xx is an increasing number from one to ??xxxxxx??

Is it possible(probably question aimed to oleg)???

And how many variables is nvram able to handle???
eg for ex. etc0-etc10000 ???

Thanks for help.

Oleg
07-04-2004, 20:43
I've not checked this yet. You probably need to consult source code. In my opinion 200 bytes per variable should be fine. But just to warn you: nvram is limited in size. At most it could be 32k, it's now available 20k on my wl500g.
If you need store data in flash I'm recomending the following. Due to the different flash types there is an unsed gap in the wl500g flash which is 64k in size. It's at 0x3e0000. So you can alter the kernel, so it will map this 64k as separate mtd device which could be used for storing everything.

Antiloop
07-04-2004, 20:50
idd.. to see how much nvram you have left
go to the console and type this:



nvram show


at the end it will show something like
size: 10909 bytes (21859 left)

megy
08-04-2004, 16:49
Thanks oleg,
the free space in flash is fine.
Do you have any idea how to map it or directly access it??

Oleg
08-04-2004, 17:08
I've many ideas. :) If you need a block/char device to access it you will need to change the kernel (there is a mapping for this flash). If you don't need this you can mmap /dev/mtdblock/2 and use the last 64k in your program.