PS3 libnfs/liborbisNfs ps3 port (PSL1GHT)

bucanero

Developer
I was digging around the PS4 homebrew scene for some future projects, and I found that they had a NFS client library. ;)
NFS (network file system) is widely used in the Linux/Unix family, and it's an easy way to share files across devices, so I thought... why we don't have this on the PS3? :)

So, based on the PS4 port of libnfs, I made a port of this library to the PS3 :cool:

you can find libnfs here:
https://github.com/sahlberg/libnfs

to build and install:
Code:
make -f ps3_ppu/Makefile.PS3_PPU install

and the ps3 port of liborbisNfs is here:
https://github.com/bucanero/libnfs-ps3

I need to update the docs, and add some example code to the repo so it can be used in other projects

I did some quick tests and I can confirm that it worked fine: from my homebrew psl1ght app I was able to connect to my NFS server, and read a file successfully. :)

stay tuned :D
 
Last edited:
I've updated the Github repo with some proper docs and a basic example:
https://github.com/bucanero/libnfs-ps3

In the docs you'll also find how to properly configure a NFS server to share your files on Linux(Ubuntu) and macOS.

About the example:
  • lists the available exports on a server (IP address)
  • mounts a folder
  • opens a file "test.txt"
  • reads the file and print the contents
  • close file & connection
As a full-featured example, I'm thinking about adding NFS support to PS3LoadX. :sco hmmthink: In that scenario, the ps3loadX app should list all the .SELF's available in the nfs server, and then the user would select one and launch the binary remotely.

I think it would be a nice exercise... instead of building a complex example, actually put the code to some good use and bring a new feature to a real app. :)
 
@bucanero

Thanks for your continued work providing the community with additional ported libs to ease development with psl1ght.

This is not a request but merely a suggestion for some libraries to add to psl1ght IF EVER you felt like giving them a go some day.
Some of these ports might be harder than others to accomplish but you already know that... ;-)

1. A smb client library (there are a few out there, libsmb++, libsmb2, libdsm,...)

2. Boost, at least the core lib (there is an old boost library in the official sdk ie COLLADA sample with its source if needed)

3. pcre or another regex lib (like boost, you may find the source for the pcre lib used in the COLLADA sample in the official sdk if it helps).

And optionally:

4. libvlcpp (not sure how easy this will be to port though)

5. Simd for altivec/vmx enhanced image processing (https://github.com/ermig1979/Simd)
 
Last edited:
@bucanero

Thanks for your continued work providing the community with additional ported libs to ease development with psl1ght.
:D thanks @bguerville ! :encouragement:

This is not a request but merely a suggestion for some libraries to add to psl1ght IF EVER you felt like giving them a go some day.
Some of these ports might be harder than others to accomplish but you already know that... ;-)

1. A smb client library (there are a few out there, libsmb++, libsmb2, libdsm,...)

actually, about SMB, since I was looking into sahlberg's libnfs, I also checked his libsmb2.
I was able to port the library and compile it on PS3 (psl1ght), but in the tests I tried, I couldn't connect properly with Windows Xp or Win7 smb shares. :(
Since I haven't used windows in ages, I'm not sure if it's a problem with the library or just my lack of knowledge about setting a SMB share and stuff.

For example, when I tried to list smb shares, I've got:
WinXp: Failed to connect to IPC$. Timeout expired and no connection exists
Win7: Failed to connect to IPC$. Session setup failed with (0xc000000d) STATUS_INVALID_PARAMETER.

So, in this case the same test function to list shares gets different results depending on the SMB server... probably getting Wireshark to capture some packets would help to understand the situation better, but for now I prefer to continue with other projects.

Anyways, I think it's probably some small bug either in the library port or in how the library should be used with the SMB setup.
If there's any developer eager to jump, review it, and fix it, I can make a repo and upload my changes.

cheers!
 
Last edited:
For example, when I tried to list smb shares, I've got:
WinXp: Failed to connect to IPC$. Timeout expired and no connection exists
Win7: Failed to connect to IPC$. Session setup failed with (0xc000000d) STATUS_INVALID_PARAMETER.

@bucanero thank you for your work, SMB support would be really nice, maybe a SMB network share could even be implemented as a "native drive" on PS3 :smug:, SMB2 and up support symbolic links, but I digress hehe, in windows xp SMB2 it's not supported and that's the minimum supported by libsmb2, so that's why it shows that error, on windows 7 it is supported but I have seen that this may be caused by an SMB protocol mismatch. You can specify the SMB protocol version to SMB2 or try SMB3 with a windows 10 one.

I hope it helps, Cheers!
 
SMB2 might be a bad choice if its protocol is not supported natively by older Windows.
Imho a SMB library for psl1ght should offer Windows support at least from XP up.
 
@bucanero in windows xp SMB2 it's not supported and that's the minimum supported by libsmb2, so that's why it shows that error, on windows 7 it is supported but I have seen that this may be caused by an SMB protocol mismatch. You can specify the SMB protocol version to SMB2 or try SMB3 with a windows 10 one.

I hope it helps, Cheers!

oh good to know, that explains the issue with the old version of windows.
It should work with windows 7 then. But right now it fails to establish the connection with that invalid parameter error.

Yes if a developer wants, such library could be added to a file manager and you could browse your files just like another drive.
 
SMB2 might be a bad choice if its protocol is not supported natively by older Windows.
Imho a SMB library for psl1ght should offer Windows support at least from XP up.

I saw that they're trying to add the libsmb2 library to the PlayStation 2 OPL:
https://github.com/ps2homebrew/Open-PS2-Loader/issues/86

Not sure if they're supporting the old protocol version or not. Perhaps they're mixing it with some other code for version 1 support
 
Last edited:
I saw that they're trying to add the library to the PlayStation 2 OPL

Not sure if they're supporting the old protocol version or not. Perhaps they're mixing it with some other code for version 1 support
Why not use libdsm by videolabs?
It's a minimalist SMBv1 implementation but sometimes, less is more if you know what I mean...
It lets you read/write/delete files & browse folders on most systems.
I don't think locks & RPC have been added yet but it was planned.
SMBv1 is not the most secure smb version either but it should do for the PS3.

Movian uses a SMBv1 implementation as well (with RPC support afaik). I suppose a library could be made with those movian source files.
 
well, now the libsmb2 port to the PS3 is fixed and working :)

I had to share some packet captures with the lib developer so we could figure out the bug. Actually the library was never tested in big-endian platforms, so there was some small miss-conversion in the unicode.c string utilities.
All was working except the path conversion to unicode, and that's why the server was answering with INVALID_PARAMETER

I know this libsmb2 doesn't support SMB v1 but everything from Windows Vista+ should be supported.

I'll post a new thread with the information and links
 
well, now the libsmb2 port to the PS3 is fixed and working :)

I had to share some packet captures with the lib developer so we could figure out the bug. Actually the library was never tested in big-endian platforms, so there was some small miss-conversion in the unicode.c string utilities.
All was working except the path conversion to unicode, and that's why the server was answering with INVALID_PARAMETER

I know this libsmb2 doesn't support SMB v1 but everything from Windows Vista+ should be supported.

I'll post a new thread with the information and links

Excellent @bucanero :pride:
It would be great if someone makes a system plugin with this..:cool2:
 
My changes have been merged to the original library, so now you can get libsnfs directly from the original repo. :)
I'll clean up my "libnfs-ps3" repo and I'll leave only the port of liborbisNfs. For libnfs I'll just leave a link to https://github.com/sahlberg/libnfs

it would be great if someone makes a system plugin with this..:cool2:

.sprx modules can only be created with the original SDK, and I prefer to remain on the open-source PSL1GHT domain. I'm pretty sure the library can be adjusted to compile with original sdk, but that's out of my scope for now.
 
Back
Top