First post, by SirNickity
I have a functional knowledge of how disk interfaces worked in the DOS days. But, for the most part, when I was going through this stuff as a teenager, the hardware and software was all developing at around the same pace so that things worked together without a lot of fuss. I mean, there was some fuss, because it was PC architecture and MS-DOS after all, but for example when the 500MB barrier really became an issue when buying new hard disks, the BIOS guys and DOS had already been working on a solution for a while. You didn't really have to think about it much anymore, there's a good chance the hardware you had would work with the hardware you just got, as long as those pieces were of a similar vintage.
So, going back today, when any period combination of hardware and software is possible, I've had to learn some lessons that I didn't the first time around. I never retrofitted my first PC with a 2GB drive, and I wasn't lugging forward an 80MB Caviar with DOS 5 when I built my 6x86. This knowledge gap became evident when I hit a major milestone with a coding project I had kicking around idly for a couple years -- a complete FAT library in C.
The library reads the MBR, parses partition tables, converts between CHS and LBA, reads FAT (12,16,32 -- with LFN support), and finally can write the critical layout stuff as well - the boot sector, BIOS Parameter Block (DOS 2.0, 3.0, 3.2, 3.3, 3.31, 4.0, and 7.0 styles), the FAT tables, root directory, directory entries, etc. There were a few challenges -- one of which was LFN Unicode support, for which I had to throw together a very rudimentary Unicode support library (I wanted this to be fully self-contained for use on microcontroller-based systems, for e.g.), but probably the trickiest bit was how to code a procedure that, when creating a new volume, would intelligently decide whether to use FAT12, 16, or 32; and what cluster size to use; and handling any number of things automatically along with any number specified by the user. I'll get in to those later, if there are any gearheads like me that find those discussions interesting.
For now, the point of this post is to give myself a place to document all the quirks I ran into when using my own library to create an MBR, initialize a new file system on the primary partition, and then try to install Windows 95 on it. As it turns out, MS-DOS (even 7.0) is extremely picky about the layout. While Linux -- even ScanDisk -- will gladly give a pass to most things that are valid FAT, DOS is a cranky beast.
OK -- Episode One: "Setup could not create files on your startup drive."