Announcement

Collapse
No announcement yet.

Booting elf from memory card

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Booting elf from memory card

    I am trying to boot a separate elf from the mc. When I try with ExecPS2() it launchs "mc1:/BOOT/helloworld.elf", but the screen goes black and nothing loads. However, if I use ExecPS2() on "cdrom0:\\SCUS_XXX.XX" it loads the game fine. If I try with LoadExecPS2(), same result. I'm stuck, any help? Thanks.

  • #2
    The LoadExecPS2() syscall doesn't allow you to boot from mc/mass/etc. by default. That's why we wrote our own ELF loader for PS2rd that replaces LoadExecPS2(): https://github.com/mlafeldt/ps2rd/bl...lfldr/elfldr.c

    Comment


    • #3
      Yeah I looked at that a bit. From my understanding, what it does is replace all data between 0x00100000 - 0x020000000 with 0. Installs the games data into the EE memory. Grabs the headers data. Resets the IOP and lastly executes ExecPS2() with the data from the header. Is all that necessary to execute from mc0/mc1? I understand resetting the IOP since I have some modules loaded that may interfere. Also grabbing the header data (which I have done with ExecPS2()) is needed. But do I have to make the EE null and then install it into the EE? Instead of your method to make the EE full of 0x00000000. I tried this on a game;

      Code:
      u32 Addr = 0x00100000;
      
      for ( Addr = 0x00100000; Addr < 0x02000000; Addr += 4)
      {
      *(u32*)Addr = 0x00000000;
      }
      Then I run you method to clear the scratchpad. Installed the memory from a function from CogSwap. It just freezes. I removed the clear EE part. Then it loads. Do I have to relocate the elf? It seems to me like it is overwriting my elfs data with 0's, which is causing it to freeze. Now on my helloworld.elf, black screen again.
      Last edited by dnawrkshp; 08-14-2012, 03:22:24 AM.

      Comment


      • #4
        One thing I forgot to mention are the SBV patches. You need to enable them, in particular sbv_patch_disable_prefix_check() is what you want. See https://github.com/mlafeldt/ps2rd/bl...der.c#L213-215

        We're relocating the ELF loader at 0x000ff000 by default. But maybe you don't need it at all. IIRC, the loader was required for games with multiple ELFs. I'm not sure.
        Last edited by misfire; 08-14-2012, 04:12:43 AM.

        Comment


        • #5
          The game I tested on was a multi-elf. The header from the looks is sbv_patches.h. No that gives me an undefined error. What is the header?

          Comment


          • #6
            As always, git grep is your friend. Search ps2sdk and PS2rd.

            Comment


            • #7
              Oh missing library patches. Looks like your code works better than CogSwap's. But then again, yours was meant to work with yours. Thanks a lot.

              Comment


              • #8
                Actually, I don't know what CogSwap is doing (is it open source?), but there're a handful of basic tricks everybody is using.

                And yes, PS2rd has a really high code quality. The downside is that I've put too much energy into polishing already working features instead of adding more of them. That's why the debugger really lags behind and doesn't support breakpoints, for example.
                Last edited by misfire; 08-15-2012, 04:13:24 AM.

                Comment


                • #9
                  I wish I could use it, but as I have noticed it doesn't work through the router. So when I decide to buy a crossover cable, then let the hacking begin!

                  CogSwap is an alternative to Swap Magic (someone hacked it and grabbed the IOP mod to boot back ups). The problem is, many people have modded the source to make different things happen. The one I have boots PS2Link and some others from mc0 and never touches the disc. However, all you have to change is the boot path, and it works on discs.

                  One last thing, how did you accomplish running PS2rd/Artemis with OPL? I tried that, but it freezes on hooking the game (red debug color). Unless we have the same hook... At which point, that would be easier to solve.
                  Last edited by dnawrkshp; 08-26-2012, 07:43:52 PM.

                  Comment


                  • #10
                    We accomplished that by having the main author of OPL in the PS2rd team.

                    Comment


                    • #11
                      I see... I read ffgriever's post on ESR and he explains where it installs itself a bit. I tried to get my engine to work with it. But it seems to have similar problems to OPL. I am going to change the hook when I try again. That looks like it may work.

                      Comment


                      • #12
                        Seriously, first thing to make sure is that the code doesn't overlap. It took quiet some time to figure out where to place the different components, see https://github.com/mlafeldt/ps2rd/bl...der/ps2rd.conf

                        Comment


                        • #13
                          I really doubt that could happen. The only code that he loads into the kernel, is much ahead of mine. So there is no way that could interfere. The rest seems to be written around 0x000F0000.

                          So the only possibility seems to be the hook. I have loaded it with no engine, hook, and codes and it seems to boot the game fine with ESR. But since you have more experience, I will try loading ESR with the engine and some codes without a hook.

                          Comment


                          • #14
                            Sorry about the wait, finished E type jokers this morning and there was a major bug that made nothing but E type jokers work. Now that it is fixed, I will try ESR.

                            With cheats and engine: Boots ESR and ESR boots ESR patched game.
                            With Hook, cheats, and engine: Boots ESR, freezes when loading game.
                            With Nothing: Boots ESR and ESR boots ESR patched game.
                            With Hook and engine: Boots ESR and freezes on game.

                            I've decided that it's the hook.
                            Last edited by dnawrkshp; 08-16-2012, 04:40:08 AM.

                            Comment


                            • #15
                              NOTE: Hook that doesn't work: 0x800002FC.

                              Found a different hook at 0x80000358. It boot ESR and the game launches, but the codes don't work.

                              Made a different engine that has a pre-loaded code. Then tried it with ESR, and doesn't work.

                              Found another hook at 0x80000244 and tried with the second engine. Boots ESR and game, but once again, the code doesn't work.

                              Tried this on OPL with codes. Boots OPL and OPL boots game from USB. Then it freezes on the "Sony Computer Entertainment America presents".

                              Tried OPL without codes, and it still freezes.
                              Last edited by dnawrkshp; 08-16-2012, 06:57:55 PM.

                              Comment

                              Working...
                              X