liam_on_linux: (Default)
Someone asked me if I could describe how to perform DOS memory allocation. It's not the first time, either. It's a nearly lost art. To try to illustrate that it's a non-trivial job, I decided to do something simpler: describe how DOS allocates drive letters.

I have a feeling I've done this before somewhere, but I couldn't find it, so I tried writing it up as an exercise.

Axioms:

  • DOS only understands FAT12, FAT16 and in later versions FAT32. HPFS, NTFS and all *nix filesystems will be skipped.

  • We are only considering MBR partitioning.

So:

  • Hard disks support 2 partition types: primary and logical. Logical drives must go inside an extended partition.

  • MBR supports a legal max of 4 primaries per drive.

  • Only 1 primary partition on the 1st drive can be marked "active" and the BIOS will boot that one _unless_ you have a *nix bootloader installed.

  • You can only have 1 extended partition per drive. It counts as a primary partition.

  • To be "legal" and to support early versions of NT and OS/2, only 1 DOS-readable primary partition per drive is allowed. All other partitions should go inside an extended partition.

  • MS-DOS, PC DOS and NT will only boot from a primary partition. (I think DR-DOS is more flexible and  I don't know for FreeDOS.)

Those are our "givens". Now, after all that, how does DOS (including Win9x) assign drive letters?

  1. It starts with drive letter C.

  2. It enumerates all available hard drives visible to the BIOS.

  3. The first *primary* partition on each drive is assigned a letter.

  4. Then it goes back to the start and starts going through all the physical hard disks a 2nd time.

  5. Now it enumerates all *logical* partitions on each drive and assigns them letters.

  6. So, all the logicals on the 1st drive get sequential letters.

  7. Then all the logicals on the next drive.

  8. And so on through all logicals on all hard disks.

  9. Then drivers in CONFIG.SYS are processed and if they create drives (e.g. DRIVER.SYS) those letters are assigned next.

  10. Then drivers in AUTOEXEC.BAT are processed and if they create drives (e.g. MSCDEX) those are assigned next.

So you see... it's quite complicated. :-)

Assigning upper memory blocks is more complicated.

NT changes this and I am not 100% sure of the details. From observation:

  • NT 3 did the same, but with the addition of HPFS and NTFS (NT 3.1 & 3.5) and NTFS (3.51) drives.

  • NT 4 does not recognise HPFS at all but the 3.51 driver can be retrofitted.

  • NT 3, 4 & 5 (Win2K) *require* that partitions are in sequential order.

Numbers may be missing but you can't have, say:
[part № 1] [part № 2] [part № 4] [part № 3]

They will blue-screen on boot if you have this. Linux doesn't care.

Riders:

  1. The NT booloader must be on the first primary partition on the first drive.

  2. (A 3rd party boot-loader can override this and, for instance, multi-boot several different installations on different drives.)

  3. The rest of the OS can be anywhere, including a logical drive.

NT 6 (Vista) & later can handle it, but this is because MS rewrote the drive-letter allocation algorithm. (At least I think this is why but I do not know for sure; it could be a coincidence.)

Conditions:

  • The NT 6+ bootloader must be in the same drive as the rest of the OS.

  • The bootloader must be on a primary partition.

  • Therefore, NT 6+ must be in a primary partition, a new restriction.

  • NT 6+ must be installed on an NTFS volume, therefore, it can no longer dual-boot with DOS on its own & a 3rd party bootloader is needed.

NT 6+ just does this:

  1. The drive where the NT bootloader is becomes C:

  2. Then it allocates all readable partitions on drive 1, then all those on drive 2, then all those on drive 3, etc.

So just listing the rules is quite complicated. Turning into a step-by-step how-to guide is significantly longer and more complex. As an example, the much simpler process of cleaning up Windows 7/8.x/10 if preparing to dual-boot took me several thousand words, and I skipped some entire considerations to keep it that "short".

Errors & omissions excepted, as they say. Corrections and clarifications very welcome. To comment, you don't need an account — you can sign in with any OpenID, including Facebook, Twitter, UbuntuOne, etc.
liam_on_linux: (Default)
My previous post was an improvised and unplanned comment. I could have structured it better, and it caused some confusion on https://lobste.rs/

Dave Cutler did not write OS/2. AFAIK he never worked on OS/2 at all in the days of the MS-IBM pact -- he was still at DEC then.

Many sources focus on only one side of the story -- the DEC side, This is important but only half the tale.

IBM and MS got very rich working together on x86 PCs and MS-DOS. They carefully planned its successor: OS/2. IBM placed restrictions on this which crippled it, but it wasn't apparent at the time just how bad this would turn out to be.

In the early-to-mid 1980s, it seemed apparent to everyone that the most important next step in microcomputers would be multitasking.

Even small players like Sinclair thought so -- the QL was designed as the first cheap 68000-based home computer. No GUI, but multitasking.

I discussed this a bit in a blog post a while ago: http://liam-on-linux.livejournal.com/46833.html

Apple's Lisa was a sideline: too expensive. Nobody picked up on its true significance.

Then, 2 weeks after the QL, came the Mac. Everything clever but expensive in the Lisa stripped out: no multitasking, little RAM, no hard disk, no slots or expansion. All that was left was the GUI. But that was the most important bit, as Steve Jobs saw and nobody much else did.

So, a year later, the ST had a DOS-like OS but a bolted-on GUI. No shell, just a GUI. Fast-for-the-time CPU, no fancy chips, and it did great. It had the original, uncrippled version of DR GEM. Apple's lawsuit meant that PC GEM was crippled: no overlapping windows, no desktop drive icons or trashcan, etc.

Read more... )
liam_on_linux: (Default)

Windows NT was allegedly partly developed on OS/2. Many MSers loved OS/2 at the time -- they had co-developed it, after all. But there was more to it than that.

Windows NT was partly based on OS/2. There were 3 branches of the OS/2 codebase:

[a] OS/2 1.x – at IBM’s insistence, for the 80286. The mistake that doomed OS/2 and IBM’s presence in the PC industry, the industry it had created.

[b] OS/2 2.x – IBM went it alone with the 80386-specific version.

[c] OS/2 3.x – Portable OS/2, planned to be ported to multiple different CPUs.

After the “divorce”, MS inherited Portable OS/2. It was a skeleton and a plan. Dave Cutler was hired from DEC, which refused to allow him to pursue his PRISM project for a modern CPU and successor to VMS. Cutler got the Portable OS/2 project to complete. He did, fleshing it out with concepts and plans derived from his experience with VMS and plans for PRISM.

Read more... )

April 2025

S M T W T F S
  1 23 45
6789101112
13141516171819
20212223242526
27282930   

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Apr. 23rd, 2025 01:35 pm
Powered by Dreamwidth Studios