25 years after the introduction of the 32 bit Intel i386 CPU, all Intel compatibles still start up (and wake up!) in 16 bit stone-age mode, and they have to be switched into 32/64 bit mode to be usable.
Wouldn’t it be nice if a modern i386/x86_64 CPU started at least in 32 bit protected mode? Can’t they make a legacy-free CPU that does not support 16 bit mode at all? Such a CPU exists, well, existed. It’s the 1989-2001 Intel 80376, an embedded version of the Intel i386.
The datasheet describes all the interesting differences. The 80376 does not support any 16 bit mode, so the “D” bit in segment descriptors must be set to 1 (page 25), forcing 32 bit code and data segments. 286-style descriptors are not supported either (page 27). (The 0x66 and 0x67 opcode prefixes still exists, so code can work on 16 bit registers and generate 16 bit addresses (page 14), just like an i386 in 32 bit mode.)
Since the CPU does not support 16 bit modes, it cannot do real mode, so CR0.PE is always 1. Consequently, a 80376 starts up in 32 bit protected mode, but otherwise, startup is just like on the i386 (page 19): EIP is 0x0000FFF0, CS is 0xF000, CS.BASE is 0xFFFF0000, CS.LIMIT is 0xFFFF, and the other segment registers are 0x0000, with a base of 0x00000000 and a limit of 0xFFFF. No GDT is set up, and in order to get the system into a sane state, loading a GDT and reloading the segment registers is still necessary. Too bad they didn’t set all bases to 0, all limits to 0xFFFFFFFF and EIP to 0xFFFFFFF0.
The 80376 is designed to be forward-compatible with the i386, so unsupported features are documented as “reserved” or “must be 0/1”, and legacy properties like the garbled segment descriptors are unchanged. All (properly written) 80376 software should also run on an i386 (page 1) – except for the first few startup instructions of course. Intel provides the following code sequence (page 20) that is to be executed directly after RESET to distinguish between the 80376 and the i386:
smsw bx test bl, 1 jnz is_80376
This tests for CR0.PE, which is hardcoded to 1 on the 80376 and is 0 on RESET on an i386. The three instructions are bitness agnostic, i.e. the encoding is identical in 16 and 32 bit mode.
Sounds like the perfect CPU? Well, here comes the catch: The 80376 doesn’t do paging. CR2 and CR3 don’t exist (it is undocumented whether accessing them causes an exception), CR0.PG is hardcoded to 0 (page 8) and the #PF exception does not exist (page 17). A man can dream though… a man can dream.
5 thoughts on “The Intel 80376 – a Legacy-Free i386 (with a Twist!)”
Thank the BIOS manufacturers for keeping 16-bit mode around. Since they didn’t want to rewrite their code for 32-bit, they have kept SMM and reset as 16-bit “real big” mode. ACPI was an attempt to wrest some of that control away from them, but it hasn’t been successful enough to eliminate 16-bit mode on startup.
Hey, I actually was looking at my ancient Intel databook section on this very chip a few months ago. I always thought it was an interesting idea, but never saw or heard of anyone using it. Anyone ever see a ‘376 out in the wild?
Woah, interesting ;) Never heard of this CPU before.
I second Joe’s question :)
Most of the tests in the SYSMark page are very hhgily multitasked, so you could pay particular attention to that section
ShivaPort Atom (previously SpiderPort) terminal servers, and that means like dumb terminals ie. serial ports, had 80376 in them. These babies were all over when modems, terminals, SLIP, DecNet and LAT were the bleeding edge of networking…