• Please review our updated Terms and Rules here

WD 1003 emulation in IDE, and differences between AT-IDE/AT-MFM/XT-IDE/XT-MFM

cr1901

Veteran Member
Joined
Dec 28, 2011
Messages
817
Location
NJ
It is to my understanding that the original IDE specification was meant to emulation the WD-1003 hard drive controller present in the PC/AT... from a BIOS software point of view, there is no difference between AT-MFM drives and AT-IDE drives. However, that seems to be at least in part a misnomer, because the WD-1003 permits a low level format on MFM drives, while there is no such provision for IDE drives (even my oldest 80MB IDE was low level formatted at the factory, even though it uses no drive translation whatsoever). Additionally, unless this was a later addition, IDE drives use different I/O ports compared to MFM drives, and the connector for IDE incorporates a considerable subset of the ISA bus (understandable, since it has to be compatible with an AT-ISA card).

I'm attempting to understand the differences between the XT-ST412 (Xebec XT Controller), AT-ST412 (WD-1003 AT Controller), XT-IDE (8-bit ATA), AT-IDE (16-bit ATA) interfaces from a software programming/hardware implementation POV. This has led me to the following questions:
  • What happens when you try to low level format an IDE drive using the equivalent AT command? I'm NOT about to try and find out!
  • Does XT-IDE emulate a Xebec controller, or was it never properly standardized how XT-IDE worked (barring the XTIDE project- notice the lack of hyphen ;).!)?
  • XT MFM BIOSes permit relocation of the I/O addresses from 320 to 324, IRQs, DMA channel (?), and BIOS routines in Upper Memory from C000 to D000. Does a similar provision exist for relocating any of these resources AT-MFM and AT-IDE BIOSes? What about XT-IDE BIOSes?
  • Adding onto the above point, one of the reasons to support BIOS relocation is to install more than 2 drives in XT machines with a second controller. I just realized that I wouldn't have any idea how to accomplish the same thing with two AT-MFM controllers! How can one add a second AT-MFM controller that doesn't have I/O address, IRQ, and BIOS memory map conflicts, so that more than two drives can coexist, and how does this process differ from XT-MFM? Would the same BIOS be used for all 4 drives?
  • At the hardware level (since it won't differ at the software level- barring the different I/O ports), how does the allocation of resources in more than two drives differ in the AT-MFM BIOS compared to how more than two drives are detected/assigned I/O addresses, IRQs, Upper Memory, etc in AT-IDE? What about comparing AT-MFM to XT-IDE?
  • In the AT-MFM BIOS, I believe it's also possible to use an XT-MFM BIOS by setting the drive type to 15 (another difference between AT-MFM and XT-MFM). Does AT-IDE/XT-IDE also support this? XT-MFM doesn't have a concept of the 15 drive types as I recall- it just supported hardcoded common drive geometries at the time.
  • Is it possible for an AT-IDE and AT-MFM card to coexist in the same machine? Since they use the same BIOSes routines, I imagine the answer is yes. What about XT-IDE/AT-IDE, AT-MFM/XT-MFM, AT-IDE/XT-MFM, etc? Can both BIOSes coexist in these combinations? There is a follow up topic I have regarding this- trying to support 1 SCSI drive and an AT-MFM controller simultaneously. But I'll get to that after some more light is shed on my confusion.

After a rather productive and lengthy conversation with someone knowledgeable about modern chipsets, I just want to fully address this gap in my knowledge. There are a lot of questions, here, I know- feel free to ask for clarification if I did a poor job wording it. And also please, by all means, point me to a resource which can answer my questions if the answers aren't simple! Thanks for your help in advance!
 
It is to my understanding that the original IDE specification was meant to emulation the WD-1003 hard drive controller present in the PC/AT... from a BIOS software point of view, there is no difference between AT-MFM drives and AT-IDE drives. However, that seems to be at least in part a misnomer, because the WD-1003 permits a low level format on MFM drives, while there is no such provision for IDE drives (even my oldest 80MB IDE was low level formatted at the factory, even though it uses no drive translation whatsoever). Additionally, unless this was a later addition, IDE drives use different I/O ports compared to MFM drives, and the connector for IDE incorporates a considerable subset of the ISA bus (understandable, since it has to be compatible with an AT-ISA card).

DIfferent I/O ports? Not for the earliest IDE/ATA drives. They share the same ports with the MFM/AT-style controllers--and registers.

But you forgot one step in the evolution--ESDI. It's difficult for software to tell the difference between (older) IDE/ATA and ESDI drive/controller combo. Many of the basic commands are the same, including IDENTIFY.

XTA (8-bit IDE drives) closely resemble the XT port and register convention. They're an oddball evolutionary dead end. They are not the same as a standard IDE/ATA drive in 8-bit transfer mode.

[*]What happens when you try to low level format an IDE drive using the equivalent AT command? I'm NOT about to try and find out!

Some very early IDE drives would actually perform a format. Most, however, either reject the command as illegal or a no-operation.

[*]Does XT-IDE emulate a Xebec controller, or was it never properly standardized how XT-IDE worked (barring the XTIDE project- notice the lack of hyphen ;).!)?[/quote[

Pretty much, at least in the port usage.

[*]XT MFM BIOSes permit relocation of the I/O addresses from 320 to 324, IRQs, DMA channel (?), and BIOS routines in Upper Memory from C000 to D000. Does a similar provision exist for relocating any of these resources AT-MFM and AT-IDE BIOSes? What about XT-IDE BIOSes?
Generally, the capability exists in the controller--whether or not the BIOS extension does or does not. Many do, but not all.

[*]Adding onto the above point, one of the reasons to support BIOS relocation is to install more than 2 drives in XT machines with a second controller. I just realized that I wouldn't have any idea how to accomplish the same thing with two AT-MFM controllers! How can one add a second AT-MFM controller that doesn't have I/O address, IRQ, and BIOS memory map conflicts, so that more than two drives can coexist, and how does this process differ from XT-MFM? Would the same BIOS be used for all 4 drives?

I don't recall any BIOSes that would support more than one controller installed on the system, but many could work cooperatively in addition to another similar controller with its own BIOS. Certainly, the 5170 BIOS couldn't.


[*]At the hardware level (since it won't differ at the software level- barring the different I/O ports), how does the allocation of resources in more than two drives differ in the AT-MFM BIOS compared to how more than two drives are detected/assigned I/O addresses, IRQs, Upper Memory, etc in AT-IDE? What about comparing AT-MFM to XT-IDE?

Why would a controller require any high-memory resources beyond that needed for the BIOS? Beyond that, it's all software.

[*]In the AT-MFM BIOS, I believe it's also possible to use an XT-MFM BIOS by setting the drive type to 15 (another difference between AT-MFM and XT-MFM). Does AT-IDE/XT-IDE also support this? XT-MFM doesn't have a concept of the 15 drive types as I recall- it just supported hardcoded common drive geometries at the time.

Again, that varied widely between controllers. In particular, later WD controllers were completely flexible in terms of the user being able to specify drive geometry.

[*]Is it possible for an AT-IDE and AT-MFM card to coexist in the same machine? Since they use the same BIOSes routines, I imagine the answer is yes. What about XT-IDE/AT-IDE, AT-MFM/XT-MFM, AT-IDE/XT-MFM, etc? Can both BIOSes coexist in these combinations? There is a follow up topic I have regarding this- trying to support 1 SCSI drive and an AT-MFM controller simultaneously. But I'll get to that after some more light is shed on my confusion.

Provided port and interrupt resources can be reassigned, why not? It's all software.
 
In the AT-MFM BIOS, I believe it's also possible to use an XT-MFM BIOS by setting the drive type to 15
Most SETUP programs for the IBM AT do not allow '15' to be set as the hard drive type number. The technical reason is [here].

I think that what you heard/read was '0', not '15'.

In the IBM AT's SETUP, if you set the drive C type number to zero, then the IBM AT BIOS knows that there is no hard drive 0 on its controller that it needs to control.
In the IBM AT's SETUP, if you set the drive D type number to zero, then the IBM AT BIOS knows that there is no hard drive 1 on its controller that it needs to control.

In that scenario (both type numbers set to 0), the situation becomes very much like that of an XT-class machine: hard drive controllers added need to have a BIOS expansion ROM that will control the drive/s attached to it, or BIOS-less hard drive controllers added require a suitable driver to be loaded (thus, a need to boot from A:)

Is it possible for an AT-IDE and AT-MFM card to coexist in the same machine? Since they use the same BIOSes routines, I imagine the answer is yes.
Yes. See the post [here].
 
Wow... you answered all my points beautifully o.0;... I don't really have many other questions after reading your response. That said...

Some very early IDE drives would actually perform a format. Most, however, either reject the command as illegal or a no-operation.
On said drives which will actually perform the format, does the format brick the drive?

XTA (8-bit IDE drives) closely resemble the XT port and register convention. They're an oddball evolutionary dead end. They are not the same as a standard IDE/ATA drive in 8-bit transfer mode.
So 16-bit and 8-bit compatible IDE drives switch between the XT port convention and AT port convention? Does this mean that the XTIDE project is essentially the only AT-IDE compatible 8-bit ISA controller in existence?

Generally, the capability exists in the controller--whether or not the BIOS extension does or does not. Many do, but not all.
...
Again, that varied widely between controllers. In particular, later WD controllers were completely flexible in terms of the user being able to specify drive geometry.
Wait... relocation is an int 0x13 BIOS extension?

Additionally, did any AT-MFM controllers ever come with its own BIOS built into the controller? If not, then I presume that the original IDE specification only supported up to two drives as well (not 4 that would become common with PATA/UDMAx)? It seems odd to me that IBM/WD weren't prepared for people having more than 2 hard drives in their system when "generic" XT controllers supporting Xebec's (or was it WD who did it first) command set could be set as primary or secondary hard drive adapter.

It feels like that the AT BIOS should've been able to handle all 4 drives at once, every 16-bit controller accepts the same command set (just about anyway), rather than being forced to mixed 16-bit and 8-bit controllers.

EDIT: In light of modem7's post, if and IDE and MFM controller can coexist- which is up to 4 drives using the same BIOS- then 4 MFM drives should also work fine. Wonder why the AT can't handle it?...

In the IBM AT's SETUP, if you set the drive C type number to zero, then the IBM AT BIOS knows that there is no hard drive 0 on its controller that it needs to control.
In the IBM AT's SETUP, if you set the drive D type number to zero, then the IBM AT BIOS knows that there is no hard drive 1 on its controller that it needs to control.

In that scenario (both type numbers set to 0), the situation becomes very much like that of an XT-class machine: hard drive controllers added need to have a BIOS expansion ROM that will control the drive/s attached to it, or BIOS-less hard drive controllers added require a suitable driver to be loaded (thus, a need to boot from A:)
What about the case where one drive is type 0, but the other isn't? And drivers for hard drive controllers loaded into DOS? Can't say I've heard of that before tonight.

EDIT2: I gave this a bit more thought: How can software automatically decide to use the standard ports 320-323 or use PIO*, UDMA, etc? From my limited understanding, later IDE modes don't attempt to remain compatible with the WD-1003 (again, see *). That may be the reason that secondary onboard IDE and primary MFM can coexist. Different I/O ports are used for each- one set for MFM, the other for IDE/(P)ATA modes. But that doesn't explain them all sharing the same BIOS.

*If the top of this page is any indication- which seems to be directly from menuconfig in the Linux kernel- what became ATA-1 (superset of IDE) and what was the original IDE (ST-506 controller onboard hard drive) were two different standards. I'm under the impression that PIO is a transfer mode using I/O ports separate from the original MFM ports (0x1F0 through 0x1F7, and 0x3F6, according to the Registers section of this page), but still using I/O ports all the same a la MFM/ST-506. However, they got at least one portion of the description wrong (ST-506 existed before 1984), so I'm not 100% sure of its accuracy.
 
Last edited:
EDIT: In light of modem7's post, if and IDE and MFM controller can coexist- which is up to 4 drives using the same BIOS- then 4 MFM drives should also work fine. Wonder why the AT can't handle it?...
When the IBM AT was released, the best hard drive option available (via IBM) was two full-height drives. I guess that based on that, the BIOS authors figured that there was no point in adding BIOS support for a secondary hard drive controller.
 
On said drives which will actually perform the format, does the format brick the drive?

That was always the rumour... though I never knew anyone brave enough to try it (HDDs were expensive back then).

So 16-bit and 8-bit compatible IDE drives switch between the XT port convention and AT port convention?

Re 8-bits; there are several things going on here. Everything obviously started as 8-bit, and ATA specification (i.e. IDE) updated the data register (only) to 16-bits width, so doubling throughput. ATA-2 later bought in an 8-bit mode (subsequently deleted in ATA-3 but retained in CompactFlash specs) in which everything works exactly the same *except* that the data register is accessed as 8-bits.

However, there are at least two variants of 8-bit standards on top of that which use the IDE style 40-pin keyed plug. One variation has two CS lines (implemented, IIRC, on some PS/2 machines), and the other has only one. The pinouts are incompatible notwithstanding that difference.

Also, on its way through the various standards some bits in the status register were re-purposed, which I think is why my TRS-80 IDE adapter won't boot on a Tandy 4P (whos BIOS is expecting WD1010 controller).

Does this mean that the XTIDE project is essentially the only AT-IDE compatible 8-bit ISA controller in existence?

There was at least one at the time. The issue is that since (ignoring ATA-2) the data register presents 16-bits on every bus cycle, a latch is needed to store half the data on each cycle and then be retrieved (or sent) with another cycle.
 
On said drives which will actually perform the format, does the format brick the drive?

That was the rumor for at least one vendor. I never met anyone who had enough cojones to try it, though. Drives were expensive.

So 16-bit and 8-bit compatible IDE drives switch between the XT port convention and AT port convention? Does this mean that the XTIDE project is essentially the only AT-IDE compatible 8-bit ISA controller in existence?

The port convention remains the same; only the data transfer mode moves between and 8-bit path and a 16-bit path. CF cards still do that. The XTIDE is by no means the only such controller--back in the day, there were a few other vendors. Acculogic was one such manufacturer. It made a bit of sense--XTA drives were discontinued by most manufacturers, but there were still quite a few 8-bit ISA bus systems out there.

Wait... relocation is an int 0x13 BIOS extension?

Not quite what I was implying. Some controllers could be jumpered for alternate port and IRQ settings and some BIOSes could accommodate that.[/quote]


Additionally, did any AT-MFM controllers ever come with its own BIOS built into the controller? If not, then I presume that the original IDE specification only supported up to two drives as well (not 4 that would become common with PATA/UDMAx)? It seems odd to me that IBM/WD weren't prepared for people having more than 2 hard drives in their system when "generic" XT controllers supporting Xebec's (or was it WD who did it first) command set could be set as primary or secondary hard drive adapter.

It feels like that the AT BIOS should've been able to handle all 4 drives at once, every 16-bit controller accepts the same command set (just about anyway), rather than being forced to mixed 16-bit and 8-bit controllers.

Well, one limitation is the structure of the controller registers. The SDH register in particular has but one bit (4) for drive select.

And for those who needed lots of storage, there was always SCSI.
 
Yea, apparently I got carried away...

Yea, apparently I got carried away...

Sorry guys, but I edited my post multiple times and didn't realize so many new responses were posted... I'll just move my edits down here:

EDIT: In light of modem7's post, if and IDE and MFM controller can coexist- which is up to 4 drives using the same BIOS- then 4 MFM drives should also work fine. Wonder why the AT can't handle it? (answered already by modem7- ignore the previous q)...

modem7 said:
In the IBM AT's SETUP, if you set the drive C type number to zero, then the IBM AT BIOS knows that there is no hard drive 0 on its controller that it needs to control.
In the IBM AT's SETUP, if you set the drive D type number to zero, then the IBM AT BIOS knows that there is no hard drive 1 on its controller that it needs to control.

In that scenario (both type numbers set to 0), the situation becomes very much like that of an XT-class machine: hard drive controllers added need to have a BIOS expansion ROM that will control the drive/s attached to it, or BIOS-less hard drive controllers added require a suitable driver to be loaded (thus, a need to boot from A
What about the case where one drive is type 0, but the other isn't? And drivers for hard drive controllers loaded into DOS? Can't say I've heard of that before tonight.

EDIT2: I gave this a bit more thought: How can software automatically decide to use the standard ports 320-323 or use PIO*, UDMA, etc? From my limited understanding, later IDE modes don't attempt to remain compatible with the WD-1003 (again, see *). That may be the reason that secondary onboard IDE and primary MFM can coexist. Different I/O ports are used for each- one set for MFM, the other for IDE/(P)ATA modes. But that doesn't explain them all sharing the same BIOS.

*If the top of this page is any indication- which seems to be directly from menuconfig in the Linux kernel- what became ATA-1 (superset of IDE) and what was the original IDE (ST-506 controller onboard hard drive) were two different standards. I'm under the impression that PIO is a transfer mode using I/O ports separate from the original MFM ports (0x1F0 through 0x1F7, and 0x3F6, according to the Registers section of this page), but still using I/O ports all the same a la MFM/ST-506. However, they got at least one portion of the description wrong (ST-506 existed before 1984), so I'm not 100% sure of its accuracy.
END of previous EDITS


Take a look at [here], some information on the ST157A-1 drive.
Read the 'CMOS Configuration' section.
This is from Segate's FTP server, it appears. I find it interesting that it mentions DMA as early as 1990- since I presume it's talking about 'bus master DMA' of later ATA variants on the PCI bus (since ISA doesn't support bus mastering properly) and not the 8237 DMA used by (some?) MFM controllers.
 
Last edited:
What about the case where one drive is type 0, but the other isn't? And drivers for hard drive controllers loaded into DOS? Can't say I've heard of that before tonight.
Please don't add questions by editing existing posts. I only came across your EDIT because I scrolled back through the posts.

What about the case where one drive is type 0, but the other isn't?
So, C: drive type set to say, 2, and D: drive type set to 0.
The 5170 BIOS will only look for hard drive 0 on its controller.

And drivers for hard drive controllers loaded into DOS? Can't say I've heard of that before tonight.
Read the story at http://selectric.org/old5150/index.html
 
Please don't add questions by editing existing posts. I only came across your EDIT because I scrolled back through the posts.
I already asked for forgiveness... what more do you want :(?
 
For what it is worth, the XT used different values than the AT.
The AT was almost identical to the original WD1000 ( not to be confused
with the WD100x ). The XT is the oddball. I written code for an XT controller
but not for a 8086. I used it with my NC4000.
Dwight.
 
Back
Top