283 points · by blakespot · 3y ago · 176 comments
As it is, the 80386 came with a number of compromises. For instance, there was no cache at all beyond a 16 byte instruction prefetch queue, whereas the m68020 had 256 bytes of instruction cache. There were no atomic instructions (LOCK wasn't useful for this), which is why many modern OSes support the 80486 but not the 80386. The fact that compatibility with the 8086 required real mode or VM86 meant that it took quite a long time before software started taking advantage of the 80386's new features.
It was an important chip, but it showed us early signs of what we've come to expect from Intel: attempts to create other markets at the expense of, or with the express desire to not compete with, the x86 (the iAPX 432 then, the Itanic twenty years later), the slapdash addition of "features", such as the additions to the 80286, which then were required to be included forevermore as legacy support, the rushing-to-catch-up when other vendors had features that everyone wanted (real, flat 32 bit support then, 64 bit support twenty years later).
Still, it's interesting history!
"It uses every conceivable feature of the 386 I could find, as it was also a project to teach me about the 386"
Does the lack of atomics really matter, given that there was (AIUI) no SMP on the 386? You can always disable interrupts to make your operation 'atomic' in a uniprocessor context.
Nevertheless, there have been very few SMP systems using early Intel CPUs, before 80486, mainly because those CPUs were still too weak in comparison with the contemporaneous mini-computers, and not even SMP would have made them competitive in performance, while the high price of SMP would have been incompatible with personal computers.
Intel 80486 has been much more frequently used in SMP systems, not only because it had added the more convenient atomic fetch-and-add and compare-and-swap instructions, but because Intel had also provided for 80486 an APIC integrated circuit, i.e. a multi-processor interrupt controller, and also because 80486 was very fast and a SMP system using it was competitive with much more expensive computers.
Intel 8086 was intended to be used in SMP systems by using the atomic swap instruction proposed by Dijkstra, i.e. LOCK XCHG with the Intel mnemonics.
The atomic swap is good enough to implement any kind of concurrent programs, albeit at a lower performance and higher complexity than when the atomic instructions added by 80486 (LOCK XADD and LOCK CMPXCHG) and Pentium (LOCK CMPXCHG8B) are available.
The 80386 has added atomic fetch-and-modify-bit instructions, which remain useful even today in wait-for-multiple-event scenarios (together with LZCNT, which can be used to get the highest-priority event that must be serviced).
XCHG is enough to implement a mutex though, which is what most applications need.
Didn't all XCHG with memory operands have an implicit LOCK prefix on Intel 8086?
Otherwise you could from any user program disable interrupts and give the operating system no chance to take back control. Xadd, cmpxchg, bts, btr and btc are all prefixable with lock to make them atomic.
jmp far $-4
It could have easily gone awry as it did for Data General, Honeywell, CDC, AST, Tandy, Olivetti, Xerox, DEC Rainbow, AT&T Hobbit, Wang 2200 and Unisys. Strong survivorship bias on this one. Most of the once Titans are in or near the dustbin now, such as SDS, SDC and Fairchild.
Intel's history was primarily as a memory manufacturer. They're arguably near a similar fucked position now - effectively 0% of the mobile and home appliance market and getting slaughtered in their only remaining stronghold by NVIDIA, AMD and ARM pillaging their castle. Hopefully they'll squeeze out of this one.
> "Business success contains the seeds of its own destruction. Success breeds complacency. Complacency breeds failure. Only the paranoid survive."
Something that Intel's leaders didn't pay attention to during the 2010s.
The story is about what if we all go out off this room and come back like a new guy. What would we do?
"strategic inflection point" ...
They decide to move from a memory company to a CPU company.
No access to Nikon but being just a Leica len maker for Canon (and famously found by DDD and used in Korea War), then move to nikon rangefinder (but strangely follow Zeiss approach more). Then jump ship to SLR by inventing Nikon F (and used in Vietnam War). It is just crazy move, but at least it is related. And "survive" and move on.
Or just like Fujifilm move to cosmetic in one stage as making film has some knowledge that can be re-used there. And survive and move on.
While no longer on the cutting edge, they still have a significant presence in the semiconductor lithography business. So they will survive in one way or another even if they stop making cameras one day.
DEC should have packaged the LSI-11 into a consumer machine. They had all the software, which was top shelf.
I had an H-11, it was a great machine.
I wonder how early one could capture the complexity of the full PDP-11 microarchitecture on a single chip? Would it have been affordable? What about the support hardware?
I think that same transistor count was reached by Motorola on the 68020, which would've been around 1984, but would have needed the peripheral controllers mentioned here.
NVIDIA doesn't make good CPUs, even their SoCs are ... not exactly state of the art. No mass market adoption besides automotive who don't care about anything but long availability of (spare) parts and the Nintendo Switch which likely only still uses the same 2015-era Tegra chipset because even someone as big as Nintendo couldn't kick enough arses at NVIDIA to bring up a new design. ARM doesn't make generally available server CPUs (the ones that do exist all get gobbled up by cloud providers), and there are outside of the Mac world no viable ARM desktop or laptop CPUs because Qualcomm completely fucked up that market for likely years to come - I don't see any way of ARM adoption in that market unless ARM comes up with a competing solution to Rosetta and Qualcomm comes out of the mindset "if it works just barely, ship it" that may be acceptable to smartphone vendors but not the PC/desktop market.
That leaves AMD as the sole remaining threat to Intel, and AMD doesn't have the fab space to be enough of a threat to Intel's moat.
Yes, I may or may not be extremely frustrated at the state of competition in general computing.
The Pi 400 isn't their final attempt into the PC market, only their first. Surely a slew of decent ARM based laptops from one of these SBC manufacturers is coming along eventually - and I don't mean chromebooks.
In the Windows world, no one holds even closely to the capabilities required for a transition to ARM: Microsoft doesn't have a fat binary standard or the toolchains needed (that all went down the drain with the end of Microsoft Windows CE / Windows Phone and even then, it was a nightmare to develop for these), the third party developers - especially the enterprise tailor-made application market - have zero experience with ARM and a lot of stuff used in enterprise was made by companies that went defunct long ago, Microsoft doesn't have any hold over what the device vendors do in terms of drivers (unlike Apple, who famously cut ties with NVIDIA because NV didn't want Apple to write drivers for their GPUs), and neither Microsoft itself nor the conglomerate of hardware OEMs has the cash in hand to take all the stuff people use on x86 Windows and make it work on ARM Windows (as they infamously discovered with the early Windows Qualcomm stuff). Oh, and the ARM vendors can't be bothered to get something as basic as PCIe working on a fundamental level beyond "if it works in my very specific use case, ship it" - just look at the RPi 4's issues where people developed breakout boards for PCIe only to discover that crucial functionality was flat out broken [1]. And even with people complaining for years about PCIe issues on the Pi 4, turns out the Pi 5 still managed to fuck things up [2].
The only player in town able to make ARM work on anything but smartphones and servers is Apple, and they don't (and never will, assuming regulators don't finally wake up and force them) sell to third parties.
> The Pi 400 isn't their final attempt into the PC market, only their first. Surely a slew of decent ARM based laptops from one of these SBC manufacturers is coming along eventually - and I don't mean chromebooks.
These things are and will be toys. The money is in getting corporate to switch over to ARM and until the problems above (especially backwards compatibility and standards conformance) are worked out, which I don't see happen any time soon because it's so hard to break through the chicken-egg scenario, there will be no threat to Intel. Especially not if even many years of development and complaining are not enough to arse Broadcom into fixing PCIe.
[1] https://www.jeffgeerling.com/blog/2023/i-built-special-pcie-...
[2] https://www.jeffgeerling.com/blog/2023/testing-pcie-on-raspb...
Huh citation needed? I would like to know more context on that
[1] https://www.xda-developers.com/qualcomm-exclusivity-deal-mic...
[2] https://www.digitaltrends.com/computing/why-windows-on-arm-c...
not a huge fan of Qualcomm but you might be interested in this:
"Qualcomm Snapdragon X Elite Performance Preview: A First Look at What’s to Come" https://www.anandtech.com/show/21112/qualcomm-snapdragon-x-e...
The state of Qualcomm products over the last years has left me with absolutely zero confidence.
The difficulty is they need to make nearly decade-long bets that are the size of small countries economies due to the complexity of manufacturing and Intel's made a few bad ones recently.
I don't know who to listen to on what chip design will be a market win in 2030 either. AI applications are extremely resource intensive so that will be driving things for a while but how to solve that in an affordable chip created by a reliable efficient manufacturing process is beyond me. This stuff is phenomenally hard.
I'd say the winner is something like an NVIDIA graphics pipeline that is separated into a pile called "graphics" and "ai" and then has the graphics part gutted for a cheaper AI pipeline which can use system memory as opposed to preciously expensive graphics memory and then gets integrated into their next gen CPUs taking Nvidia out of the loop and dealing a blow to AMD at the same time. They'd mop the floors with something like that especially if you could just drop it into pytorch and have it work automagically. They could probably then just turn around and license it to ARM.
AMD and Nvidia wouldn't work together to mount a unified defense because of ATI and this would allow Intel to weasel their way back into the Apple money stream.
But I'm just some unemployed dude typing this on a 4 year old android. Don't listen to me.
So, what this article fails to really clarify is that the segment registers were now basically "selector" indexes into tables with base+length (in either pages or bytes) fields, execution permission controls. And these selectors and the GDT/LDT/IDT/TSS/call gates/task gates/etc were all designed to support OSs with a 4 level permissions hierarchy, user/library/driver/kernel (or similar), passing around access selectors which could do things like enforce the size of data structures, etc. And to support this, they added FS/GS so that all the general purpose registers could have their own permissions masks.
Pause for a moment and consider that again, Pointers (capabilities, aka selectors) can have not only a base address, but a hardware enforced limit, along with a permissions model that means a function like strcpy() would be incapable of writing to any memory that wasn't the target buffer or part of its own scratch space. Languages/os's could have enforced that called functions were unable to write to the callers stack, or even possibly run in their own completely separate stack. And that is just the beginning.
So, here nearly 40 years later the industry is still trying to recover from the mistakes of designing OS's and programming languages around flat memory models and simplistic user/supervisor permissions models. The 386 provided hardware assistance for writing OS's features that to this day aren't common.
ex: see CHERI.
There are only 8k possible pointers in the LDT, plus 8k in the GDT. The x86 segmented model isn't really suitable for implementing capabilities.
A limitation of 8 thousand different protection ranges would have been a lot for a program utilizing a few hundred KB of actual data and coming from a system were it was a PITA to access a data structure > 64K. It might not have been enough to do a super fine grained implementation, but it was more than enough for the time period, and had any significant OS's used it in a meaningful way I'm sure it would have been extended when limitations here hit, as was everything else in the following products.
Oh, and also one could have reloaded the GDT, or swapped some number of LDTs at some boundary if needed. It wouldn't have really been much more disruptive in the 1980s than switching the page tables on task switch, like every modern OS.
https://forums.grsecurity.net/viewtopic.php?f=7&t=3046
https://pax.grsecurity.net/docs/PaXTeam-H2HC12-PaX-kernel-se...
I have seen discussion that treats it as assumed knowledge that 68k was obsolete and needed to be replaced by powerpc. But it seems like conjecture - I have not seem technical arguments, and 68k seems like a cleaner architecture to ride forward than post-286 x86.
We never had intel chips. They were expensive. I had a Texas Instruments 286 and a cyrix 486 years later. The computer in my Dad's office were all "pc compatible" . This was a university (biology department in a God forsaken poor small city in Mexico). Someone got it bought because it was going to "change the world" (oh boy). We played TDCGA.EXE and PRINCE.EXE from its 2 51/4 floppy drives. No HDD.
We heard about apple's, commodore's and other crazy computers, but they were for "gringos" or rich people.
At the same time, we shared (pirated) software as if there was no tomorrow. Spread like wildfire. As and played the heck out of ID shareware.
Then you had the Mexican middle upper class: whose dad bought Macintosh one of those others. They NOW had to spend all this money to get it to do something (buy software). Nobody was pirating/sharing programs, and the PC ones just didn't work.
So a virtuous cycle continued and we kept buying x86.
Great memories! I'm glad I was part of that dawn of PC.
Intel tried at least twice to move them away to i860 or Itanic and failed. So, improve x86 was the winning bet.
Sort of. There was the VME bus. An attempt to have a standards based bus that would work across vendors, and also for the the 88k cpu. It wasn't wildly successful, but was mildly successful.
That said...the 386 was a world-changing engineering achievement, and as much as I think in a just and fair timeline the 68030 would have taken over the world ( :-) ), you can't discount what Intel did.
How the hell does _that_ happen? I've never had a job in 30 years where I didn't have somebody breathing down my neck to produce something tangible every couple of _days_.
I felt more spiritually connected to the MC68K line back when, for lack of a better term.
Amusingly the i386 system I spent the most time with was in college in 1993/4 on a Sun 386 tower running SunOS or Solaris in the APCS lab.
Really annoyed at myself that I got rid of in some fit of "well, I'll never use that again" cleaning some time.. especially given somehow still have "Sendmail, edition 2".
I might read the 386 book for nostalgia.. the Sendmail one..well, PTSD isn't something you get nostalgic about!
* CMPXCHG (486). Central to multiprocessor synchronization and locking.
* CPUID (P6). Admittedly, if the instruction set were frozen you wouldn't need this... but if not, it's how you detect what CPU you're running on and what it supports.
* RDMSR/WRMSR (P6, kernel only). A general-purpose mechanism for adding extra special-purpose registers to the CPU without having to allocate an instruction to each one.
* INVD/WBINVD/INVLPG (486, kernel only). This was the first Intel CPU to support cache; these instructions were used to manage it.
For one no one has mentioned that the 386 itself had no on die hardware floating point. That seems like a huge one.
Even if only a few instructions were added to the “core” some are huge like CMPXCHG, CMOV and although not an instruction itself the LOCK prefix.
But the extensions are huge. We don’t even still use the floating point instructions of the 386/387 era. MMX was pretty lame but SSE and AVX are critical. AES-NI is now necessary for most people with FDE commonplace.
From what I can tell, the 386 had the LOCK prefix. Pin 26 (bottom left) is LOCK# driven by the LOCK prefix [1]. But CMPXCHG is very useful and wasn't available until 486, and Pentium added some other stuff that's important.
[1] https://www.eeeguide.com/intel-80386-pin-diagram-description...
The original Pentiums added CPUID, CMPXCHG8B, RDTSC, RDMSR, WRMSR, RSM to the instruction set.
Later Pentiums added the MMX instruction set.
Beyond that there have been a few additions like CMOV (conditional move) that would be missed, though instruction fusion in pipelines can sometimes achieve the same speed up.
Lastly you would have to add some atomic instructions to support SMP.
Switching from a 386 to a 486 was bringing a huge speedup back then.
We under-appreciate how little binary compatibility matters now, so that you can even develop something on an ARM-based machine and then rebuild and safely deploy to an x64-based machine (usually because it's Node, JVM, Python, etc).
I did install Windows on it briefly from what I recall but wasn't impressed, there wasn't much to do with it. Games would be pure DOS and for programming I'd use Borland Pascal so again DOS.
But as a gaming machine it ran anything I could throw at it at the time, which was 286-games actually. Without realizing I had the absolute best "286" machine I could have, for DOS gaming it is apparently much better to play them on a 386: (Why you don't want a vintage 286 PC -- but I like mine anyway): https://www.youtube.com/watch?v=Htbvm5_NZHc
I paid $99 for Coherent because Linux didn't support the fancy RLL hard drive in my work computer. Eventually Linux caught up (or I got a new computer) and Slackware replaced Coherent (for little things like X11, better networking etc.). Those were the days :)
I had a 386DX, 25 MHz with 4MB and ran Slackware 3.0 with kernel 1.2.13 on it. It worked pretty nicely for me, but I have to say that I spent most of my time on the console. X11 did run but it was too slow to be fun.
Once Linux stabilized, the writing was on the wall...