3 ms·
> It would be interesting if you could just program with an L1 exposed and structured as a main memory rather than a cache ... During the boot of the computer,
by temac 7y ago
> It would be interesting if you could just program with an L1 exposed and structured as a main memory rather than a cache ...
During the boot of the computer, you can. At least you could a few years ago, I'm not sure about brand new processors. Anyway, the boot was (and maybe still is) done in multiple phases and at first the RAM is not available. So at first the code only uses registers. But this is extremely limiting (I'm not sure there are even compilers capable to emit such code, so you have to write that shit in assembly language). So one of the first thing to do, even before you have the memory controller programmed and calibrated, is that you flip a bunch of model specific registers, run a tiny loop to touch a range of addresses, and update the MSRs again to prevent the cache lines from being evicted, and BOOM! You go into the Cache-As-Ram mode. Later you will initialize the memory controller, and leave Cache-As-Ram. I'm not sure if you can hard-limit to L1 though (well obviously you can if you restrict to a small enough range). Probably L1+L2 is used most of the time? Not really sure...
Maybe you can take a look at coreboot and actually program the application you want in there instead of under a traditional OS. Seems fun :P