deven@rpi.edu (Deven T. Corzine) (04/13/90)
Another thing to deal with in a proper disk copier. I want to update the creation time on an AmigaDOS volume when copied to keep from confusing AmigaDOS if both disks are mounted at once. How do I do this? Is the rootblock found by (highest block # - lowest block #)/2, rounded? That is, is the rootblock on a floppy always block 880? How can I avoid accidentally modifying a disk if it is NOT an AmigaDOS disk? Turn the disk-validator loose on the source disk and update the destination if it is considered valid by AmigaDOS? Some other method? Deven -- Deven T. Corzine Internet: deven@rpi.edu, shadow@pawl.rpi.edu Snail: 2151 12th St. Apt. 4, Troy, NY 12180 Phone: (518) 274-0327 Bitnet: deven@rpitsmts, userfxb6@rpitsmts UUCP: uunet!rpi!deven Simple things should be simple and complex things should be possible.
ccplumb@lion.waterloo.edu (Colin Plumb) (04/15/90)
In article <DEVEN.90Apr13073556@netserv2.rpi.edu> deven@rpi.edu (Deven T. Corzine) writes: >Another thing to deal with in a proper disk copier. I want to update >the creation time on an AmigaDOS volume when copied to keep from >confusing AmigaDOS if both disks are mounted at once. How do I do >this? Is the rootblock found by (highest block # - lowest block #)/2, >rounded? That is, is the rootblock on a floppy always block 880? Yes. There's a bunch of information on this subject in the 1989 DevCon notes, if you can get them. I can't find my photocopies of the relavent articles, but I'll see if I can dig them up. Any blocks preallocated from the end of the partition are subtracted from the high pointer, but blocks reserved from the low end are not, for compatibility reasons, before averaging them to get the root block address. Also, it should be in the boot blocks, but format is stupid and doesn't put it htere, while install is JUST PLAIN BROKEN and overwrites the bb_dosblock field that's "reserved for DOS patch" and is supposed to be FILE SYSTEM STRICTLY PRIVATE NICHT FUR GEFINGERPOKEN UND MITTENGRABBEN OFF LIMITS AND OUT OF BOUNDS data. >How can I avoid accidentally modifying a disk if it is NOT an AmigaDOS >disk? Turn the disk-validator loose on the source disk and update the >destination if it is considered valid by AmigaDOS? Some other method? Also in the '89 DevCon notes. Basically, just run a lot of sanity checks. Does the boot block say DOS\0? Then check that, on the "root block": Type is T.SHORT Header key is 0 Highest Seq. number is 0 HT size is blocksize/4-56 (72 for 512-byte blocks) First data block is 0 Checksum is valid Hash tabe entries are all == 0 or > reserved and < partition size BMflag is 0 or -1 Bitmap pages are all 0 or in range Alteration mins/ticks are in range (< 24*60 and < 61*50, resp.) Disk name has a valid length (< 30 chars) Creation date is before alteration date and mins/.ticks are reasonable Next hash chain is 0 PArent directory is 0 Extension is 0 Secondary type is ST.ROOT. If a block passes all of these tests, you can safely say it's an AmigaDOS root block. -- -Colin