Comprehensive implementation per local/docs/redbear-power-improvement-plan.md. Source: 2376 LoC across 10 modules (was 1396/6 in v0.6, +980 LoC). Cross-compile: 2.8 MB stripped Redox ELF binary. SHA256: 1b6f9db6ce79e77957bbb1fd606c430516015d5f02f3b64cb6f395e2f63b8e04 Modules: - main.rs (376) — event loop, key + mouse dispatch, render orchestration - app.rs (421) — App, CpuRow, Governor, ThrottleMode, PackageThermal, HybridInfo - render.rs (498) — header/table/controls/help/snapshot rendering - acpi.rs (166) — CPU enumeration, ACPI _PSS, CPUID fallback - cpuid.rs (350) — CPUID leaf decoding (vendor, family, model, SIMD, cache, hybrid) - bench.rs (123) — prime-sieve stress benchmark for thermal response testing - dbus.rs (202) — D-Bus export via zbus 5 (org.redbear.Power, --dbus flag) - msr.rs (127) — MSR constants + PackageThermal decoder - cpufreq.rs (50) — governor hint read/write - theme.rs (72) — central color palette (const Style) Phase A — bug fixes: - R1: PROCHOT pulse bug — Instant::now() math always ~0, pulse never toggled. Replaced with Frame::count() so the bar pulses at a frame-rate-stable rate. - R5: removed duplicate comment block in snapshot(). - C2: PackageThermal struct + 13 PKG_THERM_* bit constants; full decode of IA32_PACKAGE_THERM_STATUS (PL1/PL2/CRIT/TT1/TT2/HFI/temp) surfaced in header. Phase B — quality: - R3: input poll decoupled from refresh cadence (50ms vs 250-2000ms). - R4: Rect::centered replaces hand-rolled centered_rect helper. - R6: area.layout(&Layout) destructuring with compile-time size check. - O2: theme.rs central color palette (LABEL, BORDER_*, STATUS_*). - C9: ratatui 0.30 Stylize shorthand across all renders. Phase C — features: - C1/C8: cpuid.rs reads leaves 0/1/4/7/0x80000000+/0x1A/0x8000001E. - C3: SIMD display header line. - C5: cache hierarchy header line. - C7: dynamic refresh interval via / key (typed input 50..60000ms + Enter). - C6: prime-sieve benchmark via b/B keys (one thread per core, AtomicU64 counter, run/stop/status). Phase D remaining (was deferred per plan s23): - C4: hybrid CPU detection (CoreType enum, Intel leaf 0x1A, AMD leaf 0x8000001E), per-CPU row prefixed with type label, Hybrid: 8P + 16E header. - O1: termion MouseTerminal wrapper enables xterm mouse protocols. Wheel = scroll, Left-click = select/toggle, Right-click = expand P-state. hit_test() maps (x, y) to panel rects cached after every render. - O3: dbus.rs publishes org.redbear.Power on session bus (opt-in via --dbus). Properties: cpu_count, avg_freq_khz, max_temp_c, avg_load_pct, governor, throttle_mode, prochot_asserted. Background thread owns the tokio runtime + zbus Connection; main thread sends snapshots via mpsc channel. Graceful degradation if redbear-sessiond is unreachable. Verification: - cargo build --release (host): 0 errors, 21 warnings. - ./redbear-power --once (Linux host, AMD 24-core): renders all features. - ./redbear-power --dbus (via script(1)): registers on session bus, emits xterm mouse capture sequences. - cook redbear-power (Redox target): 2.8 MB stripped binary at local/recipes/system/redbear-power/target/x86_64-unknown-redox/stage/usr/bin/redbear-power. ISO rebuild status: blocked by pre-existing upstream nix-0.30.1 vs Redox relibc SaFlags incompatibility in uutils (recipes/core/uutils). The v1.1 binary IS staged and will be packaged into the next successful ISO build once that issue is resolved (separate scope). Docs: - local/docs/CONSOLE-TO-KDE-DESKTOP-PLAN.md s3.3.2 - v1.0 + v1.1 sections. - local/docs/redbear-power-improvement-plan.md s24 - full status update. - local/docs/RATATUI-APP-PATTERNS.md - canonical ratatui 0.30 guide (1161 lines), includes s13 ratatui 0.30 Best-Practices Update + s14 Cross-Reference redbear-power as a Reference Implementation. Cargo.toml: new dependencies zbus = "5" (tokio feature) and tokio = "1" (rt + rt-multi-thread + macros) for the D-Bus export.
Red Bear OS
A microkernel operating system written in Rust, derived from Redox OS
What is Red Bear OS?
Red Bear OS is a general-purpose, Unix-like operating system with a microkernel architecture, written in Rust. It is a full fork of Redox OS, frozen at release 0.1.0, with added hardware support, filesystem drivers, and a KDE Plasma desktop path.
Goals:
- AMD & Intel parity — first-class support for both platforms on bare metal
- KDE Plasma desktop — Wayland-based desktop environment via the KWin compositor
- Hardware GPU acceleration — AMD GPU (amdgpu) and Intel GPU drivers via
redox-drm - Modern subsystems — USB, Wi‑Fi, Bluetooth, ext4, GRUB, D-Bus
- Offline-first builds — reproducible from archived, BLAKE3-verified sources
Quick Start
Prerequisites
Linux x86_64 host with Rust nightly, QEMU, nasm, and standard build tools.
See the Redox Build Guide for full setup.
Build & Run
# Clone
git clone https://gitea.redbearos.org/vasilito/RedBear-OS.git
cd RedBear-OS
# Recommended: use the Red Bear wrapper
./local/scripts/build-redbear.sh redbear-mini # Text-only target
./local/scripts/build-redbear.sh redbear-full # Desktop-capable target
# Boot in QEMU with the resulting image
make qemu
Build script:
local/scripts/build-redbear.shis the canonical entry point. Baremake allworks but bypasses the.configchecking andREDBEAR_ALLOW_PROTECTED_FETCH=1gates thatbuild-redbear.shenforces. SeeAGENTS.md§ Build Commands for full details.
Public Scripts
| Script | Purpose |
|---|---|
local/scripts/build-redbear.sh |
Canonical build wrapper for redbear-mini/full/grub |
scripts/run.sh |
Build and run in QEMU (-b to build, -c <config> for target) |
scripts/build-iso.sh |
Build a live ISO for bare-metal boot |
scripts/build-all-isos.sh |
Build all live ISO targets |
scripts/network-boot.sh |
PXE network boot helper |
scripts/dual-boot.sh |
Dual-boot installation helper |
Config Targets
| Target | Type | Description |
|---|---|---|
redbear-full |
Desktop | Wayland + KDE + GPU drivers + D-Bus services |
redbear-mini |
Console | Text-only recovery / install target |
redbear-grub |
Console | Text-only with GRUB boot manager |
Current Status
Red Bear OS boots to a login prompt in QEMU with working wired networking, D-Bus system bus, hardware detection daemons, and filesystem support (RedoxFS, ext4, FAT).
| Area | Status |
|---|---|
| Boot (ACPI/x2APIC/SMP) | ✅ Bare-metal proven |
| Userspace drivers (PCI, storage, net) | ✅ Working in QEMU |
| D-Bus system bus + services | ✅ Working (login1, PolicyKit, UDisks, UPower) |
| ext4 / FAT filesystems | ✅ Compiles, installer-wired |
| POSIX gaps (relibc) | 🚧 Bounded Wayland-facing support |
| DRM/KMS display drivers | 🚧 AMD + Intel compile; HW validation pending |
| Wayland compositor | 🚧 Bounded proof; Qt6/KF6 clients crash at init |
| KDE Plasma desktop | 🔄 In progress (Qt6/KF6 compile; KWin/QML blocked) |
| Wi‑Fi / Bluetooth | 📋 Planned (architected, implementation pending) |
How It Works
Red Bear OS uses a userspace driver model — all drivers run as unprivileged daemons:
Kernel (microkernel)
└── schemes: memory, irq, event, pipe, debug
└── Driver daemons (userspace)
├── pcid → PCI enumeration
├── e1000d → Intel ethernet
├── xhcid → USB controller
└── vesad → Display framebuffer
The kernel provides minimal services (memory, interrupts, IPC). Everything else — filesystems, networking, graphics, input — runs in userspace.
Documentation
- Implementation Plan — roadmap and execution model
- Desktop Path Plan — kernel → DRM → Mesa → Wayland → KDE
- D-Bus Integration — session bus architecture
- USB Plan — USB stack design
- Wi‑Fi Plan — wireless architecture
- Bluetooth Plan — BT stack design
- Documentation Index — full doc map
Contributing
Red Bear OS uses a full fork model. Upstream Redox sources are frozen and archived. All custom work lives in local/:
local/
├── patches/ # Durable changes to upstream source trees
├── recipes/ # Custom packages (drivers, GPU, system)
├── docs/ # Integration and planning docs
└── scripts/ # Build, test, and release tooling
We welcome contributions made with or without AI assistance — we care about quality, not how the code was produced.
License
MIT — same as upstream Redox OS.