• Please review our updated Terms and Rules here

Talk to me about... interleave.

deathshadow

Veteran Member
Joined
Jan 4, 2011
Messages
1,378
I just bought This tandy 1000 off Brandon which he put the hard drive into, and I gave it a little boot in the patoot by adding a V20 and a real parallel port (so I can get interlnk working).... but the hard drive (42 meg ST-250R RLL) seemed really slow -- particularly in pulling the disk free size off it, a sure-tell sign the interleave is something funky.

So I pull up the interleave and it's set to 4... which is, well... I never really ever saw drives back in the day with an interleave that high! 3 was the 'norm' when I started doing hard disks, but it occurred to me that I never got MFM hard drives on a PC until the AT class systems came along.

Naturally I started up spinrite (version 2) and it's like...

1:1 35,495
2:1 34,872
3:1 35,495
4:1 35,495 << current
5:1 163,742 << optimal
6:1 158,388
7:1 94,376

I'm not used to seeing so high a interleave being optimal -- is this typical for a RLL drive in a XT class machine?

I've got Spinrite doing a 5:1 low level reformat now with a test of all sectors, so I'll know in a couple hours if it makes a difference -- that high interleave number just seems noodle-doodle to me.
 
Yes, it's expected. The interleave is the spacing between the sectors, so at 1:1 sectors are stored on the surface as:

1:2:3:4:5...:15:16:17

Whereas, at 2:1 it would be,

1:10:2:11:3:12:4:13:5:14:6:15:7:16:8:17:9

So after reading sector 1, the processor has a time window whilst sector 10 flies past before it needs to 'collect' sector 2.

The slower the processor, the bigger the gap that is needd. The difference between 4:1 and 5:1 is so big, in your case, because only one sector is being read per revolution at 4:1 (it has to wait for nearly the whole disk to turn round again, since it wasn't ready to 'collect' the data as it was passing), whilst at 5:1 it should read the whole track in five revolutions.

Hope that helps!
 
5:1 interleave for an RLL drive is easily in the typical ballpark for an XT-class controller. The original Xebec MFM/10MB drive combo in the IBM 5160s came formatted 6:1. (Which was conservative. A "pro trick" was to format 5:1 instead, which the hardware could usually handle.) When you consider that the data rate of RLL drives is 50% higher than MFM 5:1 should make for a pretty fast drive by XT standards. I believe there *were* XT controllers that could do better, like 3:1 or even 2:1 interleave by using a full-track buffer, but they're pretty rare.

By odd coincidence when I picked up a Tandy 1000TX aeons ago (long since lost to history) its hard drive was slower than snot and likewise turned out to be formatted at the wrong (too low) interleave. My theory at the time was that the drive might of been pre-formatted in an AT-class machine before being paired with the XT controller and "worked", so the previous owner just assumed that's how fast it was supposed to be. Maybe that's what was up with yours?
 
Interesting about the Tandy 1000 - I had a 1000SL "back in the day" with 20MB 'hard card', and ended up re-formatting it having ballsed up the whole system, only to find my hard disk speeds increase from 40KB/s to maybe 120KB/s :) Maybe Tandy's LLF utility defaulted to a poor choice like 3:1 or something - I seem to remember looking up the correct value in a table, but it's a long time ago!
 
Interleave depends upon a number of factors; namely the latency of the controller--i.e. the time between which a sector is read and the time that it's actually transferred to memory; the speed at which a new request can be posted after completion of a prior request; the ability of the controller to perform multi-sector operations, the ability of the CPU to read ahead (or write behind) and finally, the processing time for the task at hand between sector transfers.

Early MFM/RLL controllers had buffering for only a single 512-byte sector, so one is limited to issuing a single-sector read, transferring the data, then issuing another single-sector read. With a larger buffer, a controller can initiate a read operation while the data for the previous one is still be transferred. Controllers that can provide multi-sector read capability can usually manage a whole track interleaved at 1:1.

One obvious, but overlooked aspect is that depending upon your processing task mixture, it can be advantageous to interleave the tracks that the root directory and FAT are contained on at a lesser interleave so that directory searching and FAT lookup proceed faster.
 
... seemed really slow -- particularly in pulling the disk free size off it, a sure-tell sign the interleave is something funky.
Another thing to consider...
Depending on the DOS version, this is normal. DOS 6.22 (possibly others) do some extensive work before returning the free disk space after that 1st DIR command. After that, it seems the value is cached somewhere and future DIR commands take way less time. I swear someone once pointed out a blog somewhere where someone dug into WHY exactly this first DIR takes so long, but I can find no such web page at the moment- it's a tough thing to google on.
 
That's true (check Ralf Brown's Interrupt listing or the DOS 6.0 source for details). As an aside, this was also the cause for a number of snafus involving removable media such as 360K floppies (not 1.2M or 1.44M because the drives have a "disk changed" hardware status facility). Using old stale data on a disk that's been swapped can lead to disaster.
 
It depends on both the drive and controller. 4:1 is typical for a Seagate ST-11 series card in an XT class machine -- in fact, I think that's the fastest it will go. There are also some Western Digital cards which max out at 4:1, while others can do 3:1.

1:1 interleave is possible in an XT class machine, but rare. My Tandy 1000RL's built-in "SmartDrive" IDE-XT interface (with DMA data transfer) does 1:1 interleave with a Seagate ST-351A/X drive -- but if I stick in an older and slower Western Digital WD93028-X drive, then 3:1 is as fast as it can handle.
 
Another thing to consider...
Depending on the DOS version, this is normal. DOS 6.22 (possibly others) do some extensive work before returning the free disk space after that 1st DIR command. After that, it seems the value is cached somewhere and future DIR commands take way less time.
Typically I'm used to the mem report taking about two to three seconds on MFM -- which seems like a long time but isn't too bad compared to the 15 seconds it was taking. Reformatted as 5 interleave it's back down to the three seconds I expect, so there's a huge difference.

I was thinking about it and 4 to six interleave does make sense for an XT compared to the 1-3 on AT's I was used to -- you've got half the bus width.

I also think I found what happened with it being set to 4 -- debug g=C800:5 defaults on this drive/controller combination (ST-11R) to 4.
 
addendum -- it defaults to 4 using the ROM LLF regardless of the system it's in, just tried it in a AT and a 386. Guess that's why tools like Spinrite are a must have. Funny because optimal on a AT is 4, and on a 386 it's 3...
 
The ST-11M also suggests a value of 4 "for an XT". I think bus width is a red-herring though as the card is 8-bit only.

4 does seem optimal for MFM with the ST11M..., but a 3-sector gap represents less time for the RLL version. Seems strange Seagate didn't think about it really.
 
I think bus width is a red-herring though as the card is 8-bit only.
Compared to what I'm used to seeing (1-3) it's not, as I'm seeing 5's and 6's on AT and 386... which is likely just processing time giving the slight edge as it goes faster. 16 bit card I could probably be doing 2 or 3 with the same drive in a AT/faster.

Guess I got spoiled back in the day by 16 bit 1:1 controllers.
 
4 does seem optimal for MFM with the ST11M..., but a 3-sector gap represents less time for the RLL version. Seems strange Seagate didn't think about it really.

I wonder if it's possible that there's some peculiarity with the Tandy 1000's bus that makes it enough slower than "genuine" XTs to cause FAIL when using these controllers at their rated optimal interleave. It might be an interesting experiment to pull the drive subsystem out of the 1000, stick it in an XT clone, and re-test it for optimal interleave. I vaguely recall that XT hard drive controllers use a DMA channel, is it possible that the "stolen cycles" from the video hardware slow down DMA enough on the 1000s to make the difference?
 
Back
Top