Is it possible yo use Cache as RAM?

Is it possible yo use Cache as RAM?

Hello Everyone,
I am Vivek Chand, pursuing my BE in Dr.AIT at Bangalore.
I am designing an OS for MultiCore and ManyCore chips to fully exploit it which wolud be a modification to xv6 and JOS Kernel(MIT's exokernel)
I have the ideas for implementing an deterministic and race-free Operating System.
Now, to make a bit different from the existing OS design, i want to load my microkernel into L2 cache permanently.
i.e, I want my microkernel to be bootloaded into L2 Cache rather than into main memory.
I think, It seems to be possible....but i;m not sure how to do it..
So, Can u please suggest me some ideas on implementing it....

6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Some network adapters support a feature called Direct Cache Access (OS must support it too) which informs the CPU to store the incoming data preferably in cache to prevent possible cache misses. But I don't know if cache is usable as RAM in general. I must admit that I'm not very experienced with the exact designs of caches but isn't the cache managed by an on-chip cache controller? If so wouldn't the controller trash the information you might have written into the cache?

It is not possible to prevent the hardware to keep a copy of your OS in memory. However, it should be possible to prevent the hardware from evicting your code from cache. This can be done by assigning only pages to user space that do not map to cache lines that are occupied by your kernel code. However, you will need a descent understanding of the caching behaviour of the underlying hardware in order to make this work.
This method is similar to the technique called "page coloring" or "cache coloring". A description of page coloring can be found here.

I think it is not possible to use Cache as RAM.

Cache as RAM is possible by controlling MTRR. That is mostly done during BIOS initialization.

For more detail

Hi, It isnot possible to use your system cache memory as RAM.

Leave a Comment

Please sign in to add a comment. Not a member? Join today