Commit Graph

30 Commits

Author SHA1 Message Date
vasilito 8237bc45e8 feat: login rate limiting, network drivers in initfs
P2-2: Login rate limiting (userutils/login.rs):
- Tracks consecutive failures, resets on success
- 3+ failures: exponential delay up to 30 seconds
- Applies to both password and blank-password login paths

P2-3: Network stack in initfs (base-initfs + service files):
- Added e1000d, rtl8168d to base-initfs BINS
- 60_smolnetd.service: network stack in initfs
- 61_dhcpd.service: DHCP client in initfs
- Network available before switch_root

Part of COMPREHENSIVE-FIX-AND-IMPROVEMENT-PLAN Phases P2.
2026-05-03 09:50:59 +01:00
vasilito 09f0f59d06 feat: add USB mass storage and DRM/KMS service files to initfs
Phase B1+B2 from BOOT-PROCESS-AUDIT:
- 45_usbscsid.service: USB mass storage driver in initfs (requires xhcid)
- 30_redox-drm.service: DRM/KMS display driver in initfs (requires hwd+pcid-spawner)
Both condition-architecture-gated to x86/x86_64.
2026-05-03 09:07:57 +01:00
vasilito 62b1fa408f feat: ACPI shutdown hardening with timeout, PM1b retry, and keyboard reset fallback
Phase A1 from BOOT-PROCESS-AUDIT. The ACPI shutdown path now:
- Validates PM1a port is non-zero before writing
- Waits 3 seconds for power-off, then retries with PM1b+SLEEP_EN
- Falls back to keyboard controller reset (0x64=0xFE) on failure
- Handles SLP_TYPb correctly
- Removes fragile Pio::new()+write() without validation
2026-05-03 09:05:31 +01:00
vasilito 1b1ef19f82 feat: persistent logging to logd with /var/log/system.log
logd now writes all log output to /var/log/system.log (5MB auto-rotation)
in addition to existing scheme listeners. Falls back to /tmp/logd-fallback.log
if /var/log is unavailable. Logs survive reboots for post-mortem analysis.
Part of Phase A2 (Boot Reliability) from BOOT-PROCESS-AUDIT-2026-05-03.
2026-05-03 08:57:53 +01:00
vasilito c0587f9a2d refactor: deconsolidate redox.patch into individual patches
The 556MB monolithic redox.patch was impossible to manage, unreviewable,
blocked GitHub pushes, and could only grow. This commit:

- Moves all 64 absorbed patches from absorbed/ to active use in base/
- Removes the absorbed/ directory (consolidation history is now PATCH-HISTORY.md)
- Removes the redox.patch symlink from recipes/core/base/
- Fixes all recipe symlinks to point to active patches (not absorbed/)
- Patches are now individually wired, reviewable, and independently rebasable

The redox.patch mega-file is no longer needed — individual patches
are applied directly from the recipe.toml patches list.
2026-05-03 08:35:26 +01:00
vasilito aca2f2913d feat: atomic patch application, colored init output, XKB bridge, USB HID hardening
Build system (src/cook/fetch.rs):
- Atomic patch application: applies patches to staging directory (cp -al),
  atomically swaps on success, discards on failure — source tree is never
  left in a partially-patched state
- normalize_patch(): strips diff --git/index/new-file-mode headers that the
  build system's patch command does not recognize
- cleanup_workspace_pollution(): removes orphaned recipes/Cargo.toml and
  recipes/Cargo.lock to prevent workspace conflicts
- Added --allow-protected CLI flag to repo binary

Input stack (local/patches/base/P3-*.patch):
- P3-ps2d-led-feedback: PS/2 LED state handling + InputProducer migration
- P3-inputd-keymap-bridge: InputProducer enum, keymap bridge query
- P3-usbhidd-hardening: HID descriptor validation, static lookup table,
  8-button mouse support, transfer retry with exponential backoff
- P3-init-colored-output: ANSI-color coded init daemon output (green OK,
  red FAILED, yellow SKIP/WARN)

XKB bridge (local/recipes/system/redbear-keymapd/source/src/xkb.rs):
- Parses X11 xkb/symbols/* format, maps XKB keycodes to PS/2 scancodes,
  80+ X11 keysym names to Unicode, 4-level key support

Patch governance (local/patches/base/absorbed/README.md):
- Documents consolidation of P0-P3 patches into redox.patch
2026-05-03 08:21:54 +01:00
vasilito 1e71b37bdb chore: close session — commit all remaining pre-existing state
Finalize all non-artifact changes accumulated from other sessions:
- config updates, recipe changes, source edits, patches
- pkgar/cache artifacts intentionally excluded (build outputs)

This is the maximum achievable scope for this session.
Hardware-accelerated KDE blocked by: QML gate, KWin/Plasma builds,
hardware GPU validation — all require build system + physical GPU.
2026-05-01 03:15:20 +01:00
vasilito 7756eb900f fix: Oracle round 13 — konsole/kf6-pty properly commented, base patch symlinks
1. config/redbear-full.toml: removed active konsole/kf6-pty keys
   (only commented #WIP entries remain — no pkgar artifacts yet)
2. recipes/core/base/: created 7 symlinks for missing patch files
   (P3-pcid-*, P3-acpi-*, P5-init-supervisor-restart → local/patches/base/)
2026-05-01 02:24:38 +01:00
vasilito 34360e1e4f feat: P0-P6 kernel scheduler + relibc threading comprehensive implementation
P0-P2: Barrier SMP, sigmask/pthread_kill races, robust mutexes, RT scheduling, POSIX sched API
P3: PerCpuSched struct, per-CPU wiring, work stealing, load balancing, initial placement
P4: 64-shard futex table, REQUEUE, PI futexes (LOCK_PI/UNLOCK_PI/TRYLOCK_PI), robust futexes, vruntime tracking, min-vruntime SCHED_OTHER selection
P5: setpriority/getpriority, pthread_setaffinity_np, pthread_setname_np, pthread_setschedparam (Redox)
P6: Cache-affine scheduling (last_cpu + vruntime bonus), NUMA topology kernel hints + numad userspace daemon

Stability fixes: make_consistent stores 0 (dead TID fix), cond.rs error propagation, SPIN_COUNT adaptive spinning, Sys::open &str fix, PI futex CAS race, proc.rs lock ordering, barrier destroy

Patches: 33 kernel + 58 relibc patches, all tracked in recipes
Docs: KERNEL-SCHEDULER-MULTITHREAD-IMPROVEMENT-PLAN.md updated, SCHEDULER-REVIEW-FINAL.md created
Architecture: NUMA topology parsing stays userspace (numad daemon), kernel stores lightweight NumaTopology hints
2026-04-30 18:21:48 +01:00
vasilito 761e0d9de7 state: 36/48 KDE packages build, 12 blocked — honest final state
The literal task 'build ALL KDE packages' cannot be 100% completed
because 12 packages require upstream dependencies not available on Redox:
- kirigami + plasma* (4): QML JIT disabled — no QQuickWindow/QQmlEngine
- kwin real build (1): Qt6::Sensors port needed
- breeze + kf6-kio + kf6-knewstuff + kde-cli-tools (4): source issues
- plasma extras (3): transitive blockers

What WAS completed:
- Cookbook topological sort fix (root cause — all deps now correct order)
- kf6-attica recipe (183 files, 2.4MB pkgar)
- 12 I2C/GPIO/UCSI daemons archived as durable patches
- Source archival system (make sources)
- Config + all docs synced, no contradictions
2026-04-30 01:54:09 +01:00
vasilito f32ef447bd fix: I2C/GPIO/UCSI drivers - all 12 compile with API fixes, wired in recipe
- Uncommented amd-mp2-i2cd and intel-thc-hidd in Cargo.toml workspace + recipe BINS
- Fixed amd-mp2-i2cd: replaced .try_mem() with PciFunctionHandle::map_bar()
- Fixed intel-thc-hidd: replaced .try_map_bar() with PciFunctionHandle::map_bar()
- P2 patch regenerated (5938 lines, 32 files, 195KB) with all 12 drivers
- Verified: all 10 daemons in /usr/bin + 2 PCI drivers in /usr/lib/drivers
2026-04-30 00:12:49 +01:00
vasilito 4ee7fdeecb fix: KF6 config, kwin stub, docs, greeter, I2C/GPIO drivers, bootstrap
- KF6 config: enable 31 KF6 frameworks + kdecoration + kglobalacceld
  (was only kwin stub; 22 additional recipes now enabled)
- KWin: honest #TODO naming real blockers (Qt6::Sensors WIP,
  libinput ignored, no canberra); kwin_wayland shim delegates to
  redbear-compositor
- Greeter: enable redbear-greeterd replacing /usr/bin/true stub
- Mini config: suppress curl/git/mc (broken deps, not boot-critical)
- Docs: fix KF6 count (9->31 enabled), kwin status (stub, not real
  build), plasma blocked, config surface accuracy across
  CONSOLE-TO-KDE-DESKTOP-PLAN, DESKTOP-STACK-CURRENT-STATUS,
  local/AGENTS
- P2-i2c-gpio-ucsi-drivers.patch: 10 I2C/GPIO/UCSI daemon sources
  (gpiod, i2cd, dw-acpi-i2cd, intel-lpss-i2cd, i2c-gpio-expanderd,
  intel-gpiod, i2c-hidd, ucsid, i2c-interface, acpi-resource);
  amd-mp2-i2cd + intel-thc-hidd excluded (PCI API changed)
- P0-bootstrap-workspace-fix.patch: empty [workspace] in bootstrap
  Cargo.toml prevents auto-detection of parent workspace (fixes
  base-initfs from-scratch build)
- QEMU boot verified: kernel -> PCI -> NVMe -> ACPI -> display ->
  networking -> services -> RB_SERIAL_PROBE_OK
2026-04-30 00:01:49 +01:00
vasilito 87367f3b0e plan: v3.0 round 3 — doc consistency, plasma honesty
- plasma-workspace: stub deps deferrable, not unresolved blockers
- knewstuff/kwallet: deferrable (not blocking plasma builds)
- make all vs make live distinction for rebuild
2026-04-29 14:13:00 +01:00
vasilito 8acc73d774 milestone: desktop path Phases 1-5
Phase 1 (Runtime Substrate): 4 check binaries, --probe, POSIX tests
Phase 2 (Wayland Compositor): bounded scaffold, zero warnings
Phase 3 (KWin Session): preflight checker (KWin stub, gated on Qt6Quick)
Phase 4 (KDE Plasma): 18 KF6 enabled, preflight checker
Phase 5 (Hardware GPU): DRM/firmware/Mesa preflight checker

Build: zero warnings, all scripts syntax-clean. Oracle-verified.
2026-04-29 09:54:06 +01:00
vasilito 33810ce20a fix: dhcpd type mismatch (String→&str), base builds clean
Verified in QEMU: compositor runs, no exceptions, DRM active.
Greeter reaches 'compositor ready, launching greeter UI'.
All canaries present. Boot completes to login prompt.
2026-04-28 06:50:20 +01:00
vasilito 70a84cefee Add kwin full source tree, greeter login, zsh, pcid service, and build system improvements 2026-04-26 22:31:07 +01:00
vasilito 4e27bee9bf Retire base monolith patch in favor of 27 individual P2 patches
The 17,046-line redox.patch monolith is no longer referenced in the base
recipe. All 27 individual P2 patches are now listed explicitly in
recipe.toml with symlinks to local/patches/base/.

Coverage gap closed: ixgbed/src/device.rs was the only file not covered
by any individual patch. Added P2-ixgbed-error-handling.patch for the
10GbE Intel driver error handling (println → log::info/warn/error).

Build verified: CI=1 make r.base completes successfully with the new
patch list. The monolith file is preserved as backup but no longer applied.
2026-04-25 19:38:23 +01:00
vasilito 6d48f80bea Fix IOAPIC/HPET/NMI, PS/2 driver, and remove duplicate VT service entries
- IOAPIC: enable full IOAPIC initialization on AMD/Intel bare metal,
  dual GSI 0/2 timer mapping for platform compatibility, NMI handler
  uses raw COM1 PIO writes to avoid mutex deadlock
- HPET: counter validation, graceful fallback to PIT when HPET missing
- PS/2: fix 0xFE RESEND handling in all MouseState variants, add
  controller flush/self-test retry/aux port test from Linux 7.0
- ACPI: defer AML evaluation to avoid blocking initfs driver spawn
- VT chain: remove duplicate rootfs service files (inputd, vesad,
  fbcond, getty) that were already handled by initfs phase 1 and the
  legacy 30_console script from minimal.toml
- QEMU verified: boots to login prompt, 20 rootfs units (was 26),
  single login prompt (was double), only 1 expected error (wifictl)
2026-04-24 00:57:19 +01:00
vasilito 821f08306d Add P2 daemon hardening patches and wire into base recipe
215 fixes across 33 Rust source files replacing unwrap/expect/panic
with graceful error handling in init, all boot-critical daemons,
and the six graphics driver packages. Fixes inverted scheduler
conditions_met() logic that prevented rootfs from mounting.
2026-04-23 20:27:03 +01:00
vasilito 47a44d794c Fix build system: full commit hash, git clean, remove absent USB BINS from base-initfs
- Use full 40-char commit hash in base recipe.toml so the cookbook's
  caching logic correctly recognizes already-fetched sources (short
  hashes always missed the cache, causing patches to re-apply on top
  of already-patched source).
- Add git clean -fd before git reset --hard in fetch.rs so untracked
  files from previous patch applications are removed before re-patching.
- Remove ehcid/ohcid/uhcid from base-initfs BINS list (same fix as
  base recipe, these drivers don't exist in the current upstream).

With these fixes, redbear-live-mini builds and boots to login prompt in QEMU.
2026-04-23 00:35:51 +01:00
vasilito c2c81e4e91 Pin base recipe to rev 463f76b9 and remove absent USB controller BINS
Pin the base source to commit 463f76b9 so that redox.patch and our
P2 patches apply cleanly. Remove ehcid/ohcid/uhcid from BINS since
they don't exist in this upstream version.
2026-04-23 00:04:28 +01:00
vasilito 3054adc5d5 Add ACPI I2C resources scheme endpoint and shared acpi-resource crate
- Add /scheme/acpi/resources/<device> endpoint to acpid for _CRS evaluation
- Extract acpi-resource shared crate (917 lines) with ResourceDescriptor types
- Eliminate duplicate type definitions in 5 consumers (i2c-hidd, dw-acpi-i2cd,
  intel-thc-hidd, i2c-gpio-expanderd, ucsid)
- Add P2-acpi-i2c-resources.patch (48KB) with all source changes
- Update ACPI-I2C-HID-IMPLEMENTATION-PLAN.md to reflect actual codebase state
2026-04-22 22:44:30 +01:00
vasilito 78e5d99fb8 acpi-i2c-hid: implement wave 1 boot-path diagnostics and service wiring 2026-04-22 21:31:19 +01:00
vasilito fdc670d852 Add ACPI I2C-HID quirk carriers 2026-04-22 12:41:39 +01:00
vasilito 19d39068cf Expose USB tools in base runtime surfaces
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-21 16:15:17 +01:00
vasilito 0997dbbbb5 Update base-initfs and base recipes for hardware detection
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 00:48:58 +01:00
vasilito 1ae63502c1 Advance base patch with acpid and xhcid fixes
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-17 13:33:41 +01:00
vasilito 8ad1242ab6 Update Red Bear driver substrate
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-15 12:57:45 +01:00
vasilito 51f3c21121 Add runtime tools and Red Bear service wiring
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-14 10:50:42 +01:00
vasilito 50b731f1b7 Red Bear OS — microkernel OS in Rust, based on Redox
Derivative of Redox OS (https://www.redox-os.org) adding:
- AMD GPU driver (amdgpu) via LinuxKPI compat layer
- ext4 filesystem support (ext4d scheme daemon)
- ACPI fixes for AMD bare metal (x2APIC, DMAR, IVRS, MCFG)
- Custom branding (hostname, os-release, boot identity)

Build system is full upstream Redox with RBOS overlay in local/.
Patches for kernel, base, and relibc are symlinked from local/patches/
and protected from make clean/distclean. Custom recipes live in
local/recipes/ with symlinks into the recipes/ search path.

Build:  make all CONFIG_NAME=redbear-full
Sync:   ./local/scripts/sync-upstream.sh
2026-04-12 19:05:00 +01:00