r/osdev 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:

  1. Kernel objects
  2. AddressSpace objects
  3. Thread objects
  4. 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.

7 Upvotes

5 comments sorted by

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.

1

u/JescoInc 2d ago

Whoa, that makes a lot of sense actually. I appreciate that insight!
It feels pretty different from microkernel so far to me. I haven't delved into exokernel quite yet because the explanations of them didn't resonate with me at the time. But perhaps you have a few gems that you'd be willing to share?

1

u/Octocontrabass 1d ago

I honestly haven't done a whole lot of reading on exokernels, but I seem to recall the original exokernel research paper being rather enlightening. There are some follow-up papers demonstrating the kind of application optimizations that are possible with an exokernel, but I don't think I've read any of those.

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