Objlab
← News
Linguaggi e compilatori

C'è qualcuno qui interessato a contribuire a questo sistema operativo?

Sintesi redazionale: URL dell'articolo: https://github.com/valivalivali/x-os URL dei commenti: https://news.ycombinator.com/item?id=48423381 Punti: 5 # Commenti: 2. Fonte originale: https://github.com/valivalivali/x-os

<p>**A forward-looking operating system built from scratch for the AI era.**</p><p>X OS is a clean-slate microkernel operating system designed for a world where intelligent agents and human users work together. It asks a simple question: *what would an OS look like if it were designed today — for agentic programming, programmatic interaction, and human-AI collaboration?*</p><p>*X OS running in QEMU with GPU-accelerated rendering — menu bar, dock with app icons, compositor surfaces, and desktop at 2560×1600.*</p><p>Software is changing. AI agents don&#x27;t just call APIs — they read code, write code, run commands, debug, and iterate. They need an environment that is observable, scriptable, and mutable at a level that current operating systems weren&#x27;t designed to provide.</p><p>X OS starts from a different premise. The system is built so that **every service is inspectable, every component is replaceable, and every interaction is programmable** — not through tooling layered on top, but as a first-class architectural principle. The microkernel exposes IPC ports that any process (human or agent) can use to query, control, and extend the system in real time.</p><p>**AI-native architecture**— the OS assumes agents are first-class users. IPC, service discovery, and system introspection are designed for programmatic use from day one.**Microkernel by design**— the kernel handles scheduling, memory, IPC, and hardware. Everything else — display, filesystem, networking, shell — is a userspace service that can be inspected, modified, or replaced while the system runs.**Everything is observable**— services communicate over IPC ports with a nameserver for discovery. Any process can query the system state, subscribe to events, or intervene. This is not a debugging feature; it is the architecture.**Clean slate**— no decades-old ABI to maintain, no legacy cruft. The system is free to make the right decision for today and for what comes next.**Forward-looking**— designed for what&#x27;s ahead: agentic workflows, programmatic interaction, and human-AI collaboration.</p><p>The core idea is fixed: **a forward-looking operating system built for the AI era, designed for agentic workflows and intelligent users.** That will not change.</p><p>Everything else is open. The architecture, the UI, the technologies, the priorities — all will evolve as the project grows and as the landscape of AI-native computing takes shape. Design decisions made today may be revised tomorrow. Components may be rewritten, replaced, or removed. That&#x27;s not a risk; that&#x27;s the point.</p><p>The desktop environment aims to feel familiar — a menu bar, a dock, windows, a cursor. We lean into known conventions because they work and users already understand them. But this is not a commitment. If we discover something fundamentally better, we will explore it. The goal is to build an interface that is intuitive today and open to reinvention tomorrow.</p><p>X OS boots on real hardware (via Limine) and in QEMU, with a working desktop environment:</p><p>**Microkernel**— ~90 syscalls covering scheduling, memory management, IPC ports, timers, GPU/virtio drivers, NVMe storage, and networking**Userspace composer**— hardware-accelerated display server with surface compositing, dirty rectangles, window decorations, cursor management, and GPU rendering via virgl (OpenGL ES)**Menu bar**— top panel with app menus, dropdowns, and focus tracking**Dock**— bottom panel with app icons, hover effects, and app launch/close**Context menu**— right-click popup service powered by egui (Rust,`no_std`</p><p>)**Shell**— embedded zsh port running as a userspace process**File manager**(Xplorer) — draggable window app**Networking**— XNU BSD network stack ported to the microkernel: TCP/UDP sockets, virtio-net driver, POSIX socket API**Filesystem**— custom XFS filesystem with NVMe block device support**GPU acceleration**— virtio-gpu with virglrenderer for OpenGL ES 3D compositing; custom GPU command stream for textured quad rendering with alpha blending**egui integration**— egui 0.35 ported to`no_std`</p><p>/`x86_64-unknown-none`</p><p>with a custom CPU rasterizer (scanline glyph renderer) and software backend for immediate-mode UI rendering</p><p>| Component | Ring | Responsibility |<br>|---|---|---|<br>Kernel |<br>0 | Scheduling, memory alloc/map, IPC ports, timer, interrupts, NVMe, virtio GPU, virtio-net, PCI |<br>Init (PID 1) |<br>3 | First userspace process; spawns services, registers nameserver ports |<br>Composer |<br>3 | Display server — surfaces, dirty rects, window decorations, cursor, GPU compositing |<br>Menu Bar |<br>3 | Top panel — X logo, app menus, dropdowns, focus tracking |<br>Dock |<br>3 | Bottom panel — app icons, hover effects, spawn/hide/show/close |<br>Context Menu |<br>3 | Right-click popup — egui-based, Rust `no_std` staticlib |<br>Shell |<br>3 | zsh port — runs as a userspace process |<br>Xplorer |<br>3 | File manager — draggable window |<br>BSD Layer |<br>0→3 | XNU BSD networking stack (sockets, TCP/IP, virtio-net) adapted for the microkernel |</p><p>The kernel is a minimal microkernel: it handles CPU scheduling, physical/virtual memory, IPC message ports, and hardware drivers (NVMe, virtio-gpu, virtio-net, PS/2 input, PCI, timers). It does **not** contain filesystem code, display logic, or networking — those are userspace services.</p><p>All userspace binaries (init, composer, dock, menubar, menu, shell) are compiled as ELF binaries and **embedded directly into the kernel image** as byte arrays. The kernel spawns them at boot — no disk loading, no bootloader chain for userspace.</p><p>Services communicate via IPC ports. The composer registers a well-known port; apps send surface creation requests, dirty rectangles, and mouse events over IPC. The nameserver (`sys_ns_register`</p><p>/ `sys_ns_lookup`</p><p>) provides service discovery.</p><p>GPU compositing uses virgl (OpenGL ES via virtio-gpu 3D). Each app surface gets a GPU texture; the composer submits a 3D command stream that draws textured quads with alpha blending onto a framebuffer-backed render target that is also the scanout source.</p><p>Tested on macOS with Apple Silicon. You need:</p><p>-<br>**Xcode Command Line Tools**(provides`clang`</p><p>,`make`</p><p>,`git`</p><p>)`xcode-select --install`</p><p>-<br>**Homebrew**— https://brew.sh -<br>**lld**(LLVM linker)`brew install lld`</p><p>-<br>**xorriso**(for building the bootable ISO)`brew install xorriso`</p><p>-<br>**QEMU**— install via Homebrew or build from source. The Makefile auto-detects the path.Option A — Homebrew (quickest):</p><p>`brew install qemu`</p><p>Option B — build QEMU v11 from source with virgl/ANGLE GPU rendering (recommended for GPU acceleration on Apple Silicon):</p><p>`# Install the startergo tap for virgl/ANGLE dependencies brew tap startergo/homebrew-qemu-virgl brew trust startergo/qemu-virgl brew install libangle libepoxy-angle virglrenderer spice-protocol spice-server \ meson ninja glib pixman pkg-config dtc vde libssh # Build QEMU v11.0.2 with Cocoa + virgl + OpenGL ES bash tools/build-qemu-virgl.sh`</p><p>This builds QEMU v11.0.2 with</p><p>`virtio-gpu-gl-pci`</p><p>support, Cocoa display, and OpenGL ES rendering via ANGLE/virglrenderer. The script handles patching, building, installing to`/opt/qemu-head`</p><p>, fixing dylib paths, and code-signing with HVF entitlements.The Makefile checks</p><p>`/opt/qemu-head`</p><p>first, then the Homebrew`qemu-virgl`</p><p>prefix, then the Homebrew`qemu`</p><p>prefix, then falls back to`qemu-system-x86_64`</p><p>in your PATH.</p><p>One-time setup (downloads the Limine bootloader):</p><p>```<br>make setup<br>```</p><p>Build the bootable ISO:</p><p>```<br>make<br>```</p><p>This produces `x-os.iso`</p><p>in the project root.</p><p>BIOS mode (SeaBIOS):</p><p>```<br>make run<br>```</p><p>UEFI mode (OVMF):</p><p>```<br>make run-uefi<br>```</p><p>QEMU is launched with:</p><p>- Machine:<br>`q35`</p><p>- 512 MB RAM, 1 SMP<br>- virtio-gpu-pci at 2560x1600, Cocoa display<br>- NVMe disk (<br>`disk.img`</p><p>, created automatically if missing) - Serial output forwarded to stdio</p><p>```<br>x/<br>├── boot/ # Limine bootloader config and handoff structures<br>├── kernel/ # Microkernel source<br>│ ├── arch/x86_64/ # GDT, IDT, syscall entry, context switch<br>│ ├── memory/ # Physical page allocator, VMM, heap<br>│ ├── sched/ # Round-robin scheduler<br>│ ├── ipc/ # Port-based message passing<br>│ ├── proc/ # ELF loader; embedded userspace blobs<br>│ ├── hal/ # NVMe, virtio GPU, virtio-net, PS/2 input, PCI, timers<br>│ ├── fs/ # Custom XFS filesystem<br>│ ├── bsd/ # XNU BSD syscall implementations (sockets, fork, exec, pipe)<br>│ └── entry/ # kmain() boot sequence<br>├── bsd/ # XNU BSD networking stack (TCP/IP, sockets, virtio-net)<br>├── userspace/ # Ring-3 code<br>│ ├── init/ # PID 1<br>│ ├── runtime/ # Syscall wrappers (shared C library)<br>│ ├── shell/ # zsh port<br>│ ├── lib/<br>│ │ ├── xgfx/ # Graphics library (paths, fills, text, scaled text)<br>│ │ ├── thorvg/ # ThorVG vector graphics engine (SVG rendering)<br>│ │ ├── wm/ # Window manager IPC protocol library<br>│ │ └── cpp_runtime/ # C++ runtime support for freestanding environment<br>│ └── services/<br>│ ├── composer/ # Display server + GPU compositing<br>│ ├── dock/ # Bottom dock panel<br>│ ├── menubar/ # Top menu bar panel<br>│ ├── menu/ # Right-click context menu (egui, Rust no_std)<br>│ └── xplorer/ # File manager app<br>├── third_party/ # Vendored dependencies<br>│ ├── egui/ # egui 0.35 (ported to no_std/x86_64-unknown-none)<br>│ ├── egui_software_backend/ # CPU rasterizer for egui primitives<br>│ └── llvm-project-libcxx/ # libc++ for freestanding C++ runtime<br>├── tools/ # Build scripts (QEMU virgl build, etc.)<br>├── Makefile<br>└── disk.img # Raw block device image (auto-created)<br>```</p><p>```<br>make clean # remove build artifacts and ISO<br>make distclean # also remove fetched Limine directory<br>```</p><p>Business Source License 1.1</p><p>X OS is source-available under the BSL. This means:</p><p>**Free for contributors**— you can fork, modify, build, and send pull requests.**Free for personal, educational, and research use.****Commercial use requires a paid license**— if you want to sell it, offer it as a service, or embed it in a product, contact the copyright holder.**All commercial rights reserved**— the copyright holder controls all commercial licensing and may grant or deny commercial use at their sole discretion.</p><p>This model lets the community grow the project while keeping all commercial and acquisition paths fully controlled by the copyright holder. See LICENSE for full terms.</p><p>For commercial licensing, partnership, or acquisition inquiries, contact the copyright holder.</p>