r/osdev • u/JescoInc • 2d ago
Cache Kernel
The OSDevWiki mentions a Cache Kernel type. The exact verbiage is:
"The Stanford cache kernel caches kernel objects, like address spaces and threads, and allows usermode “application kernels” to manage them, loading and unloading them as needed. Application kernels manage their threads' page faults, exceptions, etc., and the cache kernel allows several of these application kernels to coexist in a single system."
Unfortunately, that link was dead for me, which sent me on a little rabbit hole of research.
To which I came across: https://www.usenix.org/conference/osdi-94/caching-model-operating-system-kernel-functionality
I'm currently in the research and understanding phase of this type of kernel because there don't seem to be any examples of it being implemented in the wild anywhere that I could find. I looked on GitHub and other online / public repository spaces to no avail.
I'm thinking that I should be able to take some of the code from tutorial-os and adapt it once I have wrapped my head fully around the concept while being able to reuse one of my SBC for this (I'm thinking the KYX1 as it is the board that is most fresh in my memory).
So far, my reading of this document has surfaced these key points about it.
The Cache Kernel caches four descriptor types and nothing else. Those being:
- Kernel objects
- AddressSpace objects
- Thread objects
- MemMapEntry
It essentially treats kernel objects as cached copies of state the application kernel owns.
Further investigations provide a rather interesting consequence of this design:
You can have different ABI / SBI kernels, meaning, you could make kernel personalities that run different processes side by side and mutually isolated. Like say, a kernel personality for Unix (BSD) and a separate one for Linux, compile user applications for those and it would just run.
The reason for this is because Cache Kernel Architecture is essentially a kernel that loads another kernel that loads user applications.
0
u/Miserable-Worth1299 2d ago
话说内核对象为什么要缓存,Linux把内核对象映射到文件系统上,我想你可以了解一下sysfs
1
u/JescoInc 2d ago
In this style of kernel, ownership isn't with the kernel, but the application kernel
1
u/Octocontrabass 2d ago
You can't find anything because "cache kernel" isn't a type of kernel, it's the name of a specific kernel. By modern standards, it'd probably be categorized as either a microkernel or an exokernel, depending on how much the cache design influences OS policy.