| www.retrosoftware.co.uk http://www.retrosoftware.co.uk/forum/ |
|
| Command line SSD manipulation tool(s) - add2ssd.exe http://www.retrosoftware.co.uk/forum/viewtopic.php?f=19&t=592 |
Page 2 of 2 |
| Author: | Samwise [ Wed Oct 05, 2011 1:44 pm ] |
| Post subject: | Re: Command line SSD manipulation tool(s) - add2ssd.exe |
I've now added a page and entry off the Dev Tools page here so that Retro Software visitors are aware of the tool. Feel free to go in, rearrange and generally take over maintenance of that page to keep it up to date with your development. Let me know if you want a forum to go with those. Sam. |
|
| Author: | sweh [ Sat Mar 10, 2012 10:36 pm ] |
| Post subject: | Re: Command line SSD manipulation tool(s) - add2ssd.exe |
People might have spotted me just pop up at *. and I was pointed here (specifically this thread) as well. Being a brand new recipient of TurboMMC I wanted, of course, to convert my existing hard disks. However I have a Solidisk DDFS, which is a 1770 based system so the disks are 320K in side. MMD format doesn't appear to allow for that (reading of some code makes it look like it's hard coded to 200K per image - ie SSD - and the images are at fixed offsets throughout the file). What's worse is that Solidisk uses a "chained catalogue". When you create your 32nd file it will create a 2nd catalogue and use 2 bytes from the first to point to the sector where the second is found. And the same for the 3rd. And... So it's very easy to create a disk with 100+ files on it. Acorn DFS can't handle that. Since I'm trying to reduce amount of reads on my floppies, I'm aiming of creating an image of the original disk, splitting it across 2 SSDs, then on my Linux machine I can extract and mangle data, build new SSDs and so on. All good fun. The data extraction part isn't written yet (OSWORD &7F, here I come!) but I'm making some progress with reading MMB and SSDs. Using the TurboMMC provided MMD as an example: Code: $ ./dcat.pl -f ../BEEB.MMB.ORIG 4: UTILS 20: ROMS1 $ ./get_ssd.pl -f ../BEEB.MMB.ORIG 4 utils.ssd Getting disk 4: UTILS utils.ssd created $ ls -l utils.ssd -rw-r--r-- 1 sweh sweh 204800 Mar 10 16:22 utils.ssd $ ./getfile.pl -f utils.ssd utils Saving $.MXR Saving $.COP105 Saving $.COP112 Saving $.COP113 Saving $.FFIND Saving $.BUTIL Saving $.COPY Saving $.COP109 Saving $.RLOAD Saving $.AXR Saving $.PBAS Saving $.E00DFS Saving $.RFS Saving $.PATCH $ ls utils $.AXR $.COP105 $.COP112 $.COPY $.FFIND $.PATCH $.RFS $.BUTIL $.COP109 $.COP113 $.E00DFS $.MXR $.PBAS $.RLOAD The "get_ssd" code is simple: Code: #!/usr/bin/perl -w use strict; use lib '.'; use BeebUtils; @ARGV=BeebUtils::init(@ARGV); my $dr=$ARGV[0]; die "Syntax: $0 [-f MMB_file] image_number target_file\n" unless defined($dr); die "Not a number\n" unless $dr=~/^[0-9]+$/; my $target=$ARGV[1]; die "No target file\n" unless $target; my %disk=BeebUtils::load_dcat(); die "Disk $dr not valid\n" unless $disk{$dr}{Formatted}; my $L=$disk{$dr}{Readonly}?" (L)":""; print "Getting disk $dr: $disk{$dr}{DiskTitle}$L\n"; my $image=BeebUtils::read_ssd($dr); open(T,">$target") or die "$!: $target\n"; syswrite T,$image; print "$target created\n"; The "extract from SSD" code is similarly simple 'cos of the BeebUtils module I'm writing. This automatically handles the chained catalogs of Solidisk I haven't written any "change" routines, yet. That's still to come. I've only been at this for 7 hours |
|
| Author: | sweh [ Sun Mar 11, 2012 3:50 am ] |
| Post subject: | Re: Command line SSD manipulation tool(s) - add2ssd.exe |
FWIW, http://sweh.spuddy.org/Beeb/ |
|
| Author: | sweh [ Tue Mar 13, 2012 2:50 am ] |
| Post subject: | Re: Command line SSD manipulation tool(s) - add2ssd.exe |
Commands currently implemented: daccess.pl (*DLOCK, *DUNLOCK equiv) dblank_mmb.pl (128Mb MMB) dcat.pl (*DCAT) dget_ssd.pl (extracts ssd from mmb) dgetfile.pl (extracts files from an ssd image inside the mmb) dinfo.pl (shows files on an ssd image inside the mmb) dkill.pl (*DKILL, *DRESTORE) dlabel.pl (Renames a file inside the MMB header; does not change the SSD image) donboot.pl (*DONBOOT) blank_ssd.pl (Creates blank SSD file) getfile.pl (Extracts files from SSD) info.pl (Shows files in an SSD) title.pl (*TITLE on an SSD) I'm probably not going to _change_ SSDs inside the MMB; what I'll do is manipulate SSD files and provide a way to load that new file into the MMB. |
|
| Author: | sweh [ Fri Mar 16, 2012 7:47 pm ] |
| Post subject: | Re: Command line SSD manipulation tool(s) - add2ssd.exe |
Code: Syntax: beeb command [args] Possible commands: blank_ssd daccess dblank_mmb dcat dget_ssd dgetfile dinfo dkill dlabel donboot dput_ssd dump getfile info list title type I think "delete" and "putfile" are all that's left to be done. |
|
| Author: | sweh [ Tue Mar 20, 2012 1:34 am ] |
| Post subject: | Re: Command line SSD manipulation tool(s) - add2ssd.exe |
sweh wrote: I think "delete" and "putfile" are all that's left to be done. I lied... Code: Syntax: beeb command [args] Possible commands: access blank_ssd compact daccess dblank_mmb dcat delete dget_ssd dgetfile dinfo dkill dlabel donboot dput_ssd dump getfile info list rename title type I still haven't done the "putfile" but the code should be able to read Soldisk multi-catalogues, Watford 62 file, Opus 8 catalogue (untested!) and Disk Doctor dual-catalogue formats. |
|
| Author: | sweh [ Wed Mar 21, 2012 2:24 am ] |
| Post subject: | Re: Command line SSD manipulation tool(s) - add2ssd.exe |
Well... I think it works! Code: * putfile Puts all specified files onto an SSD. beeb putfile myssd file1 file2 file3 file4... Can use wildcards, eg beeb putfile myssd mydir/* This will attempt to read .inf files to work out load/exec/locked and filename. If inf file doesn't exist then it'll use the name of the file with load/exec values of 0. e.g % ls -l mydir total 16 -rw-r--r-- 1 sweh sweh 6 Mar 20 21:12 Test1 -rw-r--r-- 1 sweh sweh 15 Mar 20 21:12 X.Test2 -rw-r--r-- 1 sweh sweh 13 Mar 20 21:13 foo -rw-r--r-- 1 sweh sweh 39 Mar 20 21:13 foo.inf We can see there are three files, but one has a .inf file % cat mydir/foo.inf $.FOO FF1900 FF8023 Locked CRC=AB7A This means that "foo" is really called $.FOO So lets add these to a new SSD % beeb blank_ssd myssd Blank myssd created % beeb putfile myssd mydir/* % beeb info myssd Disk title: (1) Disk size: &320 - 200K Boot Option: 0 (None) File count: 3 Filename: Lck Lo.add Ex.add Length Sct $.FOO L FF1900 FF8023 00000D 004 X.Test2 000000 000000 00000F 003 $.Test1 000000 000000 000006 002 note that case was preserved, and Test1 was put into $. There is an optional -c flag which will *COMPACT the disk before adding files. The SSD is only saved if all the files get added properly. If anyone wants to test it, it's at http://sweh.spuddy.org/Beeb/ The complete list of commands: Code: Syntax: beeb command [args]
Possible commands: access blank_ssd compact daccess dblank_mmb dcat delete dget_ssd dgetfile dinfo dkill dlabel donboot dput_ssd dump getfile info list putfile rename title type |
|
| Page 2 of 2 | All times are UTC [ DST ] |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|