r/osdev • • 5d ago

Finally I've reached a minimal FreeBSD userspace

Boot into FreeBSD Userland
SDK generates by ipc-codegen
A Server implements VfsBackend, so it can register this object to Vfs.

After a month of work, finally I've reached a minimal FreeBSD userspace.

Now it has:

  1. A userspace Mach-O loader, with dynamic link supports
  2. initd, netd, vfsd, devmgrd, usbd, acpid, etc.
  3. A multitasking system fully based on Rust Future premitives, powered by EEVDF scheduling algorithm.
  4. An object-orientd capability system inspired by seL4, Objective-C and abi_stable, which supports trait based polymorphism. The accompanying ipc-codegen can directly generate SDK crates from server-side code (the kernel is also a server). IPC calls and even system calls are as simple as calling a regular Rust crate. Kernel also provides a asynchronous primitive to support asynchronous object method calls between processes. Everything in kernel is object.
  5. A Mach-O linker written in Rust
  6. A filesystem based on GEFS

Except FreeBSD codes and a few assembly, everything is written in Rust.

7 Upvotes

2 comments sorted by

1

u/DescriptionOptimal15 5d ago

Doesn't it already have a userspace

1

u/Molyuuing 5d ago

It does not have a functional userspace before, only for debug. I've completely rewrite the kernel after I first post it. I think the architecture I designed back then was too inefficient and inconvenient for user-space program development. Now, i can directly generate SDKs and `cargo add` them, and then call them just like a regular crate, which speeds up user-space development. I don't need to spend much time writing a runtime at all. Almost everything is generated from kernel code and server code. In fact, the supporting components for development (linker, IPC Codegen, etc.) took longer to develop than the OS itself.