Hey, all.
This is sort of related to Dave's
recent feature request for BeebAsm - a copy command.
I had a similar need - I wanted a cross-platform tool to be able to add a file directly to an SSD, but I also wanted to be able to specify that it was a BASIC text file and that it should be tokenised before it was saved. I initially suggested it to Rich as a new feature for BeebAsm or as a companion binary executable, but Rich wasn't really keen on including that sort of functionality in BeebAsm itself.
I take the point and, the more I think about it, the more I think it would be better to have a standalone cross-platform SSD manipulation tool which basically does the same sort of disc image manipulation as
OmniDisk without the disc reading, but that can be compiled natively on non-Windows platforms. (@Dave, if you're using Windows, I think you should be able to use OmniDisk to add a file as you wanted).
Starting with my use case of wanting to be able to add a file to an ssd with the option of tokenising it, I planned out an add2ssd binary which I've been hacking away on. Thomas Harte has provided us with the guts of a BASIC tokenising routine on the wiki, originally taken from ElectrEm, and of course BeebAsm ships with the add functionality, so in theory it should be trivial to plug the two together. Of course, my C++ sucks so badly, I still haven't got it working even with Rich's patient pointers. It compiles on both Linux and MinGW, but under the former it crashes out immediately with a Segmentation Fault. Under MinGW, it appears to sort of work - if the file is renamed to DEMO (it can't handle the $.DEMO.bas yet) it adds the DEMO BASIC file and to a newly generated SSD, but when I open it up the file on the new disc image is of size 0. :/
The archive includes some documentation on how the tool is intended to work in about.txt, and there are some relevant TODOs commented in the code for stuff which still needs fleshing out.
Since I've been badly hacking away at this, Dave has posted some SSD manipulation C code of his own
here that I haven't yet had a chance to look at. In addition to that, I've also discovered that Dominic Beesley released a GPL v2+ command line C app well over five years ago,
DFS v0.3 which - from the description - sounds exactly like what I think is needed, bar the BASIC tokenising use-case. Unfortunately, I've been unable to get that to compile with my current MinGW and Linux environments so have no idea how much functionality it contains.
Anyway, as Dave has raised the fact that he was looking at a similar use-case, I thought it best that I posted my progress (or lack thereof) here in public and also stop bugging Rich in private over it. I'm preparing for an absence next week, which means I'm unlikely to touch this again until I get back, in nearly a month.
If anyone wants to play with it or further develop it, feel free. It's been painfully slow so far. I will endeavour to finish this add2ssd utility as documented at least when I get back, but I think I'll struggle to take it any further. Ideally, it'd be great to expand the tool to be a full ssd manipulation tool, but I think that's a bit wishful thinking from my point of view, at this point.
Sam.