496code: R20S (Radically Rebuilt OS)


R20S is an attempt at building an operating system from scratch, with an eye toward supporting the software development environment we've always envisioned, on a software platform that is free of the cruft of historical accident, and guided by specific design principles formed out of our decades of experience building large-scale software.

We take modern CPUs and hardware as given. (As much as we'd enjoy it, we're not going to be fabricating hardware components anytime soon.) But after that, we take nothing else as given. We question every software decision above the level of microarchitecture, and try to envision what could be if we could start over. That vision is R20S, and we have started building it.

We started this project in 2018, and then quickly hit a critical question: what language are we building this in? The natural choice was to use C (or a dialect thereof), but we quickly realized that already C was both too limiting, and way too high overhead. So we took a long detour in creating Al, a programming language in which we can enjoy the process of taking on R20S.

R20S starts with the bootloader. Our current bootloader is a three-phase design: Phase 1 and 2 (about 500 lines of assembly code) manage the process of entering 64-bit mode and configuring interrupts and other requried hardware support. At the end of Phase 2, control is transferred to the Phase 3 bootloader, which is written entirely in Al. This Phase 3 bootloader is responsible for configuring and communicating with hardware devices, setting up multiprocessing (SMP), memory management -- in other words, the tasks required for essential operating system support.

R20S is still in development, and has a long way to go -- but we feel we've gotten over the largest hump, which was going from a booted processor to an environment capable of SMP execution of compiled Al code. After that, it's all just details, the kind of coding we're used to and good at. Our dream is to be writing most of our code in Al, on R20S, leveraging our new system foundation and now-unencumbered SW stack to maximize our productivity. Maybe it'll even happen in our lifetimes...

...but if not, hey, we're having fun! At the very least, we have learned more of the nitty-gritty details of the modern CPU boot process, paging and memory management, hardware I/O, interrupts and timers, CPU pipelines and caches, low-level networking, and so on. And it's fun to imagine re-designing our software stack from scratch -- much based on decades of conversations with our good friends Jun Luo and Brian Cantwell Smith on the philosophy of computing. We are trying to explore the space of what it means to use and program computers; to understand what is critical, and what might have been (or could be) different...


Projects | Home | Contact: info@496code.com