Open-PS2-Loader
Open-PS2-Loader copied to clipboard
Improved sysExecExit()
Now it checks if the console can't launch OSDSYS updates or if there's no OSDSYS update installed. If that's the case, it launches an ELF located at one of the next paths: "mc0:/BOOT/BOOT.ELF", "mc1:/BOOT/BOOT.ELF", "mass:/BOOT/BOOT.ELF", "mass:/BOOT.ELF"
Not sure how OSDSYS updates can be related to the opl.
Not sure how OSDSYS updates can be related to the opl.
Here's an example: Imagine you're the owner of 2.30+ console with modchip configured to boot DEV1 and no *Tuna exploit in it. You also have FMCB's standalone ELF or OSDSYS-Launcher (linking to a FMCB KELF) as DEV1. If you decide to exit the actual OPL, it will launch the browser, so you will need to stand up and reboot the console. My improved sysExecExit() will detect you're running OPL in a console with ROMVER 2.30+ and instead of doing the usual Exit(), it will launch the DEV1 ELF. There could also be the case scenario of you having a pre 2.30 console but a MC with no MagicGate, so you have FunTuna Fork installed in that MC. My improved sysExecExit() function will load FunTuna directly (exit to DEV1) so you will not need to trigger the exploit again once you're back in the browser. See? This new function is all about comfort ;)
In pseudo code, is this what you are trying to have exit do:
if (FMCB_installed)
exit();
elseif (BOOT_ELF_found)
launch(BOOT_ELF)
else
exit();
OPL's exit behaviour will be different then the exit behaviour of other applications. Also OPL's exit behaviour will depend on how the user have configured his system. Both are inconsistencies, and I don't think that's desirable.
If we want "exit" to launch an ELF file, instead of exit, then perhaps the user should be able to configure this? Much in the same way the user can configure the IGR path?
I can see why this would be very useful for users, but as @rickgaiser said, it's best if it's a configurable option. Have a new setting that would allow the user to change the behavior of the exit function.
In pseudo code, is this what you are trying to have exit do:
if (FMCB_installed) exit(); elseif (BOOT_ELF_found) launch(BOOT_ELF) else exit();
That pseudo code is wrong. You're not taking in consideration the users of 2.30+ consoles which has a FMCB setup (system update) and loads it via OSDSYS Launcher. That pseudo code of yours will leave them in the system browser and if they had no browser exploit installed (they autoboot DEV1 or DEV3 via modchip), they will need to stand up from their seats and reboot.
This is the correct pseudo code:
load_ELF_flag = false
if (ROMVER <= 230) // PX300 or SCPH-900XX 8C+
load_ELF_flag=true;
if (!System_Update_Installed) // MCs with no MG support, System Update = FMCB or XEB+ installed as System Updates
load_ELF_flag=true;
if (load_ELF_flag)
if (BOOT_ELF_found)
launch(BOOT_ELF);
Exit();
OPL's exit behaviour will be different then the exit behaviour of other applications.
Says who? Other apps had exit to DEV1 options, like SMS.
Also OPL's exit behaviour will depend on how the user have configured his system. Both are inconsistencies, and I don't think that's desirable.
If we want "exit" to launch an ELF file, instead of exit, then perhaps the user should be able to configure this? Much in the same way the user can configure the IGR path?
My new Exit() function (well, sysExecExit(), but let's call it Exit() for short) takes in consideration how most users has their systems configured.
When a user exits OPL, he wants to return to "it's launcher", which could be FMCB, XEB+ or a configured wLE menu, right? Usually:
System Update FMCB or XEB+ users (2.20 or older consoles) has wLE as DEV1 (mc0:/BOOT/BOOT.ELF), so exit to wLE is NOT what they usually want to do.
Owners of Memory Cards with no Magic Gate support (any console) could have:
- FunTuna (uses the OpenTuna BOOT exploit to launch DEV1, which is a standalone FMCB)
- XEB+ (can be launched using OpenTuna BOOT)
- A configured wLE menu as DEV1 which he uses to launch it's homebrew
Owners of SCPH-900XX or PX300 (ROMVER 2.30+) could have:
- FunTuna (uses the OpenTuna BOOT exploit to launch DEV1, which is a standalone FMCB) (*)
- XEB+ (can be launched using OpenTuna BOOT) (*)
- A configured wLE menu as DEV1 which he uses to launch it's homebrew. (*)
- A XEB+/FMCB setup as System Update which he launches using OSDSYS Launcher, which is usually located as DEV1. (*)
(*) Also, take in consideration that in these case scenarios, a browser exploit is not needed or the user could have deleted it because there's no need for it if there's have a modchip installed and which to autoboots DEV1.
Modbo 5.0 users could also not have a Memory Card at all and use the modchip to autoboot DEV3, which my new Exit() function also takes care of. These users usually has a noobie package of a configured wLE menu as DEV3.
One more thing: We should never use the IGR path as the same Exit path! Why? Simple: Some users has OPL as his IGR path (even if that should not be done). Imagine if we Exit to the IGR path, which is, again, OPL... That's wrong. Well, not imagine the user does IGR to OPL and wants to return to his configured wLE menu located at DEV1 or want to exit to FMCB or XEB+... he could simply hit Exit and the new Exit() function will take care of it.
Also, from my point of view, having a setting to allow the user to select if exit to (Automatically decide), (DEV1), (Browser) makes no sense because users will ALWAYS want to go back to their launcher, which Automatically decide/New Exit() already takes care of perfectly. While it is true that having an option to decide manually where to exit can be done, it makes no sense in a daily usage basis. Also, where will we add it? There's no space left in this screen:

So, with that all said, I rest my case you honor! ;)
For easiness, I've made these graphics. Keep in mind that a user when exits a software, usually wants to return to it's launcher. Compare Previous OPL Exit() and New OPL Exit(), displayed in the headers:
Previous OPL Exit(), I confused the title in the picture's banner:
New OPL Exit(), I confused the title in the picture's banner:

I think that is a good idea, but best to make the option configurable.
If separation of the Exit path and the IGR path is desirable, do so, making the Exit path configurable, instead of hardcoding the Exit path.
I think that is a good idea, but best to make the option configurable.
Why? Here's a quick explanation, but also, read my comment above.
- Users always wants to get back to the app which launched OPL when hitting "Exit" which my automatic function takes care of.
- Exit to DEV1 makes no point in the case of pre-2.30 consoles because the most probable file there will be wLE, not the launcher.
- Exit to browser makes no sense in 2.30 consoles. What for? To then stand up and turn off the TV?
- Also, if that's the case and a real "Exit to browser" update should be implemented (one which skips launching OSDSYS updates and launching the browser directly), which is not what the actual OPL's exit does nowadays. It was made with pre-2.30 in mind, which means loading FMCB directly (system update)/going back to the app which launched OPL, now "going back to browser".
So, for the point of "going back to the app which launched OPL", my new sysExecExit() function now has 2.30+ consoles covered (to get the same result as in pre-2.30)
Personally I think hardcoding the path to "BOOT.ELF" is a bad idea (e.g. there may be other storage devices than the ones listed), so ideally the Exit path should be made configurable (independently of the IGR path)
So the user can decide where to go after "Exit" is clicked on any supported storage device.
It will be useful for the users with slim ps2, it will help to load the funtuna exploit without reboot the console if someone need some option of the browser and can back to opl, ulaunchelf or other elf easily without reset
Personally I think hardcoding the path to "BOOT.ELF" is a bad idea (e.g. there may be other storage devices than the ones listed), so ideally the Exit path should be made configurable (independently of the IGR path)
So the user can decide where to go after "Exit" is clicked on any supported storage device.
Well, yes, a function to decide a custom exit path (which should be the number one priority and, if it was not found, exit to the default ones) could be done (even if there's no space in the menu to place it). But, that's a complement for the function I just did, that's NOT part of it. Why? Well, if the user decides a path, exit to THAT path will always be the default option, no matter if the console is not a pre-2.30 one and the user has FMCB as system update. Exit to that ELF which the user decides must be done, even in cases where my sysExecExit() function decides not to launch and ELF and exit the usual way.
What I am proposing to merge is a better "Exit to launcher" function which takes in consideration (A: If the console is 2.30+) and (B: If there's no System Update). I am not pull requesting to merge an "Exit to ELF" function.
Having a configurable ELF exit path will take priority over this function I am proposing to merge:
// Exit to ELF function
If (Custom_exit_path)
launch(Custom_exit_path)
// The new sysExecExit() function I'm proposing to merge
load_ELF_flag = false
if (ROMVER <= 230) // PX300 or SCPH-900XX 8C+
load_ELF_flag=true;
if (!System_Update_Installed) // MCs with no MG support, System Update = FMCB or XEB+ installed as System Updates
load_ELF_flag=true;
if (load_ELF_flag)
if (BOOT_ELF_found)
launch(BOOT_ELF);
Exit();
So, that and this are two different things. Each one with his own function. and 'If (Custom_exit_path) launch(Custom_exit_path)' can be added to both, the actual OPL's sysExecExit() which is just two lines 'deinit(NO_EXCEPTION, IO_MODE_SELECTED_ALL);' and 'Exit(0);' or the new one I am proposing which does (from a user's POV) what OPL does in pre-2.30, but in 2.30+ consoles, in MCs with no MG or in Modbo's 5.0's DEV3.
In pseudo code: Exit to ELF + previous OPL's sysExecExit():
// Exit to ELF function
If (Custom_exit_path)
launch(Custom_exit_path)
Exit();
Exit to ELF + my new OPL's sysExecExit():
// Exit to ELF function
If (Custom_exit_path)
launch(Custom_exit_path)
// The new sysExecExit() function I'm proposing to merge
load_ELF_flag = false
if (ROMVER <= 230) // PX300 or SCPH-900XX 8C+
load_ELF_flag=true;
if (!System_Update_Installed) // MCs with no MG support, System Update = FMCB or XEB+ installed as System Updates
load_ELF_flag=true;
if (load_ELF_flag)
if (BOOT_ELF_found)
launch(BOOT_ELF);
Exit();
If this thing or any derivative idea gets implemented you probably want to avoid executing a kernel patch (unless there is no harm and I'm unaware of that)
On FreeMcBoot 1.9xx osdsys.elf and osd110.elf are kernel patches
On Sony official HDD bootloader, only osdsys.elf is a bare kernel patch IIRC

