Skip to content

ggielly/strat9-os

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

472 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Strat9-OS

Strat9-OS is an Operating System based on a modular microkernel written in Rust. The kernel provides scheduling, IPC, memory primitives, and interrupt routing. Everything else (filesystems, networking, drivers...) runs as isolated userspace components called Silos, also written in Rust.

The goal is to run various native binaries (ELF, JS, WASM..) inside the silo environment => IPC => kernel. And give features to silos like network stack, filesystem, etc. with Strates.

The Chevron shell can manage silos and strates with a bunch of commands.

Architecture concept summary: Bedrock is the microkernel, Silos are isolated Ring-3 execution units, Strates are functional layers hosted inside Silos and they can discuss together. Silos are isolated eachother.

Architecture

  • Kernel (Bedrock) in Ring 0 : minimal, #![no_std].
  • Silos are in Ring 3 : isolated components communicate via IPC.
  • Strate are in Silo : network stack, filesystem, etc.
  • Capabilities gate access to resources.
  • Plan 9 style scheme model for resources.

Status, some highlights

This project is in active development and not production-ready. The ABI is still not stabilized. The documentation can be built and published using the publish-doc.sh script.

Screenshots from QEMU : bootsequence and Chevron shell

Graphics test Chevron and boot

Top - process monitor 2D framebuffered process monitor like (top command)

ls and uptime ls and uptime

Networking Networking

Strate strate screen management

Memory and CPU info Memory and CPU information

Graphics test Graphics subsystem test

Kernel

- SMP boot with per-CPU data, TSS/GDT, GSBase-based SYSCALL, per-CPU caches and per-CPU scheduler
- Two-stage allocator: buddy allocator for early boot and a dedicated kernel allocator (CoW support, heap/kmalloc/slab)
- Virtual memory: 4-level paging, HHDM, CR3 switching, page-fault handling (COW, mmap), user/kernel mappings
- Preemptive multitasking with APIC/x2APIC and per-CPU timers
- Limine boot path and bootable ISO
- Scheduler with priority/round-robin and CPU hotplug support
- IPC: synchronous ports, shared-memory rings (zero-copy), capability manager and VFS scheme router
- ELF loader and Ring-3 execution (userspace silos)
- POSIX interval timers and signal infrastructure
- Interrupts & exceptions: IDT, IRQ handling, exception dumps and backtraces
- Device model: PCI discovery, VirtIO and legacy drivers (block, net), console drivers
- Debugging & tooling: early serial/VGA output, configurable log levels, QEMU run targets and ISO tooling
- ACPI support and power management
- Optional Linux ABI compatibility shim for ELF binaries

Userspace components

- EXT4 filesystem
- RamFS filesystem
- XFS filesystem (WiP and disabled) 
- VirtIO block and net drivers (kernel-side)
- libc (relibc from the Redox-OS project)
- IPv4 network stack with UDP/TCP/ICMP support, dhcp client, telnet server
- e1000/e1000e and virtio NIC drivers
- WASM native execution strate
- Remote access via SSHd or grapical with VNC
- CLI for managing silo and strate : memory management, start, stop, delete...
- Basic commands : cat, ls, uptime, reboot, shutdown, cd, top
- VFS with /proc /sys ...
graph TD
    subgraph Ring 3 [Userspace / Silos]
        direction TB
        App[Application]:::app
        Drivers[Drivers & Services]:::sys

        subgraph Silo_JS [JIT JS Silo]
            JS_Runtime[JIT JS Runtime]:::app -->|IPC| Net[Net Stack]:::sys
            JS_Runtime -->|IPC| FS[Filesystem]:::sys
        end

        subgraph Silo_Native [Native Silo]
            ELF[ELF Binary]:::app -->|IPC| Console[Console Driver]:::sys
        end
    end

    subgraph Ring 0 [Kernel SpacSee `LICENSE`.e / Bedrock]
        Kernel[Bedrock Kernel]:::kernel
        Sched[Scheduler]:::kernel
        IPC[IPC System]:::kernel
        MM[Memory Manager]:::kernel

        Kernel --- Sched
        Kernel --- IPC
        Kernel --- MM
    end

    JS_Runtime -.->|Syscall/IPC| Kernel
    Net -.->|Syscall/IPC| Kernel
    FS -.->|Syscall/IPC| Kernel
    ELF -.->|Syscall/IPC| Kernel
    Console -.->|Syscall/IPC| Kernel

    classDef kernel fill:#f96,stroke:#333,stroke-width:2px;
    classDef sys fill:#8cf,stroke:#333,stroke-width:1px;
    classDef app fill:#8f9,stroke:#333,stroke-width:1px;
Loading

Build

Prerequisites

  • Rust nightly with rust-src and llvm-tools-preview.
  • QEMU.

Commands

Install the Rust toolchain

rustup install nightly
rustup component add rust-src llvm-tools-preview
rustup target add x86_64-unknown-none

Compile the kernel and run it

cargo make kernel
cargo make limine-image
cargo make run-gui-smp or cargo make run-gui (for single CPU test)

or

cargo make

Device list where Strat9-OS is booting

  • QEMU
  • Lenovo Thinkpad X13

Repository way of life

  • workspace/kernel/ : the strat9-os kernel : Bedrock
  • workspace/components/ : userspace components
  • workspace/bootloader/ : limine-based bootloader
  • doc/ : specifications and design docs
  • tools/ : build and helper scripts

Related specifications

todo...

License

All the code is under GPLv3. See THIRD_PARTY_LICENCES.txt for more informations about librairies and software shared. Many thanks to the authors !

About

Strat9-OS is an operating system based on a microkernel written in Rust. Run native binary (WASM, ELF...) with small footprint directly on the kernel. Mirror of https://git.strat9-os.org

Topics

Resources

License

Stars

Watchers

Forks

Contributors