Skip to content

Comment on Arm64EC – Build and port apps for native performance on Armparent

Comments

The TSS was always one of the most obnoxious aspects of the 80286 that stuck around much longer than it should have. On 386 or anything newer, using it was _slower_ than implementing it in software, yet you still needed them to implement task gates necessary for things like exceptions and interrupts.

If anyone actually has a serious need to use ancient 16 bit software, emulators like 86Box work very well. Software that old doesn’t really need performance faster than, say, a Pentium 90, which 86Box has no trouble achieving on my M1 (ARM) MacBook.

You can also use winevdm[1] on modern 64 bit Windows operating systems. I have this in production use for a niche case where someone can’t give up a particular 16 bit app, and I didn’t want to tangle with a VM for them.

The technical details of making sure a modern CPU still functions exactly like an 80386, which in turn made sure it functioned like an 80286, when you fire up a 16 bit task on, say, 32-bit Windows 10 (or 64-bit with something like winevdm[1]) sound like a nightmare for a microcode engineer or QA tester.

[1] https://github.com/otya128/winevdm

Oh it doesn't, AMD and Intel gave up on that awhile back. v8086 mode might... but I'd guess it has quite a bit of errata. Everything else has most certainly changed. CPUs don't support the A20 gate for example. Nor do they truly support real mode (they boot in 'unreal mode' now). If you want a 386 compatible you're looking at ALi or DM&P CPUs that are basically Pentium/486/386 clones.

I'd argue the break started with the Pentium Pro, at that point things shifted architecturally.

The 80286 and 80386 never had special support for the "A20 gate". That was provided by (often slow) external circuitry.

Some CPUs (I cannot remember which) built in an A20 gate to their CPUs to improve performance.

The P6 was a complete implementation of the 80286 and 80386, Virtual 8086 mode, TSS, and all - you could boot DOS or an 80286 operating system on a P6 without any problems, although the design was not optimised to improve performance of 16-bit software. This was enough of a problem that they rolled back that design by the Celeron era because there were still a lot of people using 16-bit apps.

On 386 or anything newer, using it was _slower_ than implementing it in software

...and thus it didn't get used, meaning Intel didn't make it faster, and so the vicious cycle continued.

Hardware task switching could've made software simpler and more forward-compatible.

Of course they eventually reinvented most of it with the virtualisation extensions anyway.

Actually it did get used. Linux and Windows used the x86 TSS for process context-switching for years.

During that time, Linux had a limit on the number of processes, which was due the maximum number of TSS entries that fit in the x86 GDT.

Eventually the Linux kernel was changed to the more versatile context-switch method it uses today. Among other things, this change was important for thread performance, as thread context switches can skip the TLB flush. Same for kernel mode tasks. Software task switching also greatly increased the number of processes and threads that can be launched, from about 8000 (across all CPU cores) to millions.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.