[Coco] toolshed beta release

Tormod Volden lists.tormod at gmail.com
Sun Mar 20 06:10:50 EDT 2016


On Sun, Mar 20, 2016 at 1:38 AM, Bill Pierce wrote:
> As usual, you have not a clue what I'm referring to. So forget it...

I kept talking about "os9 copy", but if the destination is a DECB
image, the command can also be "decb copy". Maybe this confused you.
As to what you are really talking about, I just have to guess. You
mention "partitions" which is a non-existing concept in DECB and OS-9.
Are you talking about this "hybrid" disk image hack where a DECB disk
image is concatenated to a OS-9 disk image, and HDB-DOS adds a magic
offset for every disk access? To emulate this HDB-DOS feature would be
possible in Toolshed decb, but it would involve for instance adding
this magic offset to all seek() calls (and any implicit seeks) in the
tools and libraries. It might get complicated where for instance the
library functions open a given file to see what kind of image/file it
is, and any such offset adjustment only applies to some of the
files/images involved. BTW, the same auto-detection allows you to use
the "os9" command to copy into "decb" images because they use the same
library functions for copying... So adding a DECB file offset will
require a careful design.

To make a raw sector-by-sector copy from one disk image to another
that are concatenated in a host file, you can use the dd command, e.g:
 dd bs=256 if=hybrid_image count=$((0x5A000)) of=backup_0
 dd bs=256 if=backup_0 of=hybrid_image seek=$((0x5A000)) conv=notrunc
copies a $5A000 long "partition" from the beginning of the hybrid disk
image over whatever follows it.

Another example, copying a small 630 sector "partition" A to another
B, both located after a big $5A000 one:
 dd bs=256 if=hybrid_image count=630 skip=$((0x5A000+630*A)) of=backup_A
 dd bs=256 if=backup_A of=hybrid_image seek=$((0x5A000+630*B)) conv=notrunc

(dd only accepts decimal parameters, hence the use of $(()) arithmetic
expansion everywhere)

Tormod


More information about the Coco mailing list