目录
目录README.md

NSCoreOS

NSCoreOS - A Modern Operating System with AI-Driven Optimization

Rust License Build Status

A next-generation operating system built from scratch in Rust, featuring high performance, security, and AI-driven self-optimization.

FeaturesQuick StartArchitectureContributingDocumentation


🚀 Overview

NSCoreOS is an ambitious open-source operating system project that aims to combine:

  • High Performance: Lock-free concurrency, multi-core optimization, zero-copy I/O
  • Security: Memory safety (Rust), ASLR, Stack Canary, NX/W^X, MAC framework
  • AI-Driven Optimization: Real-time workload analysis and automatic parameter tuning
  • Multi-Architecture: First-class support for x86_64, AArch64, RISC-V, and LoongArch
  • POSIX Compatibility: Full IEEE Std 1003.1-2017 compliance

Development Status: Early Development (v0.1.0-alpha planned)

Target Release: Q1 2029 (v1.0.0)


✨ Key Features

Architecture & Performance

  • Hybrid Kernel: Critical services in kernel-space, drivers and filesystems in user-space
  • Hardware Abstraction Layer (HAL): Architecture-agnostic design via trait abstraction
  • Dual-Architecture Parallel Development: x86_64 and AArch64 developed in lockstep
  • Microservice Framework: Dependency injection, AOP, event-driven communication

Advanced Capabilities

  • AI Self-Optimization: Adaptive I/O scheduler, TCP congestion control, and CPU scheduling
  • Virtualization: Built-in Type-1 hypervisor (Intel VT-x, AMD-V, ARM VHE)
  • Container Support: Kernel-level cgroups and namespaces
  • Multi-ABI Compatibility: Linux (glibc translation), Windows (Wine-like), macOS (Mach-O)

System Features

  • Filesystems: Native support for ext4, NTFS, Btrfs; read-only XFS, ZFS
  • Graphics: Vulkan-based composator and native UI framework
  • Networking: Full TCP/IP stack with BBR/CUBIC congestion control
  • Web Engine: Lightweight, high-performance browser engine built in Rust

🏗️ Architecture

NSCoreOS follows a layered architecture:

┌─────────────────────────────────────────┐
│         User Space                      │
│  Applications | POSIX | Web Engine      │
└─────────────────────────────────────────┘
              ↓ System Calls
┌─────────────────────────────────────────┐
│      Microservices Layer                │
│  Process | Filesystem | Network | IPC  │
└─────────────────────────────────────────┘
              ↓ DI Container
┌─────────────────────────────────────────┐
│      Kernel Core Framework              │
│  DI | Event Bus | AOP | Sync Primitives │
└─────────────────────────────────────────┘
              ↓ HAL Interface
┌─────────────────────────────────────────┐
│      Hardware Abstraction Layer         │
│  MMU | Interrupt | Timer | I/O          │
└─────────────────────────────────────────┘
              ↓ Platform Code
┌─────────────────────────────────────────┐
│      Platform Support                   │
│      x86_64  |  AArch64                │
└─────────────────────────────────────────┘

For detailed architecture documentation, see docs/architecture/SYSTEM_ARCHITECTURE.md.


🎯 Development Roadmap

We follow a milestone-based development approach with incremental releases:

  • M0 (Week 1-2): Infrastructure & Build System
  • M1 (Week 3-5): Hardware Abstraction Layer
  • M2 (Week 6-9): Memory Management
  • M3 (Week 10-14): Process & Thread Scheduling
  • M4 (Week 15-20): Filesystem (VFS + FAT32)
  • M5 (Week 21-27): Network Stack (TCP/IP)
  • M6 (Week 28-32): IPC Mechanisms
  • M7 (Week 33-40): Graphics System
  • M8 (Week 41-48): MVP Integration & Optimization
  • M9 (Week 49-60): AI Framework Integration
  • M10 (Week 61-72): RISC-V & LoongArch Support

See docs/progress/ROADMAP.md for detailed milestone planning.


🚀 Quick Start

Prerequisites

  • Rust 2024 Edition (nightly)
  • QEMU 8.0+ (for testing)
  • Clang/LLVM 16+
  • NASM (for x86_64 bootloader)
  • UEFI SDK (optional)

Building

# Clone the repository
git clone https://github.com/nscoreos/nscoreos.git
cd nscoreos

# Build for x86_64
cargo build --target x86_64-nscoreos

# Build for AArch64
cargo build --target aarch64-nscoreos

# Run tests
cargo test --workspace

# Run in QEMU (x86_64)
./tools/qemu/run_x86_64.sh

# Run in QEMU (AArch64)
./tools/qemu/run_aarch64.sh

Current Status

⚠️ Note: This project is in early development. We are currently working on Milestone M0 (Infrastructure).

Currently implemented:

  • ✅ Workspace structure
  • ⏳ Custom target definitions (in progress)
  • ⏳ Linker scripts (in progress)

Planned for v0.1.0-alpha1:

  • Basic bootloader (UEFI)
  • Kernel entry point
  • Minimal print output

📚 Documentation


🤝 Contributing

We welcome contributions! NSCoreOS is an open-source community project.

Ways to Contribute

  1. Code: Pull requests for bug fixes, features, or optimizations
  2. Documentation: Improve docs, fix typos, write tutorials
  3. Testing: Write unit tests, integration tests, or report bugs
  4. Review: Code review, architecture feedback
  5. Community: Answer questions, help new contributors

Getting Started

  1. Read CONTRIBUTING.md for contribution guidelines
  2. Check Good First Issues for beginner-friendly tasks
  3. Join our Discord server (coming soon)
  4. Read the development guide (in progress)

Code of Conduct

We are committed to providing a welcoming and inclusive environment. Please read our Code of Conduct.


🎓 Learning Resources

If you’re interested in OS development in Rust:


🛠️ Tech Stack

  • Language: Rust 2024 Edition
  • Build System: Cargo (workspace)
  • Testing: Custom test framework + QEMU
  • CI/CD: GitHub Actions
  • Documentation: rustdoc + mdBook

Key Dependencies

# Core
spin = "0.9"           # Spin locks
lock_api = "0.4"        # Lock API
buddy_system_allocator = "0.9"  # Physical memory allocator
volatile = "0.5"        # Volatile accesses
bitflags = "2.4"        # Bit flags

# Logging
log = "0.4"
defmt = "0.3"           # Format for embedded systems

# Platform-specific (optional)
x86_64 = "0.14"         # x86_64 support
aarch64 = "0.1"         # ARM64 support
riscv = "0.10"          # RISC-V support (future)

📊 Project Status

Component Status Target Version
HAL 🏗️ In Design v0.1.0-alpha2
Memory Management ⏳ Planned v0.1.0-alpha3
Process Scheduler ⏳ Planned v0.1.0-beta1
Filesystem ⏳ Planned v0.1.0-beta2
Network Stack ⏳ Planned v0.1.0-beta3
Graphics ⏳ Planned v0.2.0-beta2
AI Framework ⏳ Planned v0.3.0

🗺️ Project Goals

Short-term (3 months)

  • Complete M0-M2 (Infrastructure + HAL + Memory)
  • Achieve 80%+ test coverage on dual architectures
  • Build community of 3-5 active contributors

Mid-term (12 months)

  • Complete M0-M6 (Process, Filesystem, Network)
  • MVP demo system (command-line version)
  • Performance: 60% of Linux on Phoronix Test Suite

Long-term (36 months)

  • Complete M0-M10 (Full MVP)
  • Support 4 architectures (x86_64, AArch64, RISC-V, LoongArch)
  • AI framework automatic optimization
  • Active community with enterprise users

📜 License

NSCoreOS is dual-licensed under:

You may choose either license for your use.


🙏 Acknowledgments

  • Rust Project: For the amazing language and toolchain
  • Rust OSDev Community: For invaluable resources and discussions
  • Phil Opp: For the excellent “Writing an OS in Rust” blog series
  • Redox OS: For demonstrating a pure Rust OS is possible
  • Linux Kernel: For decades of OS research and development

📮 Contact & Community


Built with ❤️ in Rust

NSCoreOS - A New Generation Operating System

⬆ Back to Top

关于

全新的操作系统

1.9 MB
邀请码