ps2dev / ps2sdk

Homebrew PS2 SDK
Other
954 stars 133 forks source link

SMB Version 1 deprecation / upgrade to SMB Version 2 #72

Open Arawn-Davies opened 6 years ago

Arawn-Davies commented 6 years ago

Hey, figured I ought to get into PS2 development after using homebrew for quite some time and developing for other stuff but not PlayStation 2. I've noticed many threads and questions floating about the internet regarding Open PS2 Loader and other PS2 homebrew applications that are still dependent on SMB version 1, which has been phased out and removed from operating systems such as new builds of Windows 10, Windows Server, and various *nix OSes.

These OSes are using implementations of SMB versions 2/3, so I'm wondering how difficult it would be to get at least SMB v2 working on the PS2, in terms of both coding difficulty, compatibility with the IOP and what performance cost (if any) there would be

I don't mind helping out where I can, I'm new to PS2 development but not new to programming (C++, C# and others) :)

Arawn-Davies commented 6 years ago

I can't find much lower-level documentation of SMB version 2 (didn't figure there'd be much to be honest), yet alone documentation of the protocol itself, but I was able to find this, not sure how useful it would be though:

https://wiki.wireshark.org/SMB2

sp193 commented 6 years ago

You may find information on the SMB2 protocol here: https://msdn.microsoft.com/en-us/library/cc246482.aspx It's just a different protocol. I don't know what sort of resources it will cost, but it should be acceptable. You should try to do some research on this before beginning on such a project.

You may be able to use some code from existing implementations. But code that was made for Linux might have been tightly coupled with the Linux OS, and may be challenging to work with. You can refer to the existing driver (SMBMAN) for ideas. The PlayStation 2 should have well-designed code written for it, especially for IOP modules that go into the SDK that everybody uses. The IOP is a 36.8MHz chip with only 2MB of memory, so keeping your code as simple as possible is also better for performance.

TnA-Plastic commented 6 years ago

On another note: It might be worth it, to wait for @Maximus32 's BDM ('Block Device Manager') to be more 'stable'/evolved (or possibly you can even help out there)!

This would shrink the following development to the bare protocol, or atleast a bit less than now.

Edit: It would be worth it for OPL at least, IMO.

rickgaiser commented 6 years ago

Sorry but no, BDM is located between de block devices (like usb/hdd/ilink) and the file systems (like fat32/ext2).

smb is not a block device, but a (network) file system. There are also protocols for block devices over a network (like NBD), those can use BDM, but network filesystems like ftp/smb cannot.

TnA-Plastic commented 6 years ago

THX for the answer!

Well... It might still give him a hint, where he could gather some interest in. ;)

sp193 commented 5 years ago

I have started work on one, since it doesn't seem like anybody is. It will be done when I can.

sahlberg commented 4 years ago

I have added PS2 support to my libsmb2 client library. It is currently kept in the ps2 branch but will eventually merge it into master once I have tested it more.

https://github.com/sahlberg/libsmb2/tree/ps2

libsmb2 is a highly portable, small footprint, high performance smb2/3 client that runs on almost anything that has berkley socket support. Maybe fork libsmb2 and add it into ps2sdk, replacing the smb1 client ? If anyone wants to test it out, please do. It needs as much mileage as possible for testing on the ps2 platform.