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 > MoonShell boot code

#90154 - bjoerngiesler - Wed Jun 28, 2006 5:42 pm

Hi,

I'm trying to pinch a bit of code from the MoonShell sources to build an exec()/system() function, i.e. to run a NDS file from SuperCard (and later others). Long story short, it doesn't work, and I don't know exactly why. Can anyone help out?

First problem is that the routine resetMemory1_ARM9() doesn't compile. It gives errors such as the following:

Error: dest and source1 must be the same register -- `orr r2,r1,r0'
Error: bad instruction `mcr p15,0,r2,c7,c14,2'

... and more. I know next to nothing about ARM9 assembler (will have to learn it, obviously); but how can this compile for MoonShell?

Without the resetMemory1_ARM9 routine (but keeping all other code intact), the launching process just hangs, so I suppose the memory reset is absolutely needed.

Has anyone done something like this before and can give me some pointers?

Thanks a lot in advance,
Bj?rn

#90211 - tepples - Wed Jun 28, 2006 10:50 pm

Make sure that you're not assembling in Thumb mode.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#90301 - chishm - Thu Jun 29, 2006 12:17 pm

In other words, your program will have to be compiled in ARM mode, or you'll need to write external .s files and link them in. There should (hopefully) be something about that in the FAQ.
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com

#90307 - bjoerngiesler - Thu Jun 29, 2006 2:11 pm

Hi,

thanks a lot... fixed my problem already. Turns out that the memory reset isn't needed after all.

I now have a cleaned-up exec() that works for SuperCard and should work for M3 and GBAMP as well, although I have no way to test that. If anyone is interested, I'll put it up somewhere.

Regards,
Bj?rn

#90411 - The 9th Sage - Fri Jun 30, 2006 4:30 am

I could help test either of those.
_________________
Now with 20% More Old Man from Zelda 1 than ever before!

#90908 - EyeballKid - Mon Jul 03, 2006 12:41 pm

Ohhh - fantastic! Yes, please post your code!
I've got an M3 Perfect SD and a Supercard SD I can test it on for you.

Thanks!