Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!mit-eddie!genrad!decvax!decwrl!sun!imagen!atari!dyer From: dyer@atari.UUCP (Landon Dyer) Newsgroups: comp.sys.atari.st Subject: Re: Why does GEMDOS call Mediach() so often? Message-ID: <717@atari.UUCP> Date: Thu, 23-Apr-87 13:06:02 EST Article-I.D.: atari.717 Posted: Thu Apr 23 13:06:02 1987 Date-Received: Sat, 25-Apr-87 13:43:03 EST References: <7359@boring.mcvax.cwi.nl> Organization: Atari Corp., Sunnyvale CA Lines: 35 in article <7359@boring.mcvax.cwi.nl>, jack@mcvax.cwi.nl (Jack Jansen) says: > While testing my remote disk driver (soon to be posted), I noticed > that GEMDOS makes a *huge* number of calls to the Mediach() routine. > > For instance, when doing a 'show info' on a (remote) hard disk, it > would do the calls rwabs, mediach, rwabs, mediach, mediach, mediach, > rwabs, 10(!) times mediach, etc etc. > > It calls mediach at least once between reads, but often more. I saw it > being called *forty-seven* times in a row once. > Is there any reason for this behaviour? Is there anything I can > do against it? Should mediach() perform more functions than the bios > guide says (return 0/1/2 for not/maybe/definitely changed)? > > Not that mediach() is usually a cheap call: just check a bit in the > hardware somewhere. > For a remote disk, however, it is quite expensive, since a packet has > to be sent back and forth. You should try to make Mediach() as cheap as possible, since it may be called often. GEMDOS is rather too paranoid about media changes. When doing partial-sector reads and writes (including directory searches and FAT operations) it calls Mediach() on a hit in the sector cache, evidently to "validate" the cached sector. Mediach() on floppies does not simply "check a bit somewhere". It hits the disk (to check the serial number) only as a last resort, since ANY disk I/O --- floppy OR hard disk --- is expensive. I suggest you send a packet only as a last resort. -- -Landon Dyer, Atari Corp. {sun,lll-lcc,imagen}!atari!dyer The views expressed here do not not necessarily reflect those of Atari Corp. Segments are for worms.