Sisyphus 2306ac2236 intel/ring,execlists,context: fix ELSP order, CTX_CTRL bits, LRC layout
Critical fixes from Linux kernel cross-reference:

- execlists.rs flush_pending(): write upper 32 bits FIRST, then lower.
  BSpec requires upper-first on legacy ELSP; GPU latches on lower write.
  Previously wrote lower then upper — stale upper dword used by GPU.

- execlists.rs init(): write only INHIBIT_SYN_CTX_SWITCH to RING_CONTEXT_CONTROL.
  Linux init_common_regs() disables ENGINE_CTX_RESTORE_INHIBIT and
  RS_CTX_ENABLE for normal operation. Our old code set restore inhibit,
  preventing context save/restore on context switch — GPU would hang.

- context.rs: LRC image offsets were MMIO register offsets (0x30, 0x34, 0x38).
  LRC state layout is different — CTX_CONTEXT_CONTROL is dword index 3 (byte 12).
  Fixed to match Linux intel_lrc_reg.h dword layout:
    LRC_CTX_CTRL_OFFSET = 12  (was 0x02)
    LRC_HEAD_OFFSET = 20       (was 0x30)
    LRC_TAIL_OFFSET = 28      (was 0x34)
    LRC_RING_START_OFFSET = 36 (was 0x38)
    Added LRC_RING_CTL_OFFSET = 40

- context.rs: corrected CTX_CTRL_INHIBIT_SYN_CTX_SWITCH from bit 2 to bit 3
  to match Linux RING_CONTEXT_CONTROL bit layout at 0x244.

- ring.rs: added gpu_address() method to expose ring GGTT address for
  LRC descriptor construction.

- mod.rs: wire execlist submission path after ring batch submit in
  hw_submit_to_ring(), creating LRC descriptor and submitting via ExeclistPort.

- display.rs: program HDMI infoframes (AVI, audio, VSIF) on port enable.
2026-06-03 18:20:19 +03:00

Red Bear OS

Red Bear OS

A microkernel operating system written in Rust, derived from Redox OS

MIT x86_64 Status


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, WiFi, 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

# Build and run the desktop target in QEMU
./scripts/run.sh --build

# Build a live ISO for bare metal
./scripts/build-iso.sh redbear-full

# Build the text-only recovery target
./scripts/run.sh --build --config redbear-mini

Repository Hosting

The canonical Red Bear OS Git server is Gitea at https://gitea.redbearos.org/vasilito/RedBear-OS.git. GitHub is not a Red Bear OS source of truth and must not be used for pushes, issues, releases, or project coordination.

Public Scripts

Script Purpose
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)
WiFi / 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

Contributing

Red Bear OS uses a full fork model. Upstream Redox sources are frozen and archived. All custom work lives in local/:

local/
├── sources/     # Red Bear source forks (git repos, directly editable)
├── 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.

S
Description
RedBear Operating System, based on RedoxOS. Licenced under MIT license.
https://redbearos.org
Readme MIT 18 GiB
Languages
C 37.5%
C++ 37.2%
JavaScript 6.7%
QML 3.4%
HTML 3.2%
Other 11.4%