[Coladam] Delete a backup file on DDP

Geoff Oltmans geoff at oltmansfamily.org
Fri Jan 29 06:01:12 CET 2010


Thanks for the info. I figured out what the problem was. There's a bug in the ADAMEm code when not using zlib. In my case I'm not, but I think by default it is used in the Makefiles that comes with the source. fopen was called with the wrong attributes (a+b instead of r+b). If the 'a' attribute is used then fseek has no effect and writes are appended to the end of the file.


On Jan 28, 2010, at 1:26 PM, Rich Drushel wrote:

> 
> On Thu, January 28, 2010 10:02 am, geoff at oltmansfamily.org wrote:
> 
>> For example if I attempt to use clone21 from TDOS and write a disk image to
>> a blank disk, it's not writing the blocks in the right locations. ADAM 160k
>> disk images are interleaved 5:1 (or is it 1:5?), so disk sectors aren't
>> stored sequentially. The code in ADAMEm does this calculation properly, but
>> when I look at the resulting image in a hex editor, things aren't correct.
>> For example, the first write that clone does should be to block 0, which
>> should also be offset 0 in the resultant disk image file. In my case
>> though, it is several kb past the beginning of the file.
> 
>     Here are the interleave data from the floppy I/O routines in
> ADAMserve (pasted right from DATA_31x.ASM).  Each entry is a table;
> offsets into the table return low-level info to map ADAM 1024-byte
> "blocks" into two IBM 512-byte "sectors", including "head" info (i.e.,
> which side of the disk you are reading for double-sided media).  5.25"
> double-sided disks map differently than 3.25" double-sided disks:  320K
> disks put the first blocks 0-159 on one side (for compatibility with 160K
> single-sided disks) and 160-319 on the other.  3.25" media switch sides
> after every "track" (group of sectors in a cylinder) of data.  160K/320K
> disks have 8 sectors per track; 720K disks have 9 sectors per track;
> 1200K disks (no native ADAMnet drives, but possible with ADAMserve)
> have 15 sectors per track; and 1440K disks have 18 sectors per track.
> All disks have 40 tracks.  Remember that 2 sectors = 1 block.  I am
> omitting here the math to actually map an ADAM block to a given IBM
> head/track/sector pair for a given drive size, but can provide it if
> there is interest.
> 
> offset_160_320  DB       1,6, 3,8, 5,2, 7,4
> ;
> offset_720      DB       0,1, 0,5, 0,9, 0,4, 0,8, 0,3, 0,7, 0,2, 0,6
>                DB       1,1, 1,5, 1,9, 1,4, 1,8, 1,3, 1,7, 1,2, 1,6
> ;
> offset_1200     DB       0, 1, 0, 5, 0, 9
>                DB       0,13, 0, 2, 0, 6
>                DB       0,10, 0,14, 0, 3
>                DB       0, 7, 0,11, 0,15
>                DB       0, 4, 0, 8, 0,12
>                DB       1, 1, 1, 5, 1, 9
>                DB       1,13, 1, 2, 1, 6
>                DB       1,10, 1,14, 1, 3
>                DB       1, 7, 1,11, 1,15
>                DB       1, 4, 1, 8, 1,12
> ;
> offset_1440     DB       0, 1, 0, 5, 0, 9, 0,13, 0,17, 0, 3
>                DB       0, 7, 0,11, 0,15, 0, 2, 0, 6, 0,10
>                DB       0,14, 0,18, 0, 4, 0, 8, 0,12, 0,16
>                DB       1, 1, 1, 5, 1, 9, 1,13, 1,17, 1, 3
>                DB       1, 7, 1,11, 1,15, 1, 2, 1, 6, 1,10
>                DB       1,14, 1,18, 1, 4, 1, 8, 1,12, 1,16
> 
> 
>    *Dr.D*
> 
> -- 
> Richard F. Drushel, Ph.D.            | "They fell:  for Heaven to them no hope
> Department of Biology                |  imparts / Who hear not for the beating
> Case Western Reserve University      |  of their hearts."
> Cleveland, Ohio  44106-7080  U.S.A.  |         -- Edgar Allan Poe, "Al-Aaraaf"
> 
> 
> _______________________________________________
> Coladam mailing list
> Coladam at adamcon.org
> http://adamcon.org/cgi-bin/mailman/listinfo/coladam



More information about the Coladam mailing list