[Coco] .DSK Partition extract/inject tool?

Gene Heskett gheskett at wdtv.com
Wed Sep 25 01:45:16 EDT 2013


On Tuesday 24 September 2013 20:46:41 Chad H did opine:

> Well Aaron pointed out that I don't have to specify "Sectoroffset", I
> can choose "DriveOffset" instead.  This saves some time and heartache
> if I miscalculated and more or less lets the CoCo handle the
> extracting/injecting into the DW4 server files.
> 
> -----Original Message-----
> From: coco-bounces at maltedmedia.com [mailto:coco-bounces at maltedmedia.com]
> On Behalf Of Retro Canada
> Sent: Tuesday, September 24, 2013 7:00 PM
> To: CoCoList for Color Computer Enthusiasts
> Cc: CoCoList for Color Computer Enthusiasts
> Subject: Re: [Coco] .DSK Partition extract/inject tool?
> 
> i have .c program that i use for my superide images you just neet to
> adjust the sector size to 256 and the offset of course. send it to you
> later. you can put and get any dsk between 255 ones.
> 
> On 2013-09-24, at 7:25 PM, Chad H <chadbh74 at hotmail.com> wrote:
> 
> What you call ".vhd" I'm already using as .DSK files, but same thing. 
> They have 0-255 drive in one file.  I understand what your saying that
> you can adjust the offset in DW4 thereby specifying which disk within
> the image to use for that drive, but that's extra work.  I still don't
> understand why the decision was made to use "OffSets" in multiples of
> 630 sectors.  DW4 is set for ALL of the 0-255 disks to be 630 sectors
> as a standard right?  Then why not make it so DW4 lets you choose a
> 0-255 disk to mount as a offset instead?  Just a thought.
> 
> If I had a PC side utility that I could select one .VHD, and a specific
> 0-255 disk, then select a second .VHD with another 0-255 disk and
> instantly transfer it over...that would be bypassing a lot of steps and
> calculations too.
> 
> -----Original Message-----
> From: coco-bounces at maltedmedia.com [mailto:coco-bounces at maltedmedia.com]
> On Behalf Of Robert Gault
> Sent: Monday, September 23, 2013 10:30 PM
> To: CoCoList for Color Computer Enthusiasts
> Subject: Re: [Coco] .DSK Partition extract/inject tool?
> 
> Chad H wrote:
> > I was just wondering if there existed a tool in any Toolshed or
> > elsewhere that made it easy to take a single virtual disk (0-255) out
> > of a .DSK partition and inject it into another .DSK partition at a
> > specified virtual disk (0-255).  Anyone?

Let me see if I can expand on this a wee bit, for use from one of the 
coco's own shells while running the current nitros9, how this can be done.

Assuming the os9 "partition" starts on the first sector of the drive, and 
to use one of my 1Gb drives as an example, assume somewhat less that 500 
megabytes is assigned and formatted for os9 use.  That size FWIW, will 
require a cluster size of 4 but that isn't germain to this.  The format 
program will have assigned, in the first 3 bytes of the drives LSN0, a 
value known as DD.SIZ, say in hexidecimal that would be $1B,$DD,$BF.  Now 
add one, and poke it into the loaded HDBDOS at $D938, $D939, & $D93A, so 
the value there is $1BDDC0.

This then is the starting address of the first HDBDOS virtual drive, drive 
0.

Then , in the os9 bootfile, you have an /SH descriptor which has some 
special properties.  Near the end of it, there is a 3 byte space that you 
hard code to have this same data.  So in os9, it then knows where all 256 
of the HDBDOS disk images are because it knows the starting address.

But this drive descriptor has a trick up its sleeve because its labeled as 
a hard drive where the DD.STP value means nothing to the step speed, and 
has been re-assigned to represent this same drive offset being discussed in 
the drivewire menu's.

Now, HDBDOS does not 'deblock' the 512 byte sectors, instead it throws the 
second half of the 512 byte sector away and uses only the first half.  
Drive space today is penny's.

Now, I haven't done it, but there is absolutely nothing preventing that 
Sh.dd descriptor from being copied to si.dd, sj.dd, sk.dd etc, (other than 
sysram shortages that is), calling up ded and changing the 2nd character of 
the internal name from Sh (with the high bit set of course) to sj by adding 
one to the hex value you see there.

Then, go to the end of it where that ofs and IIRC wpc values live, fire up 
a hexidecimal capable calculator, calculate the total size of that first 
256 vdisks, and get $0x4EC00, to which you then add the original 0x1BDDC0 
and get 0x20C9C0, which you then set into those 3 bytes of the Sj.dd 
descriptor.  It will then point at the 2nd 256 disk area of the hard drive.

For yet another, add that $0x4EC00 to the 0x20C9C0 and get 0x25B5C0, put 
that into the sk.dd descriptor.  Continue until bored or out of real disk.  
With my 1Gb drives, I could do that about 6 times, which is more floppies 
than I own (I think). 

In each case using dmode to adjust the stp value in each of these 
descriptors will allow you to walk around, a virtual floppy image at a 
time, in each of these disk areas of 256 disks each.

Hopefully, this might take some of the mystery out of using the HDBDOS idea 
under os9.

FWIW, os9/nitros9 doesn't use the HDBDOS facilities anyplace but in loading 
track 34 from the default floppy image.  Even there, its use is done once 
it has loaded track 34 on top of HDBDOS, and the boot module then locates 
the OS9boot file and its size, directly from those values stored in LSN0 
when you run os9gen.

Helpful?  I hope so.  Unforch I can't be more specific tonight as I am not 
capable of negotiating the stairway to the basement where my coco3 is, I 
have a knee I can dislocate very easily, and I apparently did more than 
just pop it out of joint this afternoon.  I must have torn some ligaments 
and while its movable, it won't bear more than 5 pounds without screaming 
at me.  One neighbor loaned me a walker, another a set of crutches, so 
given enough time I can get from here to there, keyword is of course time.

> You really don't need a tool. The easiest method whether using HDBDOS or
> RGBDOS is just to copy one of the .vhd Disk Basic disks to a single .dsk
> image and then to a different .vhd image.
> If you are using Drivewire4 and have read the documentation, you will
> see that you can mount multiple .vhd image that have up to 256 Disk
> Basic drives per vhd.
> You can then adjust the offsets individually for each DW4 drive and turn
> on HDBDOS translation. That will permit using the BACKUP command of
> Disk Basic to transfer any of the 0-255 drives from one .vhd image to
> another.
> 
> Are you asking about Drivewire usage or one of the other emulators, JVC,
> MESS, or VCC? Techniques will differ.

Cheers, Gene
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)

On Thanksgiving Day all over America, families sit down to dinner at the
same moment -- halftime.
A pen in the hand of this president is far more
dangerous than 200 million guns in the hands of
         law-abiding citizens.



More information about the Coco mailing list