Designing an Exokernel

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
avcado
Member
Member
Posts: 55
Joined: Wed Jan 20, 2021 11:32 am
GitHub: https://codeberg.org/minguss

Designing an Exokernel

Post by avcado »

Hi all, I've been working on a small i686 kernel. So far, I've gotten a PMM (bitmap), paging, and some descriptor tables set up. For the past week or so, I've been reading about potential architectures for my kernel, and the one that really caught my eye was Exokernels.

After a bit of reading (specifically this paper and the Wikipedia page for Exokernels, I decided that I wanted to try and write an exokernel myself. However I have a few questions about design choices:
  • Would an exokernel need a VMM, or is that an abstraction over paging / should that be put on the developer insteaD?
  • Could LibOS implement these abstractions, "easing" the load on the developer?
  • Obviously a GUI would be possible, so in that case, would LibOS provide functions to "talk" to the framebuffer?
  • In user-mode, do syscalls act like LibOS?
Everything else makes sense to me. Thanks in advance!
Octocontrabass
Member
Member
Posts: 6245
Joined: Mon Mar 25, 2013 7:01 pm

Re: Designing an Exokernel

Post by Octocontrabass »

avcado wrote: Mon Aug 04, 2025 4:45 pmWould an exokernel need a VMM, or is that an abstraction over paging / should that be put on the developer insteaD?
Applications bring their own VMMs. You might still need a VMM for the kernel, but applications won't use it (outside of situations where the hardware requires it, e.g. MIPS).
avcado wrote: Mon Aug 04, 2025 4:45 pmCould LibOS implement these abstractions, "easing" the load on the developer?
Yes. That's basically the whole point of the libOS.
avcado wrote: Mon Aug 04, 2025 4:45 pmObviously a GUI would be possible, so in that case, would LibOS provide functions to "talk" to the framebuffer?
The framebuffer is a hardware resource, so the exokernel provides access. The libOS handles abstractions on top of that, like shapes and text.
avcado wrote: Mon Aug 04, 2025 4:45 pmIn user-mode, do syscalls act like LibOS?
The libOS provides functions that would be syscalls on a traditional kernel. I'm not sure if that answers your question, though.
avcado
Member
Member
Posts: 55
Joined: Wed Jan 20, 2021 11:32 am
GitHub: https://codeberg.org/minguss

Re: Designing an Exokernel

Post by avcado »

Octocontrabass wrote: Mon Aug 04, 2025 7:29 pm
avcado wrote: Mon Aug 04, 2025 4:45 pmIn user-mode, do syscalls act like LibOS?
The libOS provides functions that would be syscalls on a traditional kernel. I'm not sure if that answers your question, though.
My question is like, for example a libOS function i.e.

Code: Select all

initialize_VMM();
would translate to some syscall, i.e.

Code: Select all

mov eax, 0xC0FF33 ; ... or some other value
int 0x2F
and the kernel initializes some user VMM and returns control back to the process. This kind of process would be repeated for any low-level / hardware specific task (i.e. writing to framebuffer, etc)
projects: minguss/skvn
Octocontrabass
Member
Member
Posts: 6245
Joined: Mon Mar 25, 2013 7:01 pm

Re: Designing an Exokernel

Post by Octocontrabass »

No, most libOS functions will not translate to syscalls like that. Especially not VMM functions, since the exokernel doesn't have a VMM.
avcado
Member
Member
Posts: 55
Joined: Wed Jan 20, 2021 11:32 am
GitHub: https://codeberg.org/minguss

Re: Designing an Exokernel

Post by avcado »

Octocontrabass wrote: Mon Aug 04, 2025 7:57 pm No, most libOS functions will not translate to syscalls like that. Especially not VMM functions, since the exokernel doesn't have a VMM.
So the libOS only exposes hardware things (and their abstractions, i.e. a get_keyboard_char() function), like page tables, the framebuffer (like you said), physical memory on the system, what sort of peripherals the system has (i.e. PS/2 mouse, PS/2 keyboard)? I'm assuming the kernel initializes all supported drivers before libOS "initializes"?
Octocontrabass
Member
Member
Posts: 6245
Joined: Mon Mar 25, 2013 7:01 pm

Re: Designing an Exokernel

Post by Octocontrabass »

avcado wrote: Mon Aug 04, 2025 8:32 pmSo the libOS only exposes hardware things (and their abstractions, i.e. a get_keyboard_char() function), like page tables, the framebuffer (like you said), physical memory on the system, what sort of peripherals the system has (i.e. PS/2 mouse, PS/2 keyboard)?
The exokernel exposes hardware devices (page tables, block-based storage, keyboard, framebuffer) and the libOS builds abstractions on top of those (VMM, filesystem, terminal, window manager).
avcado wrote: Mon Aug 04, 2025 8:32 pmI'm assuming the kernel initializes all supported drivers before libOS "initializes"?
Typically yes, but it's not a requirement. You could have some drivers postpone their initialization until the first time a libOS tries to use the corresponding device.
User avatar
bellezzasolo
Member
Member
Posts: 163
Joined: Sun Feb 20, 2011 2:01 pm

Re: Designing an Exokernel

Post by bellezzasolo »

avcado wrote: Mon Aug 04, 2025 4:45 pm Hi all, I've been working on a small i686 kernel. So far, I've gotten a PMM (bitmap), paging, and some descriptor tables set up. For the past week or so, I've been reading about potential architectures for my kernel, and the one that really caught my eye was Exokernels.

After a bit of reading (specifically this paper and the Wikipedia page for Exokernels, I decided that I wanted to try and write an exokernel myself. However I have a few questions about design choices:
  • Would an exokernel need a VMM, or is that an abstraction over paging / should that be put on the developer insteaD?
  • Could LibOS implement these abstractions, "easing" the load on the developer?
  • Obviously a GUI would be possible, so in that case, would LibOS provide functions to "talk" to the framebuffer?
  • In user-mode, do syscalls act like LibOS?
Everything else makes sense to me. Thanks in advance!
I mean, in my personal view, the idea is quite outdated.

Regarding the GUI, modern mainstream graphics cards and drivers effectively have this. It's Vulkan, DirectX, what have you. Modern implementations, with an IOMMU, allow the OS to partition the device, while still granting applications direct access through a shared library (a special case of a LibOS).

For instance, Intel ARC:
Image

NVMe? Novel APIs like DirectStorage again allow this, while working within the access control framework of a filesystem. The traditional ExoKernel design would grant unlimited access a whole physical drive. The concept doesn't allow finer grained access control, and IMO that's far too coarse.
Whoever said you can't do OS development on Windows?
https://github.com/ChaiSoft/ChaiOS
Octocontrabass
Member
Member
Posts: 6245
Joined: Mon Mar 25, 2013 7:01 pm

Re: Designing an Exokernel

Post by Octocontrabass »

bellezzasolo wrote: Thu Aug 21, 2025 9:44 amThe traditional ExoKernel design would grant unlimited access a whole physical drive. The concept doesn't allow finer grained access control, and IMO that's far too coarse.
Chapter 4 of this paper offers a solution.
Post Reply