Skip to content
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

Feature request: Make it possible to mount filesystems through gw #498

Open
mattarroz opened this issue Oct 12, 2024 · 4 comments
Open

Feature request: Make it possible to mount filesystems through gw #498

mattarroz opened this issue Oct 12, 2024 · 4 comments

Comments

@mattarroz
Copy link

First of all, thanks for this great project! I'm using the greaseweazle to debug a broken Atari ST floppy drive.

However, I wonder if it is possible to write individual files to a floppy using the greaseweaszle. I know I can mount a filesystem image, copy files to it, unmount it and then rewrite the image to a floppy. But is it really necessary to write an entire image? Can't I just write individual files?

Under linux, this could be realized with a greaseweazle kernel driver, with a combination of mtools+gw or maybe by using pyfuse3+gw, I guess.

@keirf
Copy link
Owner

keirf commented Oct 12, 2024

There is a tool called disk flashback for windows, by Rob Smith. Noone has implemented this for Mac or Linux however.

@mattarroz
Copy link
Author

mattarroz commented Oct 13, 2024

Here is a rough sketch of how this could work:

fusefatfs and DiskFlashback are both based on the fatfs library. DiskFlashback uses Dokany as a drive virtualization mechanism, whereas fusefatfs is using FUSE, compatible with many platforms (Linux, MacOS and even Windows). So by adapting Rob Smith's GreaseWeazleInterface.cpp to interface with fusefatfs.c, this could potentially work... at least for FAT based file systems.

I don't have time to try this very soon, unfortunately.

@keirf
Copy link
Owner

keirf commented Oct 13, 2024

Definitely it could work, as DiskFlashBack is based on a Windows version of FUSE. We could consider Rob's project a curated set of filesystem backends. However I too am unlikely to take this on any time soon.

@mattarroz
Copy link
Author

Even though I had more than enough TODOs this afternoon, I could not resist hacking something together:
https://github.com/mattarroz/gwmount

I used fusefatfs as a basis, but replaced the disk_read, disk_write, etc functions declared in diskio.h with the implementations provided by Rob's DiskFlashback. There are some places where he is using windows APIs which needed equivalent POSIX/Linux implementations. In the future, maybe these fixes could be merged into DiskFlashback using #ifdefs for linux or so. Then I linked his floppybridge that directly talks to the Greaseweasle. The entry from fusefatfs to DiskFlashback is here. Not sure about that.

I did not test it yet, however it compiles and links successfully. There may be errors in my quick and dirty approach, anyone should feel free to fix or improve the code.

With pyfuse3 then maybe one could use shared libraries built from Diskflashback to provide a gw mount command. Alternatively one could create a python interface for fusefatfs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants