PS2 APA JAIL

@Berion I checked the latest UEFI specifications v2.9 and unfortunately, we cannot modify GPT header as heavily as I did:
...The primary GPT Header must be located in LBA 1 (i.e., the second logical block) ...

...If the block size is 512, the First Usable LBA must be greater than or equal to 34 (allowing 1 block for the Protective MBR, 1 block for the Partition Table Header, and 32 blocks for the GPT Partition Entry Array);...
The first one will lead to the fact that we will need to recalculate the APA checksum each time when minor changes in the partition table are made.
But the next one is more destructive, APA journal and any APA smart information will be erased once GPT will change something. So unfortunately at least until UEFI specifications allow reducing Partition Entry Array, we cannot use it with the APA scheme.
 
GPT is modified only during creation and if user decide to shrink, enlarge or rename it. Not managing files on partition, defragmenting etc. because this lie in manner of file system table (not partition table) which starts after "hdd0:/__jail" header. So it is quite safe to use. In other hand, user do not need APA Journal *if* he do not want adding or removing partitions.

Well, the assumptions of this experiment are:
  • keep minimal APA setup to keeps PS2 apps compatibility (FHDB, HDD OSD, uLE etc.)
  • keep one huge partition with exFAT to store games (so this can be threat as BDM)
And it works in this tight specification. ;)
 
@Berion Even in this minimal setup, when we keep as much read-only as possible, APA will write journaling into the place where GPT stores partition information. This will lead to GPT checksum corruption. Many OSs will try to fix the GPT header silently (if found corrupted checksums), this will lead to the fact that the APA journal will be erased silently.

So basically now APA will break GPT checksums :D

I mean, that we can just use a pure MBR scheme instead. Good old MBR which allows only 4 partitions per disk and is limited per 2 Tb. As we are forced to fix checksums.
 
APA will write journaling into the place where GPT stores partition information
It will not if user will not create or rename any partitions, right? And GPT will not update it on Windows (tested only on 7) or Linux if user will not touch partitioning.

I mean, that we can just use a pure MBR scheme instead.
Didn't try yet but in theory sounds like better candidate. However, it will fully overwrite PS2 stuff as fully reside in LBA0 so cannot be used. :(

mbr.png


I'll leave this idea for now, as at least base Hybrid APA/GPT test image is quite ready.
 
Last edited:
Hey @Berion! Your APA Jail idea seems really good. The only limit I see "in" the PS2 is secror-allocation being limited to 32Bits, BUT in theory longer allocations ARE possible.

I just hope it doesn't dive performance down...
 
I see this nice discussion which I barely understand but I have a question - what would this discovery can turn into / do for casual console users? :)
 
@Impaler APA Jail providing capability of booting apps from HDD like eg FHDB, HDD OSD, PSBBN, Linux Kit, SoftDEV2. Plus support for all existent homebrew which using HDD (i.e SCUMMVM, MCA). So everything just like normal APA. However, exposed exFAT partition will be visible on Windows, Linux etc. without need of special software for support PS2 disks because from PC point of view, it will be normal GPT disk.
 
Thanks for the explanation. That's nice. Does that in any way can get us closer to enabling PS2 to read PSX ISOs?
 
@Impaler APA Jail providing capability of booting apps from HDD like eg FHDB, HDD OSD, PSBBN, Linux Kit, SoftDEV2. Plus support for all existent homebrew which using HDD (i.e SCUMMVM, MCA). So everything just like normal APA. However, exposed exFAT partition will be visible on Windows, Linux etc. without need of special software for support PS2 disks because from PC point of view, it will be normal GPT disk.

Very interesting. I have not seen this before but it would be enormously useful.
Are you planning to create tools to create the initial partitioning and set this all up?

Ideally something like "dd this prepared 1Gb image to the HDD" then after booting there is a small elf you can launch from wLE to fix up the GPT to match the size of the actual hdd and format the exfat partition.
 
Last edited:
@Ronnie Sahlberg Unfortunately no tools, I'm not a programmer. ^^ Proof of concept image is attached (write lba0 file, ignore the rest).

Images isn't good idea because some people would want other partitions than standard list or with standard sizes. It is needed a tool which adopt existing APA and all stuff, adds __jail with exFAT (but none PS2 app now support exFAT in APA, only on MBR or GPT) and add/mix to it GPT with exFAT partition building from scratch to make solution flexible. However it is not easy task because on PS2 we will have problems with hddlibs and bdm. Some custom are needed or handle HDD on low level. On PC should be easy of course.

Problem with this Frankenstein is that user must know what he doing. If he will touch in future partitioning by any tools on PS2 or PC, then he will kill whole environment because PC tools, let's call them normal, and scene tools (like eg. hdldump), and PS2 scene tools (HDDChecker, uLE etc.) will not detect opposite partition table.

BTW if someone didn't see it yet:
https://www.psx-place.com/threads/the-future-of-the-playstation-2-internal-hard-drive.40830/
 
Last edited:
Out of curiosity, this is only usefull for people who takes out their HD to transfer files over to it right? On mine I use HDLServer to transfer games over the network
 
@Kevin8082 APA Jail cannot be used for HDLServer and similar apps because APA in it is only for basic stuff, not for storing games which will be put on GPT area on exFAT partition, instead in APA area as partition.
 
@Kevin8082 APA Jail cannot be used for HDLServer and similar apps because APA in it is only for basic stuff, not for storing games which will be put on GPT area on exFAT partition, instead in APA area as partition.
if there was a good software on the PS2 side to manage the HD would it be possible to FTP games into the GPT partition? FTP through wle and internal HDs never works too well
 
if there was a good software on the PS2 side to manage the HD would it be possible to FTP games into the GPT partition? FTP through wle and internal HDs never works too well
Nothing supporting exFAT on APA currently, and none network app supports FAT32 or exFAT on GPT (I never used nbd-server, so maybe I'm wrong).
 
Nothing supporting exFAT on APA currently, and none network app supports FAT32 or exFAT on GPT (I never used nbd-server, so maybe I'm wrong).

Once this becomes mature and wLE gains support for these kind of exFAT partitions then I could use that and rebase my SMB2/3, NFS3/4 version of wLE to it. And we would have a wLE instance with network support and exFAT support. At that point it would just be a matter of copy the ISOs from your windows share onto the exFAT partition using special-wLE. (on 100baseT it might not be usefully fast, but it should work and that would be cool and would be more important than if it is useable.)

But it will have to wait until someone creates a version of wLE using this so I have something to rebase my netowrk support on.

(I have to run networking on the EE and not IOP as normal wLE does so it would have to be a separate special fork, just like my existing network filesystem port is. I had almost working version with libnfs/libsmb2 running on IOP but it was unstable and I just could not debug the issues. Too painful.)
 
Last edited:
@Ronnie Sahlberg Current status looks like that exFAT is supported only on internal HDD via modified BDM modules by Grimmdoomer's fork of OPL, and by mainstream uLE and uLE ISR by standard BDM but only for external devices. No one is interested in updating standard modules (ATAD?) for internal HDD to getting exFAT support on APA. :(

However, You an take code from Grimmdoomer's OPL and that will work because it seeking exFAT on GPT which APA Jail both sharing.
 

Similar threads

Back
Top