1

I am in the process of designing a custom processor. It is a pipelined five stage processor. Ultimately, we want to boot Linux on it. What are the minimum capabilities that a custom processor must have in order to boot a full-fledged OS like Linux?

Please note that I am not asking about the steps required to port Linux to my custom processor at this point. At this stage I only want to know what functionalities my processor must support in order to be able to boot an OS like Linux.

1 Answers1

3

Virtual memory (paging) and kernel vs. user privilege levels are the major ones that a toy CPU might not have. There have been ports of Linux that did without those, like to 8086 or 286 (not i386) I think, but those aren't fully proper Linux.

Also of course a timer interrupt, and probably atomic loads/stores of at least 32-bit integers. Probably also atomic test-and-set and maybe other RMW primitives, or at least LL/SC. Possibly if your ISA is only 16-bit you could maybe get away with only 16-bit atomicity because that's still pointer width, but IDK if anything is going to depend on 32-bit volatile stores or loads being atomic. I think Linux can use a SeqLock for publishing 64-bit or 128-bit timestamp updates from the timer interrupt, and stuff like that.

(As far as porting, you'd need a GCC-compatible C compiler that can target your ISA, and some hand-written asm. And some kind of driver you can use as a console, for example a serial port.)

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
  • 2
    ARM7 has no MMU, it doesn't prevent to run Linux on it. Basically any microprocessor (even 8-bit) is able to run Linux, the question is what features are required by the user. And those requirements are not listed in the question. – 0andriy Oct 01 '19 at 18:30