PFS Shell

PS2 PFS Shell - manage APA partitions and PFS filesystems on the command line v1.1.1

uyjulian

Developer
I have created an updated version of pfsshell which allows you to manage APA partitions and PFS filesystems on the command line. It uses up-to-date APA and PFS code from ps2sdk which has less bugs than the original version.

Direct disk access is supported on Windows, macOS, and Linux. On Windows, you can list disks by using "wmic diskdrive list". On macOS, you can list disks by using "diskutil list". On Linux, you can list disks by using "lsblk".

Please do not run pfsshell as superuser or root. Instead, you can give permission for programs to read/write under your account by using this command: "sudo chmod a+rw /path/to/disk"

Releases: https://github.com/uyjulian/pfsshell/releases
Source code: https://github.com/uyjulian/pfsshell
 
Last edited:
Instead of a GUI, I'm thinking of writing a FUSE driver, so you can use your existing file managers like Windows Explorer or Nautilus to manage the partitions.

Wow, it'll even better...

I have no words to express my gratitude for you...
But i can start with:
Thank You very much. o/
 
Honestly, it'd be quite cool if there were a way to have at least a PFS installable file system for Windows. It'd require a partition scan upon loading the driver (unless there would be some way to cache the scan results yet detect changes) but it would help very much with copying files to PFS partitions, or creating new ones. As long as it's pretty intelligent about creating "split" PFS partitions (pfsshell can only create power-of-two partitions, and uLE last I checked still has issues creating partitions if your drive is fairly fragmented).
 
Instead of a GUI, I'm thinking of writing a FUSE driver, so you can use your existing file managers like Windows Explorer or Nautilus to manage the partitions.

Absolutely brilliant idea!

I remember in very old times something similar for XFAT but it's dead now with kernel 2.6.x.
 
I'm trying to compile pfsshell on FreeBSD. The function _start in iomanX.c is troublesome as it conflicts with /usr/lib/crt1.o. Having _start commented out, pfsshell builds. Is this function really never being called?
 
I'm trying to compile pfsshell on FreeBSD. The function _start in iomanX.c is troublesome as it conflicts with /usr/lib/crt1.o. Having _start commented out, pfsshell builds. Is this function really never being called?

You can rename _start to iomanX_start.
 
This looks really great - especially that you are fixing some Mac issues
Did you make any progress yet regarding the FUSE integration?
I was also thinking about doing something in this direction, but unfortunately I'm already stuck about how to handle the different partitions (hdldump/normal pfs).
A general idea would be to handle the complete (raw) drive as mount device and represent the game partitions as ISO or as a special file descriptor.
In the Open/Write operation this would need to be encapsulated, so in case an ISO is written, the necessary logic needs to be done with hdl.
Those are just my thoughts on it, I also don't have much experience with FUSE besides some tutorials...
 
This looks really great - especially that you are fixing some Mac issues
Did you make any progress yet regarding the FUSE integration?
I was also thinking about doing something in this direction, but unfortunately I'm already stuck about how to handle the different partitions (hdldump/normal pfs).
A general idea would be to handle the complete (raw) drive as mount device and represent the game partitions as ISO or as a special file descriptor.
In the Open/Write operation this would need to be encapsulated, so in case an ISO is written, the necessary logic needs to be done with hdl.
Those are just my thoughts on it, I also don't have much experience with FUSE besides some tutorials...
I haven't written any code yet.

I was thinking of either of the following:
1. writing a APA FUSE driver
2. writing a program that uses libdevmapper to map the partitions to block devices
then I would write a separate PFS FUSE driver which will point to the partitions. ext2 and ReiserFS (murderer's FS; out-of-tree filesystem) filesystems would also be able to be mounted by the Linux kernel.
#2 would probably provide faster performance than #1, but it would only work on specific OSes like Linux, and it would probably not work on non-512 block size storage devices.
I'm not really sure how the HDL partitions are formatted, but if they are ISO filesystems, I think you can just give it straight to the Linux kernel and it will mount it.

Managing APA filesystems and creating HDL partitions are special non-filesystem-based operations, so a special tool similar to hdl_dump, gparted, or kpartx would be needed.
 
I'm not really sure how the HDL partitions are formatted, but if they are ISO filesystems, I think you can just give it straight to the Linux kernel and it will mount it.

For such a thing, the user data portion of the APA partition is ISO9660. However, an installation can have multiple partitions (1 main and up to 64 sub-partitions). So your game will not be in 1 piece.

For sub-partitions, the first 2 sectors are reserved, leaving 1KB of internal fragmentation. I don't know what HDLoader does, but I assume everybody is keeping this 1KB of internal fragmentation towards the end of the partition.
 
I cannot compile it: :(
Code:
mint@mint ~/Downloads/pfsshell-master $ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609

mint@mint ~/Downloads/pfsshell-master $ sudo make
make -C iomanX
make[1]: Entering directory '/home/mint/Downloads/pfsshell-master/iomanX'
-e    CC  iomanX.c
iomanX.c: In function 'AddDrv':
iomanX.c:77:9: warning: unused variable 'oldIntr' [-Wunused-variable]
  int oldIntr;
  ^
iomanX.c: In function 'get_new_file':
iomanX.c:181:9: warning: unused variable 'oldIntr' [-Wunused-variable]
  int oldIntr;
  ^
In file included from iomanX.c:20:0:
iomanX.c: At top level:
../fake_sdk/include/iomanX.h:113:17: error: conflicting types for 'iomanx_lseek64'
 #define lseek64 iomanx_lseek64
  ^
iomanX.c:570:11: note: in expansion of macro 'lseek64'
 long long lseek64(int fd, long long offset, int whence)
  ^
../fake_sdk/include/iomanX.h:113:17: note: previous declaration of 'iomanx_lseek64' was here
 #define lseek64 iomanx_lseek64
  ^
../fake_sdk/include/iomanX.h:184:5: note: in expansion of macro 'lseek64'
 s64 lseek64(int fd, s64 offset, int whence);
  ^
../Defs.mak:15: recipe for target 'iomanX.o' failed
make[1]: *** [iomanX.o] Error 1
make[1]: Leaving directory '/home/mint/Downloads/pfsshell-master/iomanX'
Makefile:40: recipe for target 'iomanX/libiomanX.a' failed
make: *** [iomanX/libiomanX.a] Error 2
 

Similar threads

Back
Top