Repository navigation
The first release of PsyDian: an AI-assisted operating system written from scratch in Rust, built between September and December 2026.
PsyDian is a bare-metal x86_64 kernel that turns its own failures into structured diagnostics. A host-side AI Bridge reads them over the serial port and asks an AI service what went wrong and what to try next. The AI only suggests, the kernel checks, and the user decides.
Try it
curl -fsSL https://raw.githubusercontent.com/PsyDianOS/PsyDian_OS/main/scripts/install.sh | bash
psydian demopsydian demo runs with a built-in mock AI, so no API key is needed. Inside PsyDian, try ai hello, then run 1. Use psydian ai-setup to connect a real AI service (free Gemini by default).
What's in 0.1.0
Kernel
- Boots in QEMU through
bootloader0.11 (BIOS), to a working shell in about half a second. - GDT and TSS with a separate 20 KiB stack for double faults, so a stack overflow is caught instead of resetting the machine.
- IDT with handlers for CPU exceptions; 8259 PIC with the timer (100 Hz), keyboard and serial interrupts.
- 4-level paging, a frame allocator and a 1 MiB kernel heap with a fixed-size block allocator (
Box,VecandStringwork). - Input from the PS/2 keyboard and the serial console, merged into one queue.
- A shell with line editing, history and tab completion, and 14 commands:
help,clear,info,meminfo,uptime,echo,history,logs,diag,ai,run,panic-test,fault-testandshutdown.
Diagnostics
- A central logger with levels, subsystems and stable event codes (
[ERROR][MEMORY][MEM-003] ...), with a bounded in-memory history. - Structured diagnostic records with error codes and CPU context for page faults, heap failures and panics.
@PSYJSON frames on the serial line for the AI Bridge, parsed and validated inside the kernel by an allocation-free JSON reader.
AI Bridge
- A host-side Rust program that connects to the kernel's serial port, builds a short context from recent diagnostics and asks an AI service.
- Providers: Gemini (free tier, default), OpenRouter, OmniRoute, Ollama (local), Claude, and a mock provider for offline testing.
- Every answer is validated: size limits, a fixed JSON shape and a command filter that removes unknown or destructive commands.
- One automatic retry when a service is temporarily overloaded, with the provider's real error message.
Safety
- No network and no API keys inside the kernel. The key stays on the host in
~/.config/psydian/ai.env. - Every AI suggestion is checked twice: by the bridge and again by the kernel's risk policy (safe runs, sensitive and privileged ask first, destructive is blocked).
Tooling
- One-command installer for Linux, macOS and Windows (WSL), and a
psydiancommand (run,demo,ai,ai-setup,check,test,update). - About 185 tests: kernel unit, integration and crash tests that run inside QEMU (
cargo ktest), 49 AI Bridge tests, an end-to-end smoke test and 15 tests for the comment bot. CI runs them on every pull request. - Comment commands on issues and pull requests:
/lgtm,/approve,/hold,/retest,/assign,/label,/closeand more.
Documentation
- Website: https://psydianos.github.io/PsyDian_OS/
- Design and reference docs: https://psydianos.github.io/docs/
Known limitations
- One task at a time: no scheduler, user mode or system calls yet.
- No file system, so logs live in memory and on the serial line only.
- QEMU with BIOS boot only; UEFI and real hardware are not supported yet.
- The AI needs a host-side bridge and, except for Ollama, a network connection.
What's next
Phase 2 starts with multitasking (tasks, context switching and a scheduler on the 100 Hz timer), then user mode and system calls, a file system with logs saved to disk, and an ELF loader. Ideas and help are welcome in Discussions.
Team
- Anurag Singh (@Itx-Psycho0): kernel and core OS
- Aditya Chauhan (@obsidiannnn): AI Bridge and AI integration
Licensed under MIT or Apache 2.0, at your option.