gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > DS linker DLDI - EABI version 0, version 4

#119724 - Diddl - Sun Feb 25, 2007 4:16 pm

The DLDI file for DSlinker only supports read access.

The DS Linker card is exaktly same hardware as N-Card, MK5 and [a card whose manufacturer's web site distributes pirated DS games -- MOD]. For N-Card exists a library file which can also supports write access. You can download the code at: http://www.dsgba.com/download.htm

The file is called


I wanted to implement this code in Libfat but at link time an error message occurs: object file has old EABI version 0, current linker uses version 4.

Is there a chance to use this old lib file in current projects? Or is it possible to disassemble the code (reverse engineering)?

#119747 - Puyo - Sun Feb 25, 2007 8:42 pm

I would guess that version 0 is not even a version, but just a not defined value. It seems like some compilers don`t add those values. There must be a compiler option to turn this check off, which i haven`t found yet.
Sooo, you have a library file, which consists of a few compiled files, and they all have wrong eabi versions. The easiest way would be to edit them manually. In hex editor search for "ELF" header. And edit 36th byte from that offset (0x717 would be first occurrence) with 4. You can also extract them and edit by one: first file dscard.o would be a file from offset 0x6F0 to (0x6F0 + 32760).
Disassembling is a option too.

#119802 - wintermute - Mon Feb 26, 2007 2:40 pm

This might help a bit

http://www.devkitpro.org/downloads.shtml#change-eabi

Given that the code is provided as a library file it's pretty easy to disassemble. arm-eabi-objdump -d libncardio.a > libncardio.s should get you started.

It might be a bit easier to extract the object files & disassemble them individually. arm-eabi-ar -x libncardio.a

The disassembly won't quite match up to the hex dump in the files this way because the object files haven't been fully linked. Some addresses are determined and fixed up at link time.

You can use objdump on a fully linked .elf file as well, this will give you the absolute addresses used in the final nds but will also have all the extra cruft from the crt0, libc & libnds.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#119839 - Diddl - Mon Feb 26, 2007 8:50 pm

thank you for your help! I'm impressed how competent and qualified user are on this board!


ingeniously!

works perfect with
Code:
arm-eabi-ar -x libncardio.a
arm-eabi-objdump -d dscard.o > dscard.s
     :                                        :

#119893 - Diddl - Tue Feb 27, 2007 9:37 am

is there also a easy way to get the disassem dump in a form usable for compilation (assemble).

I know, I only have to delete this leading hex numbers and reformat the labels. But there are hundreds of KB and if there is a easy way it would be nice.

could you suggest a book for learning ARM assembler? does it makes sense to learn ARM assembler?

#119938 - Puyo - Tue Feb 27, 2007 6:33 pm

Try changing eabi version first. There`s a good chance that it will work this way.

If you wish to understand assembly listings you should first of all learn some basic info about processor, then go on for instruction set. GBATek & Richard Murray`s ARM ASSEMBLER should give you all info you need.

#119943 - Diddl - Tue Feb 27, 2007 8:28 pm

Thank you, it a good idea. Will first try to change EABI version.

I see, in all cases it is necessary to learn ARM assembler (for me).

#120067 - Diddl - Wed Feb 28, 2007 7:42 pm

shortly report (if anyone is interested??):


thanks for your help! changing eabi was succesful. after changing this object files and adding to a new library it compiles fine.


but at the end it is only partially successful ...

I have a 16GBit and a 4GBit card. this lib can write now, but only on the old 4GB card. the new 16GB card gives an error: unknown NAND


maybe the 8GB DS Linker card will run. I have none, so I cann't test this. but now it should be possible to make a DLDI for this 4GB, 2GB and 1 GB card.

hier is the binary, the source and the lib: click me

#120077 - Puyo - Wed Feb 28, 2007 9:52 pm

Nice to hear that. The problem with 16 GBit is probaly because the lib is outdated. Now if you !really interested! in making it work, than you should learn something on how NAND works. For that you should disassemble your card & get all the possible info about the chip inside. Than you should go to the manufacturers site and download the datasheet. That`s the least you can do now.

P.S. Nothing holds you from downloading other manufacturers datasheets like Intel`s (they all work basically equally).

#120665 - Diddl - Mon Mar 05, 2007 10:39 am

good news! DLDI with write support will come next week: Neo