PS3 Exfat Support

My notes:

Using gcc 7.2.0 I had no issues building the source , without any modifications. Unzip, add a Makefile from PSL1GHT and make. (just edited the ffconf.h to enable exFAT and set the file system to read-only)

Code:
linking ... ff14.elf
/usr/local/ps3dev/ppu/lib/gcc/powerpc64-ps3-elf/7.2.0/../../../../powerpc64-ps3-elf/lib/lv2-crt0.o: In function `._initialize':
(.text._initialize+0x24): undefined reference to `.main'
diskio.o: In function `.disk_status':
diskio.c:(.text.disk_status+0x20): undefined reference to `.USB_disk_status'
diskio.c:(.text.disk_status+0x48): undefined reference to `.RAM_disk_status'
diskio.c:(.text.disk_status+0x70): undefined reference to `.MMC_disk_status'
diskio.o: In function `.disk_initialize':
diskio.c:(.text.disk_initialize+0x20): undefined reference to `.USB_disk_initialize'
diskio.c:(.text.disk_initialize+0x48): undefined reference to `.RAM_disk_initialize'
diskio.c:(.text.disk_initialize+0x70): undefined reference to `.MMC_disk_initialize'
diskio.o: In function `.disk_read':
diskio.c:(.text.disk_read+0x30): undefined reference to `.USB_disk_read'
diskio.c:(.text.disk_read+0x60): undefined reference to `.RAM_disk_read'
diskio.c:(.text.disk_read+0x90): undefined reference to `.MMC_disk_read'
collect2: error: ld returned 1 exit status

The only pending stuff is to actually implement and link the PS3 side (USB_disk_initialize , USB_disk_status , USB_disk_read)

I'm still working on the PS3 save tool, so @tps will probably solve this before I can look into it

do you have your code somewhere so I can take a look and contribute there?
btw, I'm using the standard open source PSDK3v2
 
do you have your code somewhere so I can take a look and contribute there?
btw, I'm using the standard open source PSDK3v2

Sure, I'll create a repo on GitHub for the exfat lib project and upload the files there.

btw, I think that the PSDK3v2 uses an older gcc compiler (something like gcc 4.x.x , and that's why you had issues with the 'C99' settings)
 
Sure, I'll create a repo on GitHub for the exfat lib project and upload the files there.

btw, I think that the PSDK3v2 uses an older gcc compiler (something like gcc 4.x.x , and that's why you had issues with the 'C99' settings)
gcc --version
gcc (GCC) 4.5.2

what SDK are you using?
 
gcc --version
gcc (GCC) 4.5.2

what SDK are you using?

here's the GitHub repo:
https://github.com/bucanero/fatfs-ps3

(as noted, it's the original source, plus a Makefile and the flag settings on ffconf.h )

I'm using the open-source psl1ght sdk, but I built it myself from sources. :)
I'm on macOS, so I had to build the ps3 toolchain and psl1ght libs from scratch .
 
Last edited:
I'm also on mac but using Windows VM to accelerate things :) could you share your mac SDK too?

oh, you're using macOS too, that's good! I wrote a tutorial to build your own dev environment on macOS:
http://www.bucanero.com.ar/2019/08/14/building-your-ps3-dev-environment-on-macos/

the guide should be simple to follow and you'll get everything working natively on macOS.
If something doesn't work or have an issue, just ping me in this thread: https://www.psx-place.com/threads/guide-build-a-ps3-toolchain-on-macos.25702/

let me know if you've questions
cheers
 
oh, you're using macOS too, that's good! I wrote a tutorial to build your own dev environment on macOS:
http://www.bucanero.com.ar/2019/08/14/building-your-ps3-dev-environment-on-macos/

the guide should be simple to follow and you'll get everything working natively on macOS.
If something doesn't work or have an issue, just ping me in this thread: https://www.psx-place.com/threads/guide-build-a-ps3-toolchain-on-macos.25702/

let me know if you've questions
cheers

I was trying your tutorial but I got an error.

meanwhile I continued with exfat and since I had started my own I kept updating it here https://github.com/lmirel/Gamesonic-Manager/tree/dev/fatfs/ff14
I wrote the read function but is not working great and now I need some sleep
 
exfat for now fails on init.
functions like sys_storage_get_device_info and sys_storage_open fail gracefully.
is there anything I need to do to enable that functionality?
 
exfat for now fails on init.
functions like sys_storage_get_device_info and sys_storage_open fail gracefully.
is there anything I need to do to enable that functionality?
Take a look at how is made in ManaGunZ main.c
https://github.com/Zarh/ManaGunZ/blob/master/MGZ/source/main.c

Line 9549
Code:
s32 sys_storage_open(u64 device_ID, u32* fd)
{
	lv2syscall4( 600, device_ID, 0, (u64)fd, 0 );
	return_to_user_prog(s32);
}

Line 9573
Code:
s32 sys_storage_get_device_info(u64 device_id, device_info_t *device_info)
{
	lv2syscall2( 609, device_id, (u64)device_info );
	return_to_user_prog(s32);
}

I cant help further with this though, the best who can explain how that functions works in ManaGunZ is @Zar
 
thanks, these I have from storage.h but they return an error in my simple test prog.
my guess is I need to enable these syscalls somehow so they can do the work.
this is what I'm missing now for ease with testing.
the calls work fine when used in any manager because these already enable the syscalls somehow.
 
Try to add in makefile this :
SCETOOL_FLAGS += --self-ctrl-flags 4000000000000000000000000000000000000000000000000000000000000002
SCETOOL_FLAGS += --self-cap-flags 00000000000000000000000000000000000000000000007B0000000100000000

Maybe it will fix your issue.
 
I've built the toolchain and psl1ght libs in a couple of Macbooks with no issues; if you want post the error and I'll check, it's probably a simple thing.
(perhaps the update from Mojave to Catalina changed something)
I'm still on Mojave

LIB_PATH='' /bin/sh ../../ld/genscripts.sh "../../ld" "/usr/local/ps3dev/ppu/lib" "/usr/local/ps3dev/ppu" "/usr/local/ps3dev/ppu" x86_64-apple-darwin18.7.0 powerpc64-ps3-elf powerpc64-ps3-elf "│·············
elf64ppc" "/usr/local/lib /lib /usr/lib" no no elf32ppc "powerpc-ps3-elf" │·············
rm -f ar.pod │·············
LIB_PATH='' /bin/sh ../../ld/genscripts.sh "../../ld" "/usr/local/ps3dev/ppu/lib" "/usr/local/ps3dev/ppu" "/usr/local/ps3dev/ppu" x86_64-apple-darwin18.7.0 powerpc64-ps3-elf powerpc64-ps3-elf "│·············
elf64ppc" "/usr/local/lib /lib /usr/lib" no no elf32ppclinux "powerpc-ps3-elf" │·············
../../../binutils/doc/binutils.texi:4272: warning: @itemx should not begin @table │·············
../../../binutils/doc/binutils.texi:4280: @itemx must follow @item │·············
../../../binutils/doc/binutils.texi:4284: @itemx must follow @item │·············
../../../binutils/doc/binutils.texi:4290: @itemx must follow @item │·············
../../../binutils/doc/binutils.texi:4294: @itemx must follow @item │·············
../../../binutils/doc/binutils.texi:4304: @itemx must follow @item │·············
../../../binutils/doc/binutils.texi:2341: warning: node next `ranlib' in menu `readelf' and in sectioning `size' differ │·············
../../../binutils/doc/binutils.texi:2394: warning: node prev `size' in menu `readelf' and in sectioning `ranlib' differ │·············
../../../binutils/doc/binutils.texi:2618: warning: node next `strip' in menu `elfedit' and in sectioning `c++filt' differ │·············
../../../binutils/doc/binutils.texi:3124: warning: node next `nlmconv' in menu `windres' and in sectioning `windmc' differ │·············
../../../binutils/doc/binutils.texi:3229: warning: node next `windmc' in menu `dlltool' and in sectioning `windres' differ │·············
../../../binutils/doc/binutils.texi:3229: warning: node prev `windmc' in menu `windres' and in sectioning `nlmconv' differ │·············
../../../binutils/doc/binutils.texi:3390: warning: node next `windres' in menu `windmc' and in sectioning `dlltool' differ │·············
../../../binutils/doc/binutils.texi:3390: warning: node prev `windres' in menu `nlmconv' and in sectioning `windmc' differ │·············
../../../binutils/doc/binutils.texi:3584: warning: node next `dlltool' in menu `Common Options' and in sectioning `readelf' differ │·············
../../../binutils/doc/binutils.texi:3584: warning: node prev `dlltool' in menu `windmc' and in sectioning `windres' differ │·············
../../../binutils/doc/binutils.texi:3978: warning: node next `readelf' in menu `size' and in sectioning `elfedit' differ │·············
../../../binutils/doc/binutils.texi:3978: warning: node prev `readelf' in menu `ranlib' and in sectioning `dlltool' differ │·············
../../../binutils/doc/binutils.texi:4232: warning: node next `elfedit' in menu `c++filt' and in sectioning `Common Options' differ │·············
../../../binutils/doc/binutils.texi:4232: warning: node prev `elfedit' in menu `strip' and in sectioning `readelf' differ │·············
../../../binutils/doc/binutils.texi:4326: warning: node prev `Common Options' in menu `dlltool' and in sectioning `elfedit' differ │·············
gmake[3]: *** [Makefile:351: binutils.info] Error 1 │·············
gmake[3]: Leaving directory '/Volumes/extended/Work/ps3/ps3toolchain/build/binutils-2.22/build-ppu/binutils/doc'
 
just a quick check, have you executed Xcode for the first time and let it install the tools/dependencies ?
do you have brew and installed the required libs?

weird, I don't see a specific error there, only some warnings in the "/docs" folder for binutils :confused3:

and (just to double check), have you tried running the script again? retrying to see if the same error shows up
Code:
cd ps3toolchain
./toolchain-sudo.sh
 
just a quick check, have you executed Xcode for the first time and let it install the tools/dependencies ?
do you have brew and installed the required libs?

weird, I don't see a specific error there, only some warnings in the "/docs" folder for binutils :confused3:

and (just to double check), have you tried running the script again? retrying to see if the same error shows up
Code:
cd ps3toolchain
./toolchain-sudo.sh
these seem to be errors related to documentation tools.
../../../binutils/doc/binutils.texi:4280: @itemx must follow @item │·············
../../../binutils/doc/binutils.texi:4284: @itemx must follow @item │·············
../../../binutils/doc/binutils.texi:4290: @itemx must follow @item │·············
../../../binutils/doc/binutils.texi:4294: @itemx must follow @item │·············
../../../binutils/doc/binutils.texi:4304: @itemx must follow @item │·············

I tried several times and I might have to start over. I'll let you know.
 
these seem to be errors related to documentation tools.
../../../binutils/doc/binutils.texi:4280: @itemx must follow @item │·············
../../../binutils/doc/binutils.texi:4284: @itemx must follow @item │·············
../../../binutils/doc/binutils.texi:4290: @itemx must follow @item │·············
../../../binutils/doc/binutils.texi:4294: @itemx must follow @item │·············
../../../binutils/doc/binutils.texi:4304: @itemx must follow @item │·············

I tried several times and I might have to start over. I'll let you know.

weird, I've just tried to build binutils-2.22 again with the stock configs, using the scripts on my Github links and I had no issues or errors with the doc tools.

if you have time to try (and isolate the issue), I'd suggest running this script alone, and see how it goes:
Code:
https://github.com/bucanero/ps3toolchain/blob/master/scripts/001-binutils-PPU.sh

perhaps skipping these config updates in the build script ends up working better:
Code:
  ## Download an up-to-date config.guess and config.sub
  if [ ! -f config.guess ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.guess; fi
  if [ ! -f config.sub ]; then wget --continue http://git.savannah.gnu.org/cgit/config.git/plain/config.sub; fi
 

Similar threads

Back
Top