NDS_loader

support for the ARM toolchain
Post Reply
obcd
Posts: 21
Joined: Mon Jan 19, 2009 10:09 pm

NDS_loader

Post by obcd » Sun Jun 06, 2010 2:33 pm

I am trying to compile the NDS_loader sources. After the usual changes, the code compiles, but refuses to run.

I downloaded the default_arm7_src-0.5.12 package and added the nds_loader_arm7.c to it. I call that function in the main.c idle loop.
I ran make on it and transferred the 2 default files to the libnds folder.

I use the load.bin from the original package. As the original NDS_loader.nds program is running fine, I assume that bin is fine as well.
I can follow the execution of the arm 9 code till the last instructions were it reaches the swi_softreset().
At that moment, the arm7 should notice the condition to start the code at VRAM_C 0x0600:0000 and should execute a swi_softreset() as well.
If I run the program on no$gba, it says that it jumped to some empty memory in VRAM.
I haven't found a way to debug that far. It looks like something seriously changed in the latest libraries causing the loader not to run anymore. Mayby the source that came with the nds_loader.nds isn't consistent with the nds file itself.
Debugging is extremly fustrating. If I try to run the code on the latest desmume with the biosses enabled and the swi calls executed by the bios, I don't see the adress at 0x027F:FE34 changing to 0x0600:0000. If I disable the biosses, I see the adress changing, but things aren't running. The original nds isn't running either that way. If I try no$gba, I get the jump to empty vram warning. I get it with the original ndsloader as well.

Does anyone have a clue what I am missing here?

PS. I changed parts of the fat_browse code as well. It was acting very weired with the original code. (Altough it compiled fine.)

trini
Posts: 3
Joined: Mon Jul 26, 2010 3:11 am

Re: NDS_loader

Post by trini » Mon Jul 26, 2010 3:17 am

Have an identical issue - trying to modify the bootstrap loader from HBMenu to customize it for a DSTT clone card, and the generated loader stalls. :?

I'm using source from fincs' blog on drunkencoders, and he has a pre-compiled version in there. Using the pre-compiled version binary, all is well. Trying to compile from source (which is almost identical to the HBMenu source), flops.

Did you make any headway with this? My next step is to downgrade devkitarm, but I've been hedging thinking it's my error.

~trini

WinterMute
Site Admin
Posts: 1986
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: NDS_loader

Post by WinterMute » Mon Jul 26, 2010 9:25 pm

Actually you don't have an identical issue, this topic is asking about code which I'm not sure was ever released publicly. The old NDS_Loader code doesn't work with recent toolchains.

There's a bootstrap loader for DSTT cards already included with hbmenu, doesn't that work?

hbmenu was also recently updated for a minor issue with devkitARM r31, if you need to compile then grab it from svn and do a clean build.
Help keep devkitPro toolchains free, Donate today

Personal Blog

User avatar
vuurrobin
Posts: 219
Joined: Fri Jul 11, 2008 8:49 pm
Location: The Netherlands
Contact:

Re: NDS_loader

Post by vuurrobin » Mon Jul 26, 2010 11:12 pm

WinterMute wrote:There's a bootstrap loader for DSTT cards already included with hbmenu, doesn't that work?
its in svn, but not in the latest version.

also not sure if that works with DSTT clones, but its worth a shot.

trini
Posts: 3
Joined: Mon Jul 26, 2010 3:11 am

Re: NDS_loader

Post by trini » Tue Jul 27, 2010 3:50 pm

My bad for the OT post - i'll open another thread if i can't figure it out in a few days.
WinterMute wrote:There's a bootstrap loader for DSTT cards already included with hbmenu, doesn't that work?
The bootstrap loader is for 'R4i-sdhc' cards - although they're marketed as R4, they're DSTT clones (was the only thing i could find locally :S). They have some stupid hardware protection on the cards (watermark checking at 512 byte sectors, *possibly* algorithmic hashing of the first half word of each sector in the boot binary). fincs figured out an injection method to get the HBMenu bootstrap code into the dirty nds (vendor supplied R4.dat), I modified it to generate a totally clean (i.e. no offending code) binary.
WinterMute wrote:hbmenu was also recently updated for a minor issue with devkitARM r31, if you need to compile then grab it from svn and do a clean build.
Problem wasn't with HBMenu itself (although I admittedly didn't try to compile it on r31), since I was only trying to generate a clean bootstub loader.

The card is pretty crappy, but *i think* it's the most commonly available clone card marketed, and it's dirt cheap ($5.00) - figured it was worthwhile to get a clean loader. I've dumped my code on filetrip (dont have anywhere else to host it). It's not really in a 'release' state, but i can probably clean it up over the weekend if you guys think it's worthwhile including in the hbmenu distro.

~peace

WinterMute
Site Admin
Posts: 1986
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: NDS_loader

Post by WinterMute » Wed Jul 28, 2010 12:26 pm

You sure you're not confusing it with the original R4? Cheapest I can see the R4i sdhc for is around $12.

A clean loader for the card would definitely be worth adding to the hbmenu distro.
Help keep devkitPro toolchains free, Donate today

Personal Blog

trini
Posts: 3
Joined: Mon Jul 26, 2010 3:11 am

Re: NDS_loader

Post by trini » Sat Jul 31, 2010 1:12 pm

Card is the red-box v1.4 r4isdhc. I got it when i picked up my DSiLL, store tacked equivalent of $5.00 onto the bill - they probably had margin on the DS though, so maybe it retails alone for more.

Anyway, as promised attached is the source - I've isolated it in a separate directory so you guys can review it easier, just need to drop it into the hbmenu/BootLoader directory. Only replaces the Makefile, adding the R4.DAT build and clean targets.

~peace
Trini
Attachments
r4i-bootstrap-hbmenu.7z
Bootstrap source for HBMenu for R4i-sdhc DSTT clone cards
(10.48 KiB) Downloaded 542 times

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests