🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.atari.st
Article #30372

Re: Mediach() function question

#30372
From: Michael Fischer
Date: Tue, 02 Feb 1988 19:12
30 lines
2081 bytes
Karl Rowley asks:
> I have a question about the GEMDOS Mediach() function.  My MWC manual says
> this function can return a 0, 1, or 2, meaning "no", "maybe", or "yes."
> What situation would cause Mediach() to return "maybe"?

"maybe" is returned after a short time (on the order of 1-2 seconds)
has elapsed with no disk activity if the write protect latch has
seen light, which occurs whenever the disk is removed from the drive
but also whenever a disk is write protected.  Rwabs responds to
"maybe" by rereading the boot sector and seeing if the 24 bit serial
number written there agrees with the remembered value.  If so, it
assumes the disk has NOT changed, so it sets the media change value
back to 0 and carries out the request; if not it sets it to 2 and
returns a "media changed" error.  (This also occurs if it was 2
to start with.)  Getbpb is what normally sets it back to 0.

The idea is that a disk cannot be changed without the system noticing
and checking the serial number.  If the disk is write protected,
the boot sector will be read more often than necessary but otherwise
no harm is done.  Too bad if you are unlucky enough to have two
disks with the same id and you insert one right after the other.
Gemdos will not notice that the disks have been changed and will
happily clobber the second disk if you attempt to write on it since
it will use cached FAT information from the first.  Note that this
situation (of duplicate disk ids) will occur with certain copy
programs that copy the entire disk, including the boot sector.  Avoid
using them for making backups of ordinary data disks.

--Mike Fischer <fischer-michael@cs.yale.edu>
-------
Technical Details
Message-ID: <8802021912.AA05940@ELI.CS.YALE.EDU>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!umd5!uvaarpa!mcnc!decvax!ucbvax!YALE.ARPA!fischer-michael

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!umd5!uvaarpa!mcnc!decvax!ucbvax!YALE.ARPA!fischer-michael
From: fischer-michael@YALE.ARPA (Michael Fischer)
Newsgroups: comp.sys.atari.st
Subject: Re: Mediach() function question
Message-ID: <8802021912.AA05940@ELI.CS.YALE.EDU>
Date: 2 Feb 88 19:12:58 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Organization: The Internet
Lines: 29