There’s Another Possibility

Four years ago we pondered why on Earth a DOS floppy boot sector might start with 69h, supposedly a “direct jump” opcode. Which is the IMUL instruction on 80186 and later, and not documented on 8086. In the meantime, it turned out that one of the basic assumptions was invalid: The boot sector does not have to begin with executable code, and in fact need not contain any executable code at all.

This goes back to a distinction which used to be important but over time got all but forgotten: There is a difference between a “DOS compatible” and an “IBM compatible” (or PC compatible) machine. DOS-compatible systems are a superset of IBM-compatible ones. In the early to mid-1980s, there was a fairly large class of 8086/8088 machines which used DOS (and therefore, FAT-formatted floppies) but were not PC compatible. In fact DOS-compatible machines came first, in the form of SCP’s S-100 bus systems running MS-DOS, née 86-DOS, predating the original IBM PC.

It was far from obvious in the early 1980s just how dominant the IBM PC and derived designs would become. A number of vendors offered 8086/8088 machines running DOS (often DOS 2.11) but not using IBM-style ROM BIOS and not necessarily using even remotely IBM-compatible hardware and peripherals. Some of the better known examples were the DEC Rainbow 100 (dual-chip Z80/8088), the Apricot PC, or the NEC APC-III.

Most of the DOS-compatible machines quickly gave way to PC-compatible ones, simply because of the immense wealth of software and hardware produced for PCs (and not for the DOS compatibles). One of the notable exceptions was the NEC PC-98 series whose last model was introduced in 2000. NEC’s PC-98 served the Japanese market, to a significant extent insulated from most of the rest of the world until the Windows 9x era. Another Japanese DOS compatible system was Fujitsu’s FM Towns, introduced as late as 1989 and built until 1997.

There was of course yet another, even more distant class of a system, which one might call “FAT compatible”. For example the Atari ST was built around a Motorola 68000 CPU, but its operating system (TOS) used FAT-formatted floppies.

What does this have to do with DOS boot sectors? A lot. All these systems used FAT-formatted floppies, either optionally or exclusively. They also showed that the FAT filesystem is reasonably flexible. Around 1981, SCP used 8″ single-and double-sided FAT floppies with 128-byte and 1024-byte sectors. Apricot used single-sided 3½″ floppies with 512-byte sectors and 70 tracks. FM Towns used 3½″ floppies with 1024-byte sectors. There were lots of possibilities. Continue reading

Posted in DOS, Floppies | 57 Comments

AMD64 APM Archive Online

Thanks to Konstantin Belousov, the OS/2 Museum AMD64 APM (Architecture Programmer’s Manual) is now available online. Big thanks to blog readers who recently supplied several missing revisions of the documents.

This is a nearly complete archive of all published AMD64 APM documentation starting with April 2003, currently up to and including December 2017. Missing is Volume 2 (System Programming) revision 3.16 from June 2010 which only lasted a week or two before being replaced by revision 3.17.

Possibly missing is Volume 6 (“new instructions”) revision 3.02. Why “possibly”? Because it’s not clear if that revision was public, and chances are it was not.

Also included are several pre-release revisions from 2002, before the first AMD64 Opteron CPUs were released in April 2003. Again it is very unclear which revisions were public because the pre-release documents have no revision history. Note that the pre-release documents refer to the AMD x86-64 Architecture rather than AMD64 Architecture.

Missing manuals are always welcome!

Posted in AMD, AMD64, Documentation | 2 Comments

Undocumented 8086 Opcodes, Part I

This is a guest post by Raúl Gutiérrez Sanz

This multi-part document is about undocumented 8086 processor opcodes and their behavior. Most of the document will likely apply to the 8088 processor as well, but this has not been verified. It doesn’t apply to any other processor/controller, like the 80186, 80286 or newer, as they use the undocumented 8086 opcodes to implement new instructions. For the same reason, it does not apply to NEC V20/V30 processors either. And even when 8086 opcodes remain undocumented on new processors, their behavior is unlikely to be the same (not least because starting with the 80186, undefined opcodes generally raise an invalid instruction exception).

Sometimes it is not easy to determine which opcodes are documented and which ones are not, because some of them appeared or disappeared at some point from the official Intel documentation. So, while most opcodes listed in this document have never been officially documented, you may find some of them in certain Intel documents, or at least in some versions.

On the 8086, all undocumented opcodes do something, but typically not something very useful. After all, if they did something useful, they would have been documented.

This document will be split into three sections:

  • Section I—Holes In the Opcode Map
  • Section II—Holes In the Addressing Scheme
  • Section III—”Nonsense” Instruction/Operand Combinations

For some undocumented features, the categorization is admittedly arbitrary.

Continue reading

Posted in 8086/8088, Intel, Undocumented | 13 Comments

How Fast Again?

Or, Yet Another Wikipedia Mystery

Looking for something on the Wikipedia USB page, a detail caught my eye. In the version history section, both the table and the text claim that the original 1996 USB 1.0 specification defined 1.5 Mbps low speed transfer rate, and the 1998 USB 1.1 update added the much faster 12 Mbps full speed. I would like to say that that’s not how I remember it, but the truth is that I had no trouble completely ignoring the existence of USB until 2003 or so. Anyway, it certainly did not match what I had read elsewhere.

Finding authoritative information about the prehistory of USB is remarkably difficult for something that happened in the (early) age of the Internet. But finding a copy of the actual USB 1.0 specification is not that difficult. Sure enough, both full and low speed is defined there, so Wikipedia once again proves a questionable source of information. What mystifies me in this case is not so much how it’s possible that Wikipedia is wrong (with so much information, some of it is bound to be wrong) but how this particular error crept in. It’s something that is reasonably easy to verify, but more importantly, why would anyone even think that only the 1.5 Mbps low speed was originally defined? It’s not just a typo, it’s very specific misinformation. Continue reading

Posted in Documentation, USB | 36 Comments

AMD64 Manual Vol. 3 Rev. 3.24 Anyone?

AMD tricked me. After not updating anything for months, they updated the AMD64 documentation and not only that, they updated Volume 3 (instruction reference) twice within a few weeks. First to revision 3.24 in November, then 3.25 in December. I missed 3.24 and now it can’t be found anywhere! It’s all the more annoying because it’s the first edition of Volume 3 of AMD’s APM that I missed since April 2003.

The manuals contain change bars indicating modifications relative to the previous edition. Figuring out what changed between 3.23 and 3.25 is exponentially more difficult than figuring out what changed between 3.23 and 3.24, and then again between 3.24 and 3.25. That’s why having all revisions is extremely useful.

Might anyone have stashed a copy of revision 3.24 of the AMD64 APM Volume 3 before it vanished? I’d be very grateful for a copy.

Update: The 3.24 manual has been successfully located. Thank you!

Posted in AMD, Documentation | 3 Comments

How Apple Created Hackintosh, Part II

There is every indication that throughout the early 2000s, Apple internally built and ran all of OS X on x86 PCs (it’s also something Steve Jobs himself mentioned in 2005). Otherwise why would Apple have x86 drivers for AC’97 audio or Intel graphics chips (e.g. Intel 830 and 915 found in Darwin 8.0.1) that could only be found in Intel PCs and were not in any way essential for Darwin? Keeping the x86 support alive was Apple’s insurance policy in case PowerPC was no longer viable—and by the mid-2000s, it wasn’t. IBM’s 64-bit G5 was a good performer, but with no chance to be used in laptops, and the Motorola/Freescale G3 and G4 CPUs fell further and further behind in performance.

An x86-based plan B made perfect sense. This was in fact reported in 2002 and it was known that the project to keep OS X going on Intel was called Marklar.

When the Apple DTS (Developer Transition System, also called DTK or Developer Transition Kit) appeared in June 2005, it didn’t take much to remove the bits that were used to bolt OS X 10.4.1 to the DTS. In mid-August 2005, there was already a “deadmoo” torrent (bovinity anyone?) with OS X Tiger adapted to run in a VMware VM. All it took was combining a few pieces of Darwin with the DTS release of OS X, and there was quite a bit of source code available. The only slightly tricky part was the TPM lock in Rosetta, but even that eventually boiled down to about five patched instructions.

First Intel developer release of OS X (2005)

Hackintosh thus actually predates the official January 2006 release of OS X for Intel. Apple was at least officially not pleased, but that didn’t stop numerous journalists from publishing articles about OS X on Intel—and while getting access to one of the DTK systems would have been difficult (not least because its owner would have to violate his or her agreements with Apple), getting access to Hackintosh was reasonably easy.

Let’s rewind a bit. There were three major reasons why the developer release of OS X Tiger 10.4.1 wouldn’t run on typical PCs at the time. Continue reading

Posted in Apple, Intel, OS X, PC history, Pre-release | 10 Comments

HTT Means Hyper-Threading, Right?

In a logical, ordered world, the HTT bit in CPUID would indicate a processor with Hyper-Threading Technology enabled. But of course the world with Intel inside is anything but logical.

The actual meaning of the HTT bit changed several times over the years. Tracking exactly how it changed is difficult without all editions of Intel’s CPUID documentation (initially a standalone document, folded into the SDM in 2012), but there’s enough left to get a good idea.

Hyper-threading was introduced in the 180nm Foster MP Xeon in February 2002. That was the server version of the original Pentium 4 Willamette NetBurst implementation. Back in May 2002 (the oldest CPUID document with the HTT bit included that I could find), Intel said: HTT: This processor’s microarchitecture has the capability to operate as multiple logical processors within the same physical package. This field does not indicate that Hyper-Threading Technology has been enabled for this specific processor. To determine if Hyper-Threading Technology is supported, check the value returned in EBX[23:16] after executing CPUID with EAX=1. If EBX[23:16] contains a value > 1, then the processor supports Hyper-Threading Technology.

In other words, the HTT bit never meant that hyper-threading is enabled, or even that a given CPU is hyper-threading capable. It was a misnomer from the beginning. Continue reading

Posted in Documentation, Intel, Pentium 4 | 13 Comments

How Apple Created Hackintosh, Part I

At a developer conference in June 2005, Apple announced that OS X will transition from PowerPC to Intel processors. The first Intel Macs (sometimes nicknamed “Mactels”) were introduced several months later, in January 2006. The announcement generated significant interest in the PC world, and everyone started wondering: Is OS X going to run on my PC? The then-current OS X 10.4 Tiger was in many ways superior to Windows XP, and while Windows ruled the business world, Macs were very strong in the media creation department.

Soon after the conference, Apple shipped custom development systems to interested parties who were willing to pay $999 for the privilege. The systems came with an Intel version of OS X 10.4.1 which refused to run on any standard PC, even though the Apple development systems were extremely close to a vanilla PC.

No Intel OS X for you

No later than August 2005 (still months before the official release), the first hacked versions of OS X Tiger for x86 appeared. This in turn spawned an entire strange subterranean cult of Hackintosh, populated largely by people whose time is worth very little and who put a lot of effort into creating an entirely untested and unsupported system.

But how did Hackintosh appear on the scene so quickly? The person most responsible for that was none other than Steve Jobs, and to understand why, we have to rewind another 20 years back. Continue reading

Posted in Apple, Intel, PC history, Pre-release | 10 Comments

MS KB Articles

A recent blog post over at pcjs.org explores some of the mysteries surrounding information that at one point or another was published as a Microsoft KnowledgeBase article (or a KB article for short).

It’s not entirely clear where the KB articles originally came from or when, or what happened to them.  The current best guess is that the KB articles started being written around 1987 and were likely accessible through some online service (dial-up, that is). They were never particularly well organized and relied on using keywords, which were themselves not clearly defined. The KB articles were written by Microsoft support personnel with input from product development, and often corresponded directly to bugs reported by customers. Finding something was a little difficult, and it appears that the main purpose was to publish something that customers could be pointed to.

KB articles were also updated, so the a KB article with a given number in 1989 was not necessarily identical to the same KB article in 1992. The information content was largely the same but the exact text was not. Some KB articles were also removed entirely, not always for obvious reasons.

Many KB articles contain useful information not found anywhere else, but finding them can be tricky. Sometime in the mid to late 1990s, Microsoft started publishing KB articles on the web and that became the official KB repository. But many KB articles never made it there in the first place (such as KB articles related to OS/2, which Microsoft had thoroughly disowned by then). Does that mean the old KB articles are gone? Well, not exactly… Continue reading

Posted in Documentation, Microsoft, PC history | 17 Comments

PC-MOS/386 Source Code

I missed this when it was initially announced. The source code for PC-MOS/386 version 5.01 is now available on github under the GPLv3 license. It requires the user to supply Borland C++ 3.1 in order to build, but there are binaries checked in as well, including a bootable floppy image.

PC-MOS is a multi-tasking/multi-user DOS clone. It was one of the first commercial products which used the 386’s virtual-8086 mode when it was released in early 1987 (but not the first, that was almost certainly CEMM in 1986).

It is worth noting that PC-MOS also supported 286 systems. It required custom hardware and also used the well-undocumented LOADALL instruction (see MOXMEM.INC).

The source code is unfortunately not organized in a very clear fashion; there are for example three separate and not quite identical copies of the PC-MOS kernel.

There is an interesting reference to “Bimini 2-SX” aka IBM 486SLC, which apparently had a bug affecting PC-MOS/386: “When executing a CALL or JMP instruction with a negative
displacement within a 32-bit code segment and an operand prefix override is used (i.e., to limit the target address to 16 bits), the resulting target address is computed incorrectly.” (see _386.ASM in the mos5src directory for additional detail).

Posted in 386, DOS, Source code | 8 Comments