[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference 7.286::atarist

Title:Atari ST, TT, & Falcon
Notice:Please read note 1.0 and its replies before posting!
Moderator:FUNYET::ANDERSON
Created:Mon Apr 04 1988
Last Modified:Tue May 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1433
Total number of notes:10312

537.0. "Floppy-swapping, single drive ST" by MINDER::GILBERT (North UK Region Appl'n Centre @MCO) Wed Jul 19 1989 12:09

    
    I'm writing some non-Gem software, in C. In one section of it I need to
    copy a file from one disk to another. I have a few questions for
    the ST gurus:-
    
    1) How do I tell how many physical floppy drives there are on a system?
    The call I've tried returns a bit vector indicating 2 drives, even
    on a 1-drive system.
    
    2) On a single drive ST, TOS can't/doesn't keep track of whether
    disk A or B is currently in the drive - True?

    3) The consequences of fumbling disks and having the wrong one loaded
    at the wrong time during a single-drive copy - corrupt directory 
    and/or FAT?    
    
    4) Any hints on safeguarding against 3)? I remember reading about
    a random number field written during formatting - can that be used
    to identify disks? 
    
    
    (I need to make sure my software is fairly foolproof, I'm also the user).

    Rgds, Brian
    
    
T.RTitleUserPersonal
Name
DateLines
537.1I've been therePRNSYS::LOMICKAJJeff LomickaWed Jul 19 1989 18:2030
>    1) How do I tell how many physical floppy drives there are on a system?
>    The call I've tried returns a bit vector indicating 2 drives, even
>    on a 1-drive system.

peekw( 0x4A6) contains, according to the MWC manual, "Number of floppy
disk drives."
    
>    2) On a single drive ST, TOS can't/doesn't keep track of whether
>    disk A or B is currently in the drive - True?

Only to the extent that it trusts you when you say you inserted disk A
or disk B.  If TOS asks for disk B, and you re-insert A, then you loose.

>    3) The consequences of fumbling disks and having the wrong one loaded
>    at the wrong time during a single-drive copy - corrupt directory 
>    and/or FAT?    

It depends on the program.  If you don't have any files open at the
time, it should be okay.  If you do, then well...

>    4) Any hints on safeguarding against 3)? I remember reading about
>    a random number field written during formatting - can that be used
>    to identify disks? 

You can Rwabs() block 0 and read the disk serial number out of the boot
block, but if you Rwabs() after a media change but before doing any
GEMODS I/O, you will totally screw up GEMDOS, as GEMDOS needs to know
when the media changes, and by doing an Rwabs(), you have circumvented
GEMDOS's way of finding out.  Be sure to do some gemdos I/O (like
Fopen()) before doing the Rwabs(), and you will be okay.
537.2Thanks...MINDER::GILBERTNorth UK Region Appl'n Centre @MCOFri Jul 21 1989 17:079
    Thanks for your reply Jeff.
    
    btw 
    
    I'd found system variable 0x4A6, but Abacus's ST Internals said
    it only has values 0 or 2. It is wrong, your version is right.
    The number of errors and omissions in that $%^& book is unacceptable!
    
    rgds Brian
537.3? 2-disk games ?NRMACU::BAILEYWed Oct 18 1989 12:357
    Does anyone out there know why so many games which require more
    than one disk (e.g. Dungeon Master) can't use a second drive where
    one is available. I get annoyed at having to continually swap disks
    while there is a perfectly good drive sitting there doing nothing!
    
    Chris.