Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I don't own a 286 nor do I intend to run Linux on one. However since the 286 has protected mode, why is it frequently stated that Linux requires a 386 CPU or higher?

From http://tuxmobil.org/286_mobile.html it seems that the ELKS version of Linux can run on a 286, is this correct? What (if any) modifications have been made to allow the kernel to run on the 286 CPU?

Now obviously I understand that a kernel compiled for a 386 cannot execute on a 286 CPU, which is 16-bit. So my question is, why cannot the standard Linux kernel be compiled for a 286, and then executed on a 286? Does Linux require hardware VM86 support?

share|improve this question
16-bit is overkill. 8-bit are enough to run Linux. See the project of Dmitry Grinberg. – Marco Jan 14 '13 at 14:21
See stackoverflow.com/questions/5045819/… – ott-- Jan 14 '13 at 15:22
Minix ran on 8086 (8 bit, 128KiB RAM IIRC). Microsoft's Xenix did run on 80286. Some demented soul tried to shoehorn Linux into 8086 too (with some success). But no, the "full Linux experience" won't be possible on such a limited machine. – vonbrand Jan 15 '13 at 14:42
You can shoehorn Linux to run on very limited devices. But this is not going to be very useful as an e.g. desktop machine. Unless you state your goals it's hard to tell if 'Linux on 286' is viable for you. – 9000 Oct 28 '14 at 13:42

There are parts in the kernel written in assembly and they would have to be rewritten to support 286.

Regarding ELKS, in their FAQ they indicate it's a subset of the Linux kernel, so perhaps they ported only the absolute necessities.

share|improve this answer
There was a math coprocessor for the 286, the 80287. – Renan Jan 14 '13 at 16:05
@Renan Thanks, removed. – David Kohen Jan 14 '13 at 17:17

Does Linux require hardware VM86 support?

I'm not an assembly guy, but according to this:

As the original implementation of the 32-bit extension of the 8086 architecture, the 80386 instruction set, programming model, and binary encodings are still the common denominator for all 32-bit x86 processors, this is termed x86, IA-32, or i386-architecture, depending on context.

The 386 represents an expanded instruction set from the 286, so who know how hard the port would be. Evidently enough that almost no one has bothered to try it...I guess you can ask the ELKS people about that.

share|improve this answer

I think the real answer to my question is this:

Every major CPU architecture (or major revision thereof) requires some assembly support code in addition to the C code.

Even if you got GCC to compile the Linux kernel into 16-bit 286 machine code, there would still be missing the essential 16-bit 286 compatible assembly code.

In other words, the kernel would at best only partially be built. Any architecture specific assembly code would fail to assemble as it is simply not written for that architecture.

Based on this I'm assuming that this is exactly what e.g. ELKS and similar projects do when the implement Linux on the 286 or other architectures -- they implement that missing assembly support code.

share|improve this answer

The 80386 supports paging in addition to memory segmentation while the 286 supports only memory segmentation. Linux heavily depends on paging support i.e., uses a flat memory scheme which basically sets all the segment registers to 0 and uses paging to manage applications. In order to port Linux to the 286, the fundamental memory manager needs a complete redesign to work in segmented mode without paging which is probably a lot of work.

share|improve this answer

Recently the linux kernel has abandoned the 386 as a supported platform and Linux kernel does NOT support Intel 286 processors..80286 is not a 32bit cpu, which is required to boot.

share|improve this answer
Linux was originally written on a 386 in 1991. By then 286's were already old, and the main kernel tree never had any backported code to support 286. – Cisco88 Jan 14 '13 at 14:04
That may be, but the question was still why is this the case? Not why the decision was made to drop support for 286/386 (which is obvious) but what are the technical reasons that supporting such an old processor cannot easily be done. I.e. why does the kernel REQUIRE a 32-bit CPU? Why cannot the kernel be compiled for a 286? – ioctlvoid Jan 14 '13 at 14:09
Didn't the kernel also have the arithmetic co-processor as it's requirements? – Bonsi Scott Jan 14 '13 at 15:52
No, the kernel supports math emulation, at least it did that before. Hence you could even run the Linux kernel on a CPU with a broken FPU. However, the 286 still supported a math co-processor, the 80287. – ioctlvoid Jan 24 '13 at 16:30
In an edited out part of my answer I did indicate that emulation is implemented in the Linux kernel. It was even used to port Linux to S/390 (a.k.a IBM Mainframe) as it did not have a floating point unit at the time it was ported. – David Kohen Jun 26 '14 at 16:35

Linux x86 cannot be easily back-ported to the 80286 because it is a 16-bit processor and Linux x86 requires a 32-bit processor.

More specifically, the registers on the 286 were still only 16-bits wide. None of the EX registers were available. Also, memory segments and offsets were still only 16-bits long. Programs still had to deal with near/far code and data.

This means that Linux/286 would need a radically different kernel and user API than Linux/386. Every assembly source file and many C source files would need to be rewritten. It would be like the difference between programming for Win16 versus Win32.

In short, you can't just tell GCC to compile for a different CPU. Every bit of code would need to be rewritten for a 16-bit environment.

share|improve this answer
Please consider the use of markdown for increased legibility. – lord.garbage Oct 16 '14 at 8:29

From what I've read the canonical way to get Linux to run on the 80286 would be to run it inside a virtual machine. This is what Fabrice Bellard did here. You'd have to implement the virtual machine yourself, or port one.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.