DbgOS: an OS written in Rust that uses actors instead of threads
The author is building DbgOS, an operating system written from scratch in Rust, to try different OS design ideas. The article describes how DbgOS handles concurrency with the actor model[1], where each actor has its own mailbox[2] and can communicate only by sending messages.
Modules are ELF[3] binaries whose metadata describes their data types and actors, and the module! macro generates that metadata. Each actor handles one message at a time, and no kernel or SDK function blocks, so messages are sent without waiting for a reply. A handler must finish within a limited time window, and the kernel kills any instance that exceeds it. Modules cannot have writable segments, and the OS and compiler prevent instances from sharing writable memory unless unsafe Rust is used. Long CPU-bound work, such as decompression or checksums, must be written as async code that can pause and resume, which is cooperative multitasking[4].
The author says this design leads to threadless concurrency without locks, strong data partitioning, and the ability to hot swap any module without losing state.
Read the original timdbg.comDiscussion
Discussion
Commenters mostly point to older actor systems: COBOL programs from the 1970s that used queues, Erlang, Akka and BEAM. Several doubt that the no-preemption design works for long computations, ask what happens to a file write when a handler is killed, and say that debugging actor systems is hard.
Links from the post and discussion
Sources
-
TimDbg
An OS with no threads - The Actor Model
-
KRGeekNews KO
스레드 없는 OS: 액터 모델


