Somone please explain the mechanism for software reset

Discussion in 'NDS - Emulation and Homebrew' started by ethanpet113, Oct 6, 2012.

  1. ethanpet113
    OP

    Newcomer ethanpet113 Member

    Joined:
    Sep 13, 2009
    Messages:
    12
    Country:
    Canada
    Ok, so first off, I am a programmer, I can program in several languages, although libnds and palib are C.

    My question is how does software reset work, it seems to recieve an interrupt, and then jump to an address, which I assume is a hook designed for something different. But how does the function for software reset get put at that location, does the flashcard put it there on load, do flashcards use known loaders that patch this, why is it exactly that said loading mechanism is incapable of patching homebrew on many cards?

    I have an origional model NDS, and an R4, as well as an R4 SDHC v1.43.

    It seems to me that most cards have something named aling the lines of swreset.sys which contains the mechanism for jumping back to the menu, and it gets loaded into the address space for this IRQ.

    It really isn't very well doccumented though, if you have any insight on the matter please post.
     
  2. Janthran

    Member Janthran Solarian

    Joined:
    Sep 17, 2011
    Messages:
    3,777
    Location:
    The Pacific Northwet
    Country:
    United States
    If you have an original NDS then why are you posting in the 3DS section?
     
  3. Foxi4

    Reporter Foxi4 On the hunt...

    pip
    Joined:
    Sep 13, 2009
    Messages:
    22,710
    Location:
    Gaming Grotto
    Country:
    Poland
    If you don't have anything to say, don't say anything. Just report the post if you believe it's in the wrong section.

    The mechanism is pretty simple - a part of the menu remains in RAM and with a combination of keys, it can return you to the bootloader.

    http://devkitpro.org...o_Menu_Protocol
     
  4. Cyan

    Global Moderator Cyan GBATemp's lurking knight

    Joined:
    Oct 27, 2002
    Messages:
    16,407
    Location:
    Engine room, learning
    Country:
    France
    Maybe just a mistake.
    You could report the error instead of asking like that without helping him. he might take your comment as an attack.
    Topic moved to NDS section. :)

    Welcome on GBAtemp.
    I'm sure you'll find an answer from another developer.

    Edit:
    he posted before me :ph34r:
     
  5. ichichfly

    Member ichichfly GBAtemp Advanced Fan

    Joined:
    Sep 23, 2009
    Messages:
    618
    Country:
    Germany
    actually the irq handler or swi(?) code gets patched and jumps to the region mentioned in the quote. The patch depend on the loader.
     
  6. Foxi4

    Reporter Foxi4 On the hunt...

    pip
    Joined:
    Sep 13, 2009
    Messages:
    22,710
    Location:
    Gaming Grotto
    Country:
    Poland
    SWI - Software Interrupt (ARM instruction), IRQ - Interrupt Request. ;)

    Either causes a jump to an earlier part of the memory, It's pretty well-explained on the Homebrew Launcher site, y'know. :P Of course it depends on the loader, but the base mechanism remains the same.
     
  7. ichichfly

    Member ichichfly GBAtemp Advanced Fan

    Joined:
    Sep 23, 2009
    Messages:
    618
    Country:
    Germany
    That was not why I wrote the ? it is more like I don't know a way to hook the swi without having to patch more things.
     
  8. Foxi4

    Reporter Foxi4 On the hunt...

    pip
    Joined:
    Sep 13, 2009
    Messages:
    22,710
    Location:
    Gaming Grotto
    Country:
    Poland
    Ah, alrighty then. :)

    Well, I suppose it would be best if we actually ask Normatt or Smith about it, seeing that AKAIO supports both IRQ Hooks and SWI... I never really got into the issue.
     

Share This Page