VOGONS


First post, by Pitou

User metadata
Rank Newbie
Rank
Newbie

Hello,
I'm trying to find a way to LLF an ESDI hard disk using 256-bytes sectors. I have an old PC running DOS with a WD1007-WAH ESDI controller card.
I used WDFMT.exe from western digital in dos to low level it using alternate sector etc... and it worked fine. I could install dos and windows on it

Anyone knows a way to achieve that?
Thank you.
Pitou!

Reply 1 of 11, by Deunan

User metadata
Rank Oldbie
Rank
Oldbie

WD1007-WAH works only in hard sector mode, so it depends on the disk in question. Your HDD must have unformatted bytes per sector > 512, and sectors per track >= 35 as well. I guess it must also respond to bytes per sector command, which is optional, to change current 256-byte setting. However if the HDD was made to have more but smaller sectors you are out of luck with this one.

Not all WD1007-WAH cards have BIOS extension ROM. If yours does you need to access it (via DEBUG for example) and it should provide both some HDD identification/query options as well as LLF. At least the LLF will be available and it will simply fail if the drive is not capable of having 512 bytes per sector.

Here's a manual that explains how to run the ROM code and it also mentions some software alternative for ROM-less cards: https://www.minuszerodegrees.net/manuals/West … ers%20Guide.pdf

Reply 2 of 11, by Pitou

User metadata
Rank Newbie
Rank
Newbie

Thanks for your answer @Deunan. I already went through all the docs I could find on that card. Yes I'm aware of the bytes per sector optional command, but don't know how to test it. Actually I'm willing to look at the firmware code to see if I could modify it. Same for the WDFMT.exe file.

I don't have the ROM on my card and can't find any image of it to burn an EPROM. But I'm not sure it'll do more than the WDFMT util.
If you have any other idea please let me know.
Pitou!

Reply 3 of 11, by Pitou

User metadata
Rank Newbie
Rank
Newbie

Might be a bit crazy, but I'm thinking of using a Teensy to control the drive, by just implementing the basic commands

Reply 4 of 11, by Deunan

User metadata
Rank Oldbie
Rank
Oldbie

Hm, I've read your fist post again and now I think I misunderstood your question. So you already have a DOS-compatible format on this HDD? With 512-byte sectors, which was done with WDFMT util? But you want to have 256 byte sectors instead?

In that case WD1007-WAH is not going to help you much because I'm pretty sure all the code, be it WDFMT or ROM extension, will be hard-coded to 512 bytes. Since this is what IBM PC DOS wants.

Using Teensy or some other device (like RPi with 5V level shifter) would work, or at the very least you would be able to issue the bytes per sector command and see what the result it, is it supported or not. But that alone doesn't really help you unless you have, or build it yourself, a controller capable of working with ESDI drives. The HDD will format the track and put in sector headers on it (assuming the command works) but that's it. You now need hardware to read and write the sectors, and that is timing critical like in MFM/RLL mode, and you need to have some sort of CRC or ECC at the end of the sector to be able to at least verify the data - or repair it. Otherwise you'll never know if the data you read from HDD is actually correct or not. This is not tested by the HDD, it just spits out the unformatted sector bits as-is.

I don't know what particular controller chip the WD1007-WAH uses. Perhaps it's well documented? Then you could write some code on PC rather than use your own hardware like Teensy, and that would actually let you LLF, read and write the HDD - if the chip itself supports sector sizes other than 512 bytes, which it might. You don't have to wory about read/write timings, you just select if you want 4 or 7 bytes ECC and add 256 to it, and you have your minimal unformatted sector size.

EDIT: Forgot the sector data markers, and headers. So actually you'll need quite a lot more than 256 bytes plus ECC. Simple query or command issue can be done with software and basic HW like Teensy but proper read/write would need PLD/FPGA or preferably a dedicated ASIC.

Keep in mind that each controller chip does things differently. If you LLF it with WD chip it will not work with other ones. Some chips might have CRC and ECC. Different polynomials. Maybe even different bit order. That's basically the same problem as with MFM/RLL.

One last idea, the ESDI uses bit clock. If you were to try an build your own controller hardware then, if the HDD doesn't support shorter sectors, you have 2 choices:
- Use 512 byte sectors but only store 256 bytes in them. The rest is unused. Tons of wasted platter space but it will work.
- Use bit doubling, store same bit 2 times. Again you loose half of the HDD space but get longer bit pulses on read, which would be easier to work with.

I never did any low-level work on ESDI (I have some experience with MFM and RLL). I'm not even sure how to work with the optional SECTOR/BYTE signals. I hope there is a jumper on the HDD to configure if for one or the other? Because for your own hardware you'd want it set to SECTOR output. BYTE clock is kinda useless in this scenario.

Reply 5 of 11, by Horun

User metadata
Rank l33t++
Rank
l33t++

Good write up Deunan ! The main WD1007-WAH ASIC is a WD12C00 same as the WD1006-WAH but with diff bios if that helps figure out if 256byte sectors allowed proper. Only OS that use 256byte is CP/M afaik.....

Hate posting a reply and then have to edit it because it made no sense 😁 First computer was an IBM 3270 workstation with CGA monitor. Stuff: https://archive.org/details/@horun

Reply 6 of 11, by Pitou

User metadata
Rank Newbie
Rank
Newbie

Yes great explanation Deunan. Very clear. Thanks!
I already did some other projects with the Pi Pico using level shifters.
I'll see what I can do. Here are more info on why I'm trying to achieve that.

I own an IBM 5363 (mini mainframe). The hard disk in there was formatted using 256 bytes sector because that's what the OS needs (called SSP). However it seems that these drives were pre-formatted by IBM internally as there is no option in all software I found to do the fomat. When I try to re-install the OS it gives me an error that the "alternate sector table" is not found, related to spare sectors.

Of course I don't know how to format those sectors as I don't know how the controller in there does it. However I should receive a binary dump from another working system soon. I'll try to analyze the bytes and hope to find the way it does it.

The mistake I did was to format the drive in my PC using the WD card. I just wanted to learn and play with ESDI stuff. I never realized that I couldn't re-format it in the IBM later on.

Reply 7 of 11, by Deunan

User metadata
Rank Oldbie
Rank
Oldbie
Pitou wrote on 2025-03-12, 13:40:

I own an IBM 5363 (mini mainframe). The hard disk in there was formatted using 256 bytes sector because that's what the OS needs (called SSP). However it seems that these drives were pre-formatted by IBM internally as there is no option in all software I found to do the fomat. When I try to re-install the OS it gives me an error that the "alternate sector table" is not found, related to spare sectors.

Such a cool project. Got me interested a bit more so I did some extra reading on ESDI.
It might be that the controller in the IBM machine is unable to perform a LLF. It can only read and write data part of the sector, but not the headers and syncs, gaps, etc. So it might be more than just lacking software.

Pitou wrote on 2025-03-12, 13:40:

Of course I don't know how to format those sectors as I don't know how the controller in there does it. However I should receive a binary dump from another working system soon. I'll try to analyze the bytes and hope to find the way it does it.

The mistake I did was to format the drive in my PC using the WD card. I just wanted to learn and play with ESDI stuff. I never realized that I couldn't re-format it in the IBM later on.

So... depending on the data you receive it might not be that useful in re-creating the HDD. Yes it's a pity you LLFed that drive with PC controller.

Turns out ESDI drives can work in two modes: "smart" serial mode or "dumb" step mode. The dumb mode is just a copy of MFM/RLL control scheme with some minor changes and of course NRZ being used, at higher clock rates than MFM or RLL bitstream. The smart mode lets you query the drive for its parameters and set up some stuff.
The drive itself migt also support hard sector or soft sector operation. Perhaps both but it has to be selectable somehow in that case. Soft sector mode is very much like MFM/RLL, you need to put the entire track structure on the media yourself (well, via the controller chip) and handle it all during reading and writing. But it allows any kind of data being stored. It doesn't even have to be sectors. The hard sector mode is a bit more confusing:
- There is the fixed sector drive which is basically set for specific sector length by the manufacturer and it cannot be changed. You can only store shorter sectors in there at the cost of wasting track space. The sector index pulse timing is set in stone.
- And there seems to be a mechanism, via the set bytes per sector command, that should change the sector pulse timing to reflect the new sector length. Sadly this isn't explained well in the docs, some experimenting would be required.

To add insult to injury the HDD can output either sector pulses (of which the first is missing, not sure why but that should be taken from track index pulse instead) or byte pulses. These you need to count yourself, in the controller, to know (more or less because the phase between this pulse and reference clock is not guaranteed) where you are inside the track. And I still do not know how and if that mode is selectable, or set by the HDD manufacturer.

Long story short to re-create a proper HDD format for that IBM machine you migh need a working HDD and some custom FPGA based low-level dumper to get the bitstream out of it. And then to write that bitstream to another ESDI drive that can be configured for this type of operation in the first place. So it's really unfortunate that you erased the HDD you had with LLF, as this would be (even if it was causing troubles) a good source of information. Maybe it would be even possible to repair the format on this HDD by comparing it to a working one, and thus keep the original format and the data on it. But that is not possible anymore.

A high-level sector dump from a working machine is not going to help you. It's of some use, to know what should be written to the HDD, but not how it's supposed to be written. You really need to know how long the sync fields are, and the gaps, and what is the sync pattern of the address mark and the data field (those usually are different patterns). How the sector header address field is structured. What checksums are used. If the HDD controller in the IBM machine is simply unable to write headers, only data fields and checksums, then you can't use it for LLF anyway. So it would have to be done with external hardware - which can be built but it's not going to be trivial. Since you need to be clock cycle perfect with the bitstream, at 10MHz or higher, you can't really do it properly unless you use PLD or FPGA. Maybe you could read the HDD with fast enough sampling rate but certainly not write a copy of it. I bet IBM made good money on selling these "special" HDDs, why give the tools to users for free...

Reply 8 of 11, by Pitou

User metadata
Rank Newbie
Rank
Newbie

Again very interesting info Deunan. Thanks!
I understand the complexity of making a homemade controller. Some guys at VCFED started a project using FPGA and VHDL and they can read the disk so far. No write yet. One is trying to make an "emulator". These drives will fail eventually for sure.
(https://forum.vcfed.org/index.php?threads/ibm … sp-5-1.1249091/)

I should work with the WD1007 and try to "talk" to the drive. This document is very interesting (see attached, page 14 in particular). I might play with it and the debug from dos or writing a simple C program for dos. I also disassembled the WDFMT.exe file.

I understand that the binary dump has to be low level, otherwise I'll get only the payload data.
At least I know the drive is capable of 256 or 512 bytes sector. I think raw sector is 620ish bytes. It's a 320meg hard disk, in the PC I can format full 320meg but in the IBM it sees around 115meg. probably by querying the drive and assuming 256 bytes and doing the math.

I'm adding pictures, documents and my personal notes about the IBM 0671-E15 if that can help. I know my notes are not 100% accurate. That's what I have found so far.
Sure IBM were probably charging a lot of money for all this!

Pitou!

Reply 9 of 11, by Pitou

User metadata
Rank Newbie
Rank
Newbie

some more...

Reply 10 of 11, by Deunan

User metadata
Rank Oldbie
Rank
Oldbie

That's a nice, big HDD. I like those. Sadly yes, everything mechanical will die at some point and these drives are no exception.

I don't understand why there are switches that change the head count, possibly to accomodate machines that could not work with more heads for some reason? Or to better emulate some older drive model? BTW you probably already know that on ESDI the drive select count starts with 1 - because 0 is reserved for no selection.

Most importantly there is a switch that causes the drive to report 68 sectors - I think that it means the HDD does not support set bytes per sector command but it does allow one of these 2 configurations. That might be a good thing, less stuff to worry about. Just flip the switch and it will be IBM compatible again (if you can write LLF to it). That being said keep trying to talk to the drive via WD1007 or some custom HW. The more you know about it the better.

Reply 11 of 11, by Pitou

User metadata
Rank Newbie
Rank
Newbie

Thanks very much for your input and support. Enough talking and let's back to work!
I'll keep you posted for sure!
Pitou!