Open redhog opened 10 months ago
So, two issues:
No one's done an XIP kernel. It's hard to run Linux because it's going to have to load every copy of ever program all the way into memory, since it can't share any memory without XIP.
It's just really hard to run modern Linux without an MMU, since things like mmap are a little weird. While almost all features will work fine, there's likely to be a handful of oddities with things like shared memory.
Dynamic linking is one of those weird things. While there's no reason ELF's couldn't be loaded without an MMU, no one has written the MMU-less ELF loader.
There's nothing fundamentally blocking dynamic library usage (sharing code in memory) but people just haven't done it.
Heyas!
Would it be possible to get a full apt based distro running on this, e.g. https://github.com/yuzibo/riscv32/wiki ? Is using flat binaries instead of elf a requirement due to the lack of mmu? Does this mean no dynamic linking? If so this sounds hard...
Background: My goal is a bit of a funny one:
I want to find / build a hardware emulator that can run a full modern linux distro (in text mode only), with the requirements that a) the emulator source code (not binary) is really small, b) that the emulator source code is in as small as possible subset of whatever programming language it is built in as possible and c) the rootfs and kernel can be appended to the emulator source as a b64 encoded string constant c)
The goal is for this subset programming language to be small enough to teach only by example (no explanations / comments, only code, input plus output, to someone who does not know anything about the language, or even english). That is, someone who reads this arcive should be able to see these examples and the emulator code with the kernel/rootfs in it, figure out how to run it with no help, and get a running full current day linux system.
Would your project be a good starting point? I've also been looking at https://github.com/sysprog21/semu but that is a considerably larger codebase.