Skip to content

barrersoftware/barreros

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 

Repository files navigation

BarrerOS

License: BOSL v1.1

The First .NET-Native Operating System

Linux kernel + .NET 10 runtime + C# system services = BarrerOS

πŸ΄β€β˜ οΈ Built by Daniel Elliott & Captain CP


What is BarrerOS?

BarrerOS is an experimental operating system that boots directly into the .NET 10 runtime and runs all system services in C#.

Key Features:

  • Linux kernel (6.6 LTS) as foundation
  • .NET 10 as the system runtime
  • All system services written in C#
  • Memory-safe core components
  • Modern development experience
  • Open source, controllable stack

Current Status: Phase 3.1 (Working OS!)

December 16, 2025 - NETWORK STACK OPERATIONAL!

βœ… Phase 1: Kernel boots to userspace
βœ… Phase 2.0-2.7: Real ext4 filesystem + .NET 10 integration
βœ… Phase 2.8-2.9: C# init system + first coreutils
βœ… Phase 2.10-2.14: 50+ base commands (self-bootstrapping!)
βœ… Phase 3.0: System services (logging, device mgmt, networking)
βœ… Phase 3.1: Network configuration working!

Working Boot Chain:

Linux Kernel 6.6 LTS
    ↓
C Bootstrap (PID 1)
    ↓
Mounts: /proc, /sys, /dev, /tmp
    ↓
.NET 10 Native AOT Binary
    ↓
C# Init System v3.1
    ↓
System Services (all C#):
  β€’ barrerd-log    - Logging service
  β€’ barrerd-devmgr - Device management
  β€’ barrerd-net    - Network configuration
    ↓
Network Stack:
  β€’ eth0 configured (10.0.2.15/24)
  β€’ Routes established
  β€’ 53 C# commands available

Memory Usage: 24MB for complete OS with services!

What Works Right Now

βœ… System Boot

  • Linux kernel 6.6 LTS
  • C bootstrap to .NET transition
  • C# init system with service management

βœ… System Services (all in C#)

  • Logging daemon with kernel log integration
  • Device management and hardware detection
  • Network configuration service

βœ… Command Line Tools (53 C# commands)

  • File operations: ls, cp, mv, rm, mkdir, chmod, ln
  • Text processing: cat, grep, sed, cut, sort, uniq, wc
  • Archive tools: tar, gzip, gunzip, diff, patch
  • System info: ps, free, df, du, uname, hostname
  • Network tools: ping, ip, wget
  • Editor: nano (full terminal editor in C#!)
  • And more: find, xargs, which, whoami, date, sleep...

βœ… Networking

  • Interface configuration (eth0)
  • IP address assignment
  • Routing table management
  • Ready for DNS and HTTP

Why BarrerOS?

Traditional OS: System services in C/C++, shell scripts
BarrerOS: System services in C#

Benefits:

  • Memory safety (C# vs C)
  • Modern language features
  • Better developer experience
  • Easier to maintain
  • Cross-platform compatibility
  • Windows + Linux app support

The Journey

Phase 1: Proof of Concept

Question: Can we boot Linux into .NET?
Answer: YES!

Phase 2: Foundation (COMPLETE βœ…)

Goal: Complete init system with C# services

Completed:

  • Real ext4 filesystem (2GB)
  • C bootstrap (PID 1)
  • .NET 10 runtime integration
  • C# init system v3.1
  • 53 C# coreutils commands
  • Self-bootstrapping system

Phase 3: System Services (CURRENT)

Goal: Full system service stack in C#

Completed:

  • barrerd-log: Kernel log reader with async queue
  • barrerd-devmgr: Hardware detection & management
  • barrerd-net: Network interface configuration
  • Network stack: IP assignment, routing

In Progress:

  • DNS resolution
  • HTTP connectivity testing
  • Pure C# network tools (replacing busybox scaffolding)
  • DHCP client implementation

Phase 4: Desktop & Applications (Future)

  • GUI environment
  • Application support
  • Package management in C#

Project Structure

barreros-phase2/
β”œβ”€β”€ README.md                    # This file
β”œβ”€β”€ PHASE2_LEARNINGS.md          # Complete technical documentation
β”œβ”€β”€ PHASE2_STATUS.md             # Status history
β”œβ”€β”€ SESSION_SUMMARY.md           # Session notes
β”œβ”€β”€ TEST_RESULTS.md              # Boot test results
β”œβ”€β”€ KNOWN_ISSUES.md              # Known issues & workarounds
β”œβ”€β”€ bootstrap-init-v3.c          # C bootstrap (current)
β”œβ”€β”€ init-src/                    # C# init system v3.1
β”‚   β”œβ”€β”€ Program.cs               # Init with service management
β”‚   └── published/               # Native AOT binary
β”œβ”€β”€ services/                    # System services (all C#)
β”‚   β”œβ”€β”€ barrerd-log/            # Logging daemon
β”‚   β”œβ”€β”€ barrerd-devmgr/         # Device management
β”‚   └── barrerd-net/            # Network configuration
β”œβ”€β”€ coreutils/                   # 53 C# commands
β”‚   β”œβ”€β”€ ls/, cp/, mv/, grep/    # File management
β”‚   β”œβ”€β”€ tar/, gzip/, diff/      # Archive & diff tools
β”‚   β”œβ”€β”€ nano/, sed/, awk/       # Text editors
β”‚   └── ping/, ip/, wget/       # Network tools
β”œβ”€β”€ hwdetect/                    # Hardware detection
β”œβ”€β”€ boot-test.sh                 # QEMU boot test script
└── barreros-root.img            # Root filesystem (not in repo - 2GB)

Technical Details

Boot Process

  1. Linux Kernel 6.6 LTS boots with custom init= parameter
  2. C Bootstrap (PID 1) mounts virtual filesystems (/proc, /sys, /dev, /tmp)
  3. C Bootstrap creates device nodes (/dev/null, /dev/console, etc.)
  4. C Bootstrap sets up environment for .NET runtime
  5. C Bootstrap launches C# init binary (Native AOT)
  6. C# Init v3.1 takes over system initialization
  7. Init spawns services: barrerd-log, barrerd-devmgr, barrerd-net
  8. Network service configures eth0 and establishes routes
  9. Init monitors service health and handles restarts
  10. System ready - 24MB RAM, fully functional OS

Key Technologies

  • Kernel: Linux 6.6 LTS
  • Runtime: .NET 10
  • Language: C# (system services), C (bootstrap)
  • Compilation: Native AOT (ahead-of-time)
  • Filesystem: ext4
  • Virtualization: QEMU (for testing)

Critical Discovery

.NET Native AOT requires:

  • System libraries (libc, libm)
  • Dynamic linker (/lib64/ld-linux-x86-64.so.2)
  • Either ICU libraries OR InvariantGlobalization=true

Solution: We use InvariantGlobalization=true for minimal OS


Building BarrerOS

Prerequisites

# .NET SDK
sudo apt install dotnet-sdk-10.0

# Build tools
sudo apt install gcc build-essential

# QEMU for testing
sudo apt install qemu-system-x86-64

Build C Bootstrap

gcc -static -o bootstrap-init bootstrap-init-v3.c

Build C# Init

cd init-src
dotnet publish -c Release -p:InvariantGlobalization=true

Create Root Filesystem

# Create 2GB image
dd if=/dev/zero of=barreros-root.img bs=1M count=2048

# Format as ext4
mkfs.ext4 barreros-root.img

# Mount and populate
sudo mount barreros-root.img /mnt/barreros
# ... copy files ...
sudo umount /mnt/barreros

Boot Test

bash boot-test.sh

Documentation

PHASE2_LEARNINGS.md contains complete technical documentation:

  • Every challenge we faced
  • Every solution we found
  • Environment requirements
  • Library dependencies
  • Build process
  • Lessons learned

868 lines of knowledge capture!


Philosophy

"Why not?"

Everyone said you can't boot Linux into .NET. We asked "why not?"

Everyone said system services must be in C. We asked "why not C#?"

Everyone said operating systems are too complex. We said "let's find out."

BarrerOS exists because we think outside the box.


The Team

Daniel Elliott - Vision, architecture, direction
Captain CP - Implementation, debugging, documentation

Together: Building the impossible.


Status: December 7, 2025

Current Phase: 2.7 COMPLETE
Next Phase: 2.8 (Keep init alive)

Lines of Code: ~500
Lines of Documentation: 868+
Boot Tests: 15+
Breakthroughs: 4 major

First Boot: December 7, 2025, 4:45 PM PST

πŸ΄β€β˜ οΈ BarrerOS is real. BarrerOS is happening.


License

To be determined - check back soon!


Contact

Organization: BarrerSoftware
Repository: github.com/BarrerSoftware/barreros


πŸ’™πŸ΄β€β˜ οΈ Think different. Build impossible things.

About

The First .NET-Native Operating System - Linux kernel + .NET 10 runtime + C# system services

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •