-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A nbd client instead of custom piece #415
Conversation
@bignaux Dont forget to run |
Hi @bignaux , I see you're making great progress on your NBD server project.
That's a great idea. I see you've already created a standard interface to the block devices: I've been working on block devices for a long time (usbmass_bd, IEEE1394_bd, mx4sio_bd), all using a standard block device interface: struct block_device. Note how similar these two interfaces are. I think an NBD -> BDM_block_device implementation would be great for accessing all BDM based block devices from a PC. From Linux you can mount NBD devices, and use them as if they are local hdd. But this does require Linux to know the file system that is used on the PS2. So for USB, IEEE1394 and mx4sio this would be easy, as they all use fat32. But for the HDD, you'll need to know PFS, so special tools (or a linux PFS file system driver) are required.
I do too ;). EDIT: PR changed to draft becouse its still a work in progress. |
@AKuHAK : I just posted there to try to get help for the read issue, it was not really an attempt to get things merge. Btw, i'd like to keep for example nbd-protocol.h as verbatim (nbdkit reference). @rickgaiser : i'm active contributor on pfsshell & hdl_dump . We need this kind of server on the new toolchain ( see ps2homebrew/hdl-dump#33 ). I hope this non-platfom specific server will find its user outside PS2 world, RPI pico for example use LWIP stack and could enjoy NBD to export usb mass storage instead of an heavier protocol. Concerning my issue, that's a view of first 50MB of my hdd, compare from localdump and netdump. bad block in red (using jessek/colorize) reproduice :
|
Thanks to @rickgaiser , the bug was found and now READ is fixed. Let's go on WRITE. |
I think we have something mergeable now, please test and review. |
I've tested the NBD server. From linux I can access the PS2 internal hdd, using nbdfuse. With nbdfuse I can access the drive (blocks of data) but I cannot access the files. I remember you saying you transferred a game, what tools can I use to transfer games to/from hdd using NBD? The speed is currently around 950kb/s. So transferring a 4GB game would require more than 1 hour. Filling a 2TB drive would require 23 days... I hope this can be increased a lot, becouse I'm not that patient ;-). The lwIP stack can do at least 4MB/s, some have gone to 6MB/s but I think that's with UDP (not TCP). Anyway, for this PR to be approved it only needs to be usable, not fast. So if there's some client users can use to transfer games then I think it's ready for merge. |
hdl_dump and pfsshell could be used on the exposed block device… |
Yeah it's slow to copy an entire collection of save games. But that's not the only purpose of such server. I'm writing an OPL manager tool, to have multi-platform batcher, you can see an example of script to update cover https://gist.github.com/bignaux/49259df0a9bb99e964891f9e62f7af8b#file-opl-update-art . Someone is working on the mc driver for NBD, and most are 8MB ... I'll use nbd to expose some part of the hdd (with dmsetup) and can format it with mkfs and use it as a NAS ... For now, it's only a replacement of hdldsvr and hdl-dump server, and that's already good to close a bunch of bugs. |
Great! I'm looking forward to all new possibilities this will bring. |
Thank you! |
Replace broken HDL server with NBD server
Replace broken HDL server with NBD server
I still not able to do a proper read but i've not error when i use a fake read like in hdd_fake driver.
Since i get no answer on #410, i take the roomspace of incomplete hdldsvr to write this prototype.
I'd like to publish lwNBD in upstream LWIP, so i choose same licence as there.
There rooms for improvement of course, and performance gain could be done via completing the protocol, like trim option NBD_CMD_WRITE_ZEROES ... ) , rewrite as a non-blocking event loop and so.
I really think this kind of standardized server would be a great enhancement and fun place for next development.
Pull Request checklist
Note: these are not necessarily requirements
Pull Request description