Hi Rich,

this is from my old qformat utility which quickly reformats a disc by writing a "blank" map to the disc. The following is the ED details:

/*----------------------------------------------*
 * DS/ED MAP                                    *
 *                                              *
 * The map for a DS/ED disc takes up 3 sectors  *
 * of 2048 bytes each. This is because there    *
 * are 1600 allocation blocks on an ED disc.    *
 *----------------------------------------------*/

                                          /*-------------------------*/
US char maped[] = {'Q','L','5','B',       /* HD identifier           */
                   32,32,32,32,32,        /* Medium name             */
                   32,32,32,32,32,        /*                         */
                   0,0,                   /* Format Random No        */
                   0,1,0,0,               /* Update Counter          */
                   6,60,                  /* Free Sectors            */
                   6,64,                  /* Good Sectors            */
                   6,64,                  /* Total Sectors           */
                   0,10,                  /* Sectors per Track       */
                   0,20,                  /* Sectors Per Cylinder    */
                   0,80,                  /* No of Tracks            */
                   0,1,                   /* Sectors per block       */
                   0,0,                   /* Directory EOF block     */
                   0,64,                  /* Directory EOF byte      */
                   0,2,                   /* Sector offset per track */
                   0,2,4,6,8,128,         /* Logical -> Physical     */
                   130,132,134,136,       /*                         */
                   1,3,5,7,9,129,         /*                         */
                   131,133,135,137,       /*                         */
                   255,255,255,255,255,   /* Spare (Phys -> Log ?)   */
                   255,255,255,255,255,   /*                         */
                   255,255,255,255,255,   /*                         */
                   255,255,255,           /*                         */
                   255,255,255,255,255,   /* Spare                   */
                   255,255,255,255,255,   /*                         */
                   255,255,255,255,255,   /*                         */
                   255,255,255,           /*                         */
                   248,0,0,               /* Block 0 = MAP           */
                   248,0,1,               /* Block 1 = MAP           */
                   248,0,2,               /* Block 2 = MAP           */
                   0,0,0};                /* Block 3 = DIR           */
                                          /*-------------------------*/


So, 80 tracks, 2 sides, 1 sector per block, 10 sectors per track, which is where 3.2 mB comes from:

2 (sides) * 80 (tracks) * 10 (sectors) * 2 KB = 3.2 Mb.

The interleave factor is 2 which means read sector 0, then 2, 4, 6 & 8 on side 0, then switch sides to side 1 and read 0, 2, 4, 6, 8 there then come back to side 0 and read 1, 3, 5, 7, 9 .... - the logical to physical table shows this. The side number is bit 7.

I assume that this is the order you will need to read the data in order to get it onto a "single sided" SD card.

Do I have this working the right way around (or should the sides loop be
outside the tracks loop?)
See above, the sectors are interleaved. And even worse, when you move from track 0 to track 1, because the drive is spinning as the head moved, to avoid having to wait, you add on the sector offset per track so on side 0, track 1, you read 2,4,6,8,0 then side 1 - 2,4,6,8,0, then side 0 - 3,5,7,9,1 and so on.

This does create an image of the correct size, but I can't get the QL to
read it once converted.
Probably because you have read a whole side at once. Then the other.


HTH

Cheers,
Norm.

--
Norman Dunbar
Dunbar IT Consultants Ltd

Registered address:
Thorpe House
61 Richardshaw Lane
Pudsey
West Yorkshire
United Kingdom
LS28 7EL

Company Number: 05132767
_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to