ps3-memorycard-adapter
ps3-memorycard-adapter copied to clipboard
Allow graceful exit if adapter is not found or permission is denied
Thanks for this patch and pointing out the issue it addresses. Reviewing it, I realised the code was poorly structured and easy to improve, which then makes the change simpler. I pushed these improvements to master.
Unfortunately this conflicts wit your patch.
I can push the remaining part of your change with you as author if you like, or you can resolve the conflicts. Let me know which you prefer.
Hi, it's upto you. I'm still not very proficient with all the intricacies of git, though. I do plan on contributing at least a couple more commits to this project, and especially since I haven't been able to get it to work for me yet (I'm still trying to figure out the nbd stuff for example).
I'm guessing you are familiar with some of the other memory card projects out there like https://github.com/raphnet/psxmemcardmgr (but I think that only does ps1 cards, and via a serial port, not the usb adapter that I have here).
I'd love to see a turnkey solution for my ps1/ps2 memory card management with a gui and just one command to be run. Apparently the Datel DataMAX usb adapter used to include software for windows that allowed for access and reformatting of ps2 memory cards, but I haven't been able to find the software yet (plus, I run linux here, not windows). In case any of that is useful for you.
Hi, it's upto you. I'm still not very proficient with all the intricacies of git, though.
I went ahead and pushed the remaining part. I modified it a bit to also cover the case where the device could be listed but not opened (typically: user access forbidden by OS).
I do plan on contributing at least a couple more commits to this project, and especially since I haven't been able to get it to work for me yet (I'm still trying to figure out the nbd stuff for example).
I think I need to give more context to this project.
I started this project back when I bought the official USB memory card reader, because I wanted to backup my memory cards, including my PS2 ones. I believe there was no such project back then (all were limited to PS1), and AFAIK nowadays there is one project which implemented the PS2 card authentication but was promptly DMCA'ed off github.
My intent for the layout of this project was to follow what I would call a unix approach: "small is beautiful", so I split the overall feature in 2 layers:
- a block device driver, to get to the raw card data
- a (pair of) filesystem drivers, to present the raw card data as a file tree usable by any file manipulation tool
I wanted both layers to behave as unsurprisingly to a unix user as possible, so I wanted a way to expose the block device as a device node. This is why I chose NBD: it allowed to have a userland process implement the hardware-specific I/O, and get the kernel to connect to it and expose a block device. Plus libusb to also talk to the device from userland.
So the end result is a daemon implementing the NBD protocol and using libusb to interface with the hardware (plus the authentication wart for the PS2 card dance), and a very basic FUSE implementation for the filesystem (which only implements the PS1 filesystem, and I have still not gotten around to properly test write support). This means that the user must have several elevated accesses: access to the USB device of course, but also running nbd-client
and then running the fuse implementation. All the while restricting the possible user base to *nix users (I guess not many OS have NBD server-side and FUSE support).
So I do not know if this project is the best choice for a turn-key solution.
If you are still reading, here are the more recent news and the general direction I would like this project to take.
I revived this project recently as I discovered the NBD protocol version I implemented is dead and burried, and sadly the current protocol is way more complex. I got the code back to a working state, but there is a lot to do before this project could be user-friendly:
- detect and signal memory card change (probably requires failing all NBD requests, which requires the client to detach and reattach)
- add a functionfs-based authenticator, to stop requiring a homebrew-enabled PSP to do the authentication dance
- probably rework both network implementations to use non-blocking IO and (for the authenticator) some standard protocol and implementation (using socket
recv
andsend
is not nice) - doing all the filesystem work for the PS2 filesystem
Also, my PS2's disc drive is getting cranky, so I am tempted to get an alternative way to play games on it. I have not looked much into this yet, but my understanding is that I need freemcboot and I guess it could run stuff off of a USB drive... Getting freemcboot on the card would be a task I would use this project for.
Awesome! Thank you for the extra info. Honestly, I too just want to be able to backup (and restore) my gamesaves somehow (especially off a 64MB ps2 memory card I have that the ps3 doesn't seem to be able to read).
I still don't know how to run this on my machine though, the nbd stuff is tripping me up. I get the feeling that the README might be missing a step or two that I need. Any help with that would be greatly appreciated.
about nbd, you could look my server @ https://github.com/bignaux/lwNBD/ . It runs on Playstation 2 and have MC plugin ( see https://github.com/bignaux/lwNBD/blob/main/plugins/mcman/lwnbd-mcman-plugin.md ).