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 > The Famous "ARM9 PassMe Loop"

#106992 - Lick - Wed Oct 25, 2006 3:43 pm

What is it, and is this it?

Code:
  .arm
   .global _start
_start:
   ldr pc,jump
jump:
   .word _start

_________________
http://licklick.wordpress.com

#107002 - josath - Wed Oct 25, 2006 5:06 pm

When it first runs, jump == _start.
ldr = load register, pc = program counter.

so it's loading the value of 'jump' into pc, which essentially is the same as 'goto _start', which is where it already is, so it keeps executing the same line over and over.

when the arm7 wants to boot the arm9, it simply changes the value at jump:, and on the next instruction, the arm9 will do 'goto <new value>'. Generally, this new value is an arm9 binary which has been loaded into main ram.

#107014 - Lick - Wed Oct 25, 2006 6:15 pm

Thanks for explaning!
_________________
http://licklick.wordpress.com

#107080 - PypeBros - Thu Oct 26, 2006 9:21 am

hmm ... so the ARM7 has control over the ARM9's memory ? i thought it wasn't the case...
_________________
SEDS: Sprite Edition on DS :: modplayer

#107098 - pepsiman - Thu Oct 26, 2006 3:24 pm

PypeBros wrote:
hmm ... so the ARM7 has control over the ARM9's memory ? i thought it wasn't the case...

You thought wrong.

#107101 - Lick - Thu Oct 26, 2006 4:08 pm

I thought the whole 0x02000000 range was shared.
_________________
http://licklick.wordpress.com

#107307 - Mighty Max - Sat Oct 28, 2006 12:06 pm

It is, however usually it is cached on the arm9. Use the mirror at 0x02400000 to avoid out of date data.
_________________
GBAMP Multiboot

#107367 - omaremad - Sun Oct 29, 2006 1:09 am

Quote:
hmm ... so the ARM7 has control over the ARM9's memory


Thats how dipstar works, there is so much empty space in the ARM7 binary you can add loads of code there to modify ARM9 values without expanding the ARM9 binary which usually has a tiny empty space.