3 ms·
Use the cache as RAM. So I guess you could run a small Linux system just in cache without any RAM? Why? As a fun project with some old motherboard for example
by usr1106 4y ago
Use the cache as RAM. So I guess you could run a small Linux system just in cache without any RAM?
Why? As a fun project with some old motherboard for example :)
- JoshTriplett 4y agoWith a fair bit of effort; notably, DMA and IOMMUs probably won't work, and most modern devices don't really support PIO. You might be able to boot a really simple environment that runs out of an initramfs though. It's also entirely not obvious to what degree you can use the paging system. It'd likely be a substantial effort to port Linux.
- usr1106 4y agoSure, I would not expect to do any advanced IO. But right, probably there is no serial console really close to the CPU either, this is not a Raspberry PI. No idea what signals could be used for that. Page tables I am not sure either. Could you still do it like in Linux 1.0? No idea what things looked like then, but I assume much less dedicated hardware support.
- JoshTriplett 4y ago> probably there is no serial console really close to the CPU either outb to 0x3f8 might work. I know there were once versions of Linux that supported running without an MMU. Those versions, with very limited hardware support, might work in this mode.
- mschuster91 4y agoIt's still part of the kernel code: https://www.kernel.org/doc/Documentation/nommu-mmap.txt https://www.kernel.org/doc/Documentation/nommu-mmap.txt And apparently, good enough to run DOOM: https://hackaday.com/2022/12/07/a-tiny-risc-v-emulator-runs-linux-with-no-mmu-and-yes-it-runs-doom/ https://hackaday.com/2022/12/07/a-tiny-risc-v-emulator-runs-...
- wtallis 4y agoHasn't Intel supported DMA into L3 cache for something like a decade now?
- usr1106 4y agoSubstantial effort I don't doubt. First probably years of learning how things work under the hood for most normal mortals.
- lamp987 4y agoDMA on x86 does update contents of CPU caches.
- JoshTriplett 4y agoYes, it does, but that doesn't mean the hardware necessarily supports doing it without a memory controller.
- Klinky 4y agoWith the some of the new AMD Epyc CPUs having over 1GB of L3 cache, you could run a pretty full-featured Linux distro + app entirely in cache.
- undersuit 4y agoIf anyone can verify that Cache as RAM actually works on AMD though or explain how AMD boots without it that would be great: >Cache-as-RAM (CAR) is no longer a supportable feature in AMD hardware. https://git.furworks.de/coreboot-mirror/coreboot/commit/a2455b2967ad3ab7e95785820e49f600b06477f6 https://git.furworks.de/coreboot-mirror/coreboot/commit/a245...