B-Tree for AVR

Hi, I'm using the Progressive Resources MMC flash file system on a Mega128. I've implemented a record based data-storage file layer. I would like to add an indexing mechanism such as btree to create an index of the records in a seperate file.

I have looked at an old version (1.1a) of bplus and the library included with miniDB. I have been able to compile and run bplus on my hardware on its own, but when I integrate it with the rest of the firmware I have some stability problems.

Does anybody now of a smaller/simpler implementation to index data records on something like the Mega128?

Regards Pierre

Reply to
Pierre de Vos
Loading thread data ...

If you rewrite it in the language of your choice :

formatting link

Have a look at the html page source, the html itself may omit some lines due to interpretation of < > and such.

Rene

--
Ing.Buero R.Tschaggelar - http://www.ibrtses.com
& commercial newsgroups - http://www.talkto.net
Reply to
Rene Tschaggelar

I really had to look this one up :-). I once used the very same source from Wirths book published in 83 and this version had two bugs in it which back then I had to find myself the hard way...

Just to make things clear, the version in the link above does not have the bugs.

Markus

Reply to
Markus Zingg

Guess what, I had it running then and apparently had to find them. A quick job with the single step debugger, a tool N.Wirth finds unnecessary.

Rene

--
Ing.Buero R.Tschaggelar - http://www.ibrtses.com
& commercial newsgroups - http://www.talkto.net
Reply to
Rene Tschaggelar

GNU libavl does compile fine with avr-gcc:

formatting link
\Development\avl-2.0.1>avr-unknown-elf-readelf -S avl.o Section Headers: [Nr] Name Type Addr Off Size ES Flg Lk Inf Al

[ 0] NULL 00000000 000000 000000 00 0 0 0 [ 1] .text PROGBITS 00000000 000034 002d32 00 AX 0 0 1 [ 2] .rela.text RELA 00000000 003548 0008ac 0c 7 1 4 [ 3] .data PROGBITS 00000000 002d66 000206 00 WA 0 0 1 [ 4] .rela.data RELA 00000000 003df4 000018 0c 7 3 4 [ 5] .bss NOBITS 00000000 002f6c 000000 00 WA 0 0 1 [ 6] .shstrtab STRTAB 00000000 002f6c 000036 00 0 0 1 [ 7] .symtab SYMTAB 00000000 00310c 000290 10 8 c 4 [ 8] .strtab STRTAB 00000000 00339c 0001ac 00 0 0 1

Compiled with -Os option: Section Headers: [Nr] Name Type Addr Off Size ES Flg Lk Inf Al [ 0] NULL 00000000 000000 000000 00

0 0 0 [ 1] .text PROGBITS 00000000 000034 00172e 00 AX 0 0 1 [ 2] .rela.text RELA 00000000 001f44 000834 0c 7 1 4 [ 3] .data PROGBITS 00000000 001762 000206 00 WA 0 0 1 [ 4] .rela.data RELA 00000000 002778 000018 0c 7 3 4 [ 5] .bss NOBITS 00000000 001968 000000 00 WA 0 0 1 [ 6] .shstrtab STRTAB 00000000 001968 000036 00 0 0 1 [ 7] .symtab SYMTAB 00000000 001b08 000290 10 8 c 4 [ 8] .strtab STRTAB 00000000 001d98 0001ac 00 0 0 1

Code size is around 5934 bytes.

You would have to run one of the test programs that are part of the distribution in order to know if libavl is fully functionnal on an ATMEGA128.

Hope this is of some help.

Jean Tabel

source

have

Reply to
Jean Tabel

You might take a look at hashlib, as a general purpose data storage and retrieval system. It is written purely in standard portable C. It is under GPL, but since it is mine I can easily be contacted for other licenses. See:

--
Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net)
   Available for consulting/temporary embedded and systems.
     USE worldnet address!
Reply to
CBFalconer

N. Wirth is history - I think.

- Henry

Reply to
Henry Kiefer

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.