protomank wrote:Now I am just missing HDD support, that I still need more information, because I do not have one (I own a PS2 slim) and a friend of mine that have one, told me each game is a partition and the filesystem is kind of strange.
The PS2 HDD filesystem is split into two separate logical device groups.
One device group can only have a single member, this being the device "hdd0:", which is the physical HDD connected as master IDE unit. If the hardware design fully supported an IDE slave unit, that would have become "hdd1:", but that would demand extensive hardware modifications.
Through the "hdd0:" device driver it is possible to access some directly drive-related operations, including raw sector reading and writing, and other operations related to partition control, of course also including the reading of the list of existing partitions.
The other device group is for a set of virtual mountpoint devices using the "pfs" prefix, resulting in full names like "pfs0:", "pfs1:" and so on. These names do not represent any specific physical devices, but instead represent only the contents of some partition from the "hdd0:" device that has been 'mounted' onto that pfs link.
So the meaning of a specific full pathname like "pfs1:/somefolder1/somefolder2/somefile.ext" will depend both on which partition is currently 'mounted' in the mountpoint "pfs1", and on the contents of that partition.
This adds lots of complexity for cases where a launched program needs to find its own location, as there is no system function available for this purpose, and the program launch arguments only pass the PFS path, which does not contain the name of the partition that was mounted at the time of the launch (no longer mounted after reinitializing drivers as part of an application init).
Even so, the PFS-based filesystem is the only one which allows normal file handling on a PS2 IDE HDD, both for data and program files, as used by normal PS2 programs both of commercial and homebrew design. In addition to this filesystem, PS2 Linux can also allow other filesystems to be used but those are then not compatible with other PS2 software.
As your friend mentioned, HDLoader does not use any normal file handling for installed games, which are instead stored with a separate partition for each complete game disc. That partition is then accessed through the CDVD emulation driver of HDLoader (or the homebrew "Open PS2 Loader") as if the sectors of that HDD partition were in fact sectors of the original game DVD disc.
One odd consequence of this usage, which sharply contrasts to any normal HDD usage of a PC, is that a PS2 HDD used for HDLoader frequently has a very large number of partitions, sometimes several hundred... But personally I try to avoid having that many as it leads to considerable delay whenever needing to renew the game list files.
Best regards: dlanor