ps2homebrew / wLaunchELF

ELF loader and File browser for Sony PlayStation 2
Other
515 stars 51 forks source link

Osdmain.elf location not found for hdd users. FHDB #36

Open mahoneyt944 opened 4 years ago

mahoneyt944 commented 4 years ago

https://github.com/AKuHAK/uLaunchELF/blob/8d4a0c28f336395d42fe43ddc981cac11ce0ea5f/main.c#L2115

Since this location is hard coded for memory card location only and FreeHDBoot users have their osdmain.elf stored at "hdd0:/__system/osd/osdmain.elf", misc/osdsys does not work.

A easy solution to this might be to add an if / else statement here to allow both locations to be usable. The "else" will still default to the original coding if osdmain.elf is not found on hdd. This would make things more compatible without compromising original design.

Something similar to this, but in proper syntax of course:

If "hdd0:/__system/osd/osdmain.elf" exists
    sprintf(default_OSDSYS_path, "hdd0:/__system/osd/osdmain.elf");
Else 
    sprintf(default_OSDSYS_path, "mc:/B%cEXEC-SYSTEM/%s", rough_region, file);
mahoneyt944 commented 4 years ago

This was an issue before reported here, #24 .

sp193 commented 3 years ago

You can exit back to the browser (PS2Browser option), which should load FHDB.

mahoneyt944 commented 3 years ago

Yes I know. This was more about not having dead options in the menu though. It's a simple addition to the sprintf to make everything just work properly. "Polished".

It should attempt to load from hdd before failing out completely if the mc location isn't valid.

sp193 commented 3 years ago

That's not really how the HDD browser is loaded though. FHDB's KELF (osdmain.elf) is actually an unofficial boot target. At boot, the browser checks for the presence of the MBR program in mbr, not whether the file exists in system. It isn't actually aware of the possible files that the MBR program will boot.

The MBR program is also responsible for checking on the HDD for partitions that were flagged as being bad, before triggering the fsck tool if it is required. Otherwise, it will boot the HDD OSD.

As documented in my MBR, there are 3 sets of paths:

It supports the same integrity checks as the Sony MBR program, and boots one of the following KELF targets:
1. pfs0:/osd/osdmain.elf        (Unofficial target, for FHDB)
2. pfs0:/osd/hosdsys.elf
3. pfs0:/osd100/hosdsys.elf
If the HDD has been deemed to have filesystem corruption, FSCK in one of these locations will be launched, in this order:
1. pfs0:/fsck/fsck.elf      (Unofficial target, for FHDB)
2. pfs0:/fsck/fsck.elf
3. pfs0:/fsck100/fsck.elf

If you really wanted an option to boot the HDD update, then I think LaunchELF should boot the MBR instead. If that direction is not desirable, then it should at least have a list of boot targets (possibly without consideration for fsck) to attempt to boot, in the appropriate order.

mahoneyt944 commented 3 years ago

@sp193 I'm certainly not as knowledgeable on the technical end of "misc/osdsys". I just think it should be made compatible with fhdb too since it's a broken option for fhdb users currently. This issue post was just my initial thoughts on it and how it might be possible or at least to get a discussion going.

"misc/osdsys" could probably be expanded to allow for more uses in general. There's probably some neat things that could be done with it, like forcing dvd updates to be loaded from hdd, but that's a whole other topic.