Designed a kernel with only one system call, but the one system call is basically ioctl so it doesn’t really count.

I have now mostly implemented a userspace version of this kernel in C.

Show thread

I didn't do it in Rust because C is faster for the prototyping of stupid and low-level ideas no one will actually use.

Show thread

The basic idea has two parts:

1. Microkernel where communication with the kernel is also via message-passing, even for task and memory management.
2. Tight binding between IPC and CPU scheduling; each "port" has an associated function which runs when the port receives a packet. This is the only way of getting CPU time in userspace. A port can be set to get empty "idle" packets from the kernel.

Show thread

There seems to be some interest in this. I’ll MIT the code and stick it on my GitLab (I’ll self-host Gitea or something at some point, but still on GL for now) once I have a working demo.

Show thread

You don’t want to use this thing. free(buf) turns into

struct unmapspace_frm del = {
.frm = {
.dst = SPACEMGR,
.typid = UNMAPSPACE,
.frmsz = sizeof(unmapspace_frm),
.pktsz = sizeof(unmapspace_pkt)
.pkt = {
.here = buf
} = &del.pkt;


I mean it could be improved with macros and wrapper functions but still.

Show thread

It is very difficult to program when memory allocation is asynchronous.

Show thread

It took me almost 40 lines across two functions to implement a single realloc.

Please never use this thing. I’ll post the code still, but please never use it for anything serious.

Show thread

@wmww I think you should see this whole thread. It makes a good example of what happens when I let myself pursue my crazy spur-of-the-moment ideas.

Show thread


Please come up with another word than, "port," otherwise that will be superconfusing forever. Cool project.

Sign in to participate in the conversation

Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.