Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
3  
16-bit is overkill. 8-bit are enough to run Linux. See the project of Dmitry Grinberg. –  Marco Jan 14 '13 at 14:21
3  
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
add comment

4 Answers

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
1  
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
add comment

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
add comment

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
3  
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
add comment

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
add comment

Your Answer

 
discard

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.