Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!seismo!lll-lcc!mordor!sri-spam!ames!amdcad!sun!imagen!atari!apratt
From: apratt@atari.UUCP (Allan Pratt)
Newsgroups: comp.sys.atari.st
Subject: Re: fast multi-sector floppy I/O with interrupts (question)
Message-ID: <789@atari.UUCP>
Date: Thu, 16-Jul-87 13:51:54 EDT
Article-I.D.: atari.789
Posted: Thu Jul 16 13:51:54 1987
Date-Received: Sat, 18-Jul-87 11:02:36 EDT
References: <204@nlgvax.UUCP>
Distribution: world
Organization: Atari Corp., Sunnyvale CA
Lines: 42

in article <204@nlgvax.UUCP>, johan@nlgvax.UUCP (Johan Stevenson) says:
>  - is a single command for several sectors really impossible?

Yes, Virginia, multi-sector reads don't really work usefully with this
controller.

The ST BIOS manages to read a whole track in one revolution because it
polls the controller status, rather than waiting for the interrupt.  The
"fast" format skews the position of sector 0 on successive tracks by as
much time as it takes to step the head, so sector 0 is under the head
when it gets there, so you get one track per 1.2 (or so) revolutions. 

There is a gap of just over a millisecond between sectors -- plenty of
time for a 50-cycle interrupt and a service routine which loads pre-
computed values into the controller & sets up the DMA.

The problem is that it will take 5.5 revolutions to read a track (.5
latency, sectors 0&1 in one rev, then 2&3, then 4&5, then 6&7, then 8)
at this rate.  Does the filesystem ever make requests of more than one
block? If not, you might consider skewing pairs of sectors on pairs of
tracks:

Even track:	0 1 4 5 8 2 3 6 7	(0-1, 2-3, 4-5, 6-7 are paired)
Odd track:	0 5 6 1 2 7 8 3 4	(1-2, 3-4, 5-6, 7-8 are paired)
(even 8 and odd 0 are 1/2 track away from each other)

This way your two-sector requests will be serviced in minimal time, and
during the two-sector gap before the next pair, the filesystem has time
to make its next request.  This gives you the whole track in 3
revolutions (.5 rev latency, sectors 0,1 and 2,3 in one rev, 4,5 and 6,7
in the next, then .5 rev to pick up sector 8). 

Alternatively, you can have the driver always request a track at a
time, and keep a few track buffers around.  No skewing involved.

I know you want to make sure Minix is usable with floppies... I'm just
glad I have a hard disk!

/----------------------------------------------\
| Opinions expressed above do not necessarily  |  -- Allan Pratt, Atari Corp.
| reflect those of Atari Corp. or anyone else. |     ...lll-lcc!atari!apratt
\----------------------------------------------/	(APRATT on GEnie)