Commit Graph

64 Commits

Author SHA1 Message Date
Red Bear OS 0c11c2b515 retire pcid-spawner: remove crate, service files, and build wiring
Operator-ratified full retirement — driver-manager superseded
pcid-spawner in every role (boot-time PCI match/claim/spawn, initfs
storage path, hotplug). Removes:
- drivers/pcid-spawner/ crate (source preserved in git history)
- init.d/00_pcid-spawner.service and
  init.initfs.d/40_pcid-spawner-initfs.service
- Cargo workspace member + Makefile bin entries
- 40_drivers.target reference to pcid-spawner-initfs
- the /etc/driver-manager.d/disabled fallback gates on driver-manager
  services (no fallback exists anymore; driver-manager runs
  unconditionally)
2026-07-24 08:47:02 +09:00
Red Bear OS f315a9be3b acpid + i2c-hidd: Phase 5 (GPE/EC/lid/buttons/fan) + Phase 4.4 (HID descriptor parser)
Phase 5 — Laptop ACPI events (LG Gram 16Z90TP compatibility plan):
- Vendor acpi-rs crate (rev 90cbe88) into base fork with a real
  Opcode::Notify executor; upstream panicked on every Notify opcode,
  which is the backbone of ACPI event flow on real laptop firmware.
  Handler::handle_notify hook added; acpid + amlserde pointed at the
  path dep so every consumer sees the same fork.
- gpe.rs: FADT-driven GPE block register map (status half + enable
  half), write-1-to-clear status bits, read-modify-write enable
  preserving every other GPE's firmware state. PM1 fixed-event bits
  (PWRBTN/SLPBTN/RTC) per ACPI 6.4 §4.8.3.1.
- power_events.rs: init builds the GPE map, discovers the EC via ECDT
  (ACPI 6.4 §5.2.16) with a _HID=PNP0C09 probe fallback over conven-
  tional paths, enables the EC GPE + PM1 fixed events, discovers lid
  and ACPI 4.0 fan devices. handle_sci dispatches PM1 → EC query loop
  (bounded at 32) → AML notification drain, following Linux 7.1
  evgpe.c / ec.c / button.c.
- notifications.rs: shared AmlNotifications queue (parking_lot::Mutex)
  populated by the vendored acpi-rs handle_notify hook, drained by the
  SCI handler and redbear-upower.
- ec.rs: sci_evt_set() and query() exposed on Ec for the SCI handler.
- scheme.rs: new handle kinds Lid, LidState, ButtonDir, Button,
  Notifications, Fan, FanState, FanSpeed with proper dir/file
  separation. Fan _FST on read, _FSL on write (percent clamped 0-100).
- main.rs: subscribes /scheme/irq/{sci_irq} (default 9) on the event
  queue, dispatches SCI events through handle_sci. PowerButton incre-
  ments edge counter and triggers the shutdown path; SleepButton incre-
  ments counter and calls enter_s2idle.
- acpi.rs: AcpiContext gained gpe, ec_device, lid_device, lid_state,
  power_button_events, sleep_button_events, fan_devices fields (all
  RwLock-guarded). evaluate_acpi_method and enter_s2idle changed from
  &mut self to &self (AML mutation goes through RwLock inner state).
- aml_physmem.rs: handle_notify impl pushes onto the shared queue.

Phase 4.4 — HID report descriptor parser (i2c-hidd):
- report_desc.rs: HID 1.11 §6.2.2 descriptor parser + decoder. Global-
  state stack (Push/Pop), usage-min/max expansion, sign-extended
  fields, contact reconstruction (id, tip, x, y). 3 unit tests.
- input.rs: forward_layout_report dispatches descriptor-driven reports
  through forward_decoded: first touching contact → absolute
  MouseEvent; two simultaneous contacts → vertical ScrollEvent (two-
  finger scroll); buttons → ButtonEvent; keyboard-page reports fall
  back to the existing boot-protocol path.
- hid.rs: stream_input_reports parses the descriptor once and uses
  forward_layout_report when layouts are non-empty, otherwise keeps the
  boot-protocol summary path.

Reference: Linux 7.1 drivers/acpi/{evgpeblk.c,evgpe.c,ec.c,button.c}
and drivers/hid/hid-core.c.

All affected crates compile for x86_64-unknown-redox; i2c-hidd 3/3
unit tests pass on host; acpid host-side tests still can't link
(pre-existing libredox limitation — must run via redoxer).
2026-07-21 21:36:07 +09:00
Red Bear OS 452452e453 i2c: real DesignWare transfer chain — engine, PCI discovery, provider routing
The I2C transfer chain was stubbed end-to-end:

- i2cd's transfer path returned 'not implemented yet' for every
  transfer, and its wire format didn't match the only in-tree consumer
  (i2c-hidd sends a bare I2cTransferRequest, i2cd expected
  I2cControlRequest::Transfer).
- intel-lpss-i2cd / dw-acpi-i2cd / amd-mp2-i2cd registered an adapter
  name and parked forever without initializing the controller or
  executing a transfer.
- intel-lpss-i2cd matched only legacy ACPI HIDs, which do not exist on
  Meteor Lake / Arrow Lake platforms (LPSS I2C binds by PCI ID there,
  per Linux drivers/mfd/intel-lpss-pci.c).

Replace with real implementations:

- New shared crate drivers/i2c/designware (dw-i2c): DesignWare I2C
  master engine ported from Linux 7.1 i2c-designware-master.c and
  i2c-designware-common.c — IC_CON + SCL timing computed from ic_clk
  with Linux's exact hcnt/lcnt formulas (bxt_i2c_info 133 MHz for
  LPSS, 100 MHz for ACPI-designated blocks), SDA hold with RX-hold
  workaround, polling transfer engine with RESTART/STOP sequencing,
  TX_ABRT decode (Nack/arbitration-lost/abort/timeout), 7/10-bit
  addressing, bounded timeouts. Also provides the shared
  /scheme/<name> transfer endpoint with register-then-ready ordering.
- intel-lpss-i2cd: PCI discovery for ARL-H (0x7750/0x7751,
  0x7778-0x777b) and MTL-P (0x7e50/0x7e51, 0x7e78-0x7e7b) with 32/64-bit
  BAR0 decode, ACPI alias resolution via FixedMemory32 == BAR0 across
  /scheme/acpi/resources, legacy ACPI-HID path kept, i2cd registration
  with bounded retry, serves /scheme/i2c-lpss.
- dw-acpi-i2cd: converted from register-and-park to the shared engine,
  serves /scheme/dw-acpi-i2c.
- i2cd: real transfer routing — adapter resolution by name/alias
  (exact, normalized, last-component) and forwarding to the provider
  daemon's /scheme/<provider>/transfer endpoint.
- i2c-interface: I2cAdapterInfo gains provider_scheme + aliases
  (serde-default, wire-compatible).

Tests: dw-i2c 3, intel-lpss-i2cd 3; full workspace cargo check clean;
base cooks for x86_64-unknown-redox.

Refs: local/docs/LG-GRAM-16Z90TP-COMPATIBILITY-PLAN.md Phase 4
2026-07-21 06:02:31 +09:00
Red Bear OS f2092fa973 fix: correct redox-ioctl patch path in Cargo.toml
The [patch] section pointed to ../../relibc/source/redox-ioctl which
doesn't exist. Fixed to ../relibc/redox-ioctl matching the main
dependency path at line 114.
2026-07-12 02:23:20 +03:00
Red Bear OS 00b799d512 absorb: 41 orphaned base patches re-applied (Phase 1.0A)
Per local/docs/PATCH-PRESERVATION-AUDIT-2026-07-12.md the base
fork was carrying only 38 of 100 patches in local/patches/base/.
The other 62 patches' content was silently missing from the fork
working tree, even though their .patch files were preserved.

This commit re-applies 41 patches that genuinely still apply
cleanly + 17 hunks that partially applied. Recovery covers:

- D-Bus initfs service wiring (P4-initfs-dbus-services)
- USB service wiring (P4-initfs-usb-drm-services)
- netcfg/dhcp/dhcpv6 driver fixes
- acpid shutdown/PM/quirk fixes
- inputd/ps2d hard-fail logging
- pcid driver interface refinements (server cmd channel)
- virtio-core for VirtualBox support
- ixgbed/rtl8139/rtl8168 net drivers
- ahcid NCQ + per-function interrupt coalescing
- logd persistent logging
- bootstrap procmgr race-condition fixes
- cargo version pin to +rb0.3.0 (synchronized release branch)

58 files changed, +1444/-318 lines.

Untracked mnt/ tree and *.orig / *.rej files cleaned up after
patch application (leftover from absolute-path patch headers).
2026-07-12 01:29:08 +03:00
Red Bear OS bd595851e2 base: apply Red Bear patches on latest upstream/main
251 files: init, acpid, ipcd, netcfg, ihdgd, virtio-gpud, scheme-utils,
inputd, block driver, ptyd, ramfs, randd, initfs bootstrap, path deps,
version +rb0.3.1, author attribution
2026-07-11 11:39:24 +03:00
Jeremy Soller 9e12870329 Remove unused redox-rt from Cargo.toml, it is defined in bootstrap/Cargo.toml 2026-07-09 13:09:02 -06:00
Ibuki Omatsu 372b200f26 refactor: Adapt to userspace fd allocation 2026-07-01 08:20:05 -06:00
Jeremy Soller e56911dd95 Merge branch 'writeall-instead-of-write' into 'main'
add and apply unused_io_amount clippy lint

See merge request redox-os/base!282
2026-06-25 06:42:23 -06:00
Jeremy Soller 4fc813f3ef Send controller events from usbhidd 2026-06-23 20:21:40 -06:00
auronandace 05a8954e0a add and apply unused_io_amount clippy lint 2026-06-17 13:40:16 +01:00
Wildan M bd752fb95f Update orbclient 2026-06-12 20:27:17 +07:00
4lDO2 4a34c3251e Use simplified kernel ACPI interface. 2026-06-02 15:40:28 +02:00
Ibuki Omatsu 52b1d04e12 feat: Implement realpathat for ramfs 2026-05-29 13:13:35 +02:00
Migue Magic ae77a4f0ad Implement font support 2026-05-15 17:21:18 -06:00
bjorn3 5f4e5016a8 drivers/graphics/driver-graphics: Implement MODE_ADD_FB2 2026-05-14 14:56:33 +02:00
Jeremy Soller c75e5a3c67 Update dependencies 2026-05-04 12:31:48 -06:00
Wildan M f2f834d412 Update ACPI crate 2026-04-27 15:57:46 +07:00
aarch 8522ed4eec Update yanked drm version 2026-04-21 19:33:35 +00:00
bjorn3 a5018ca37e scheme-utils: Merge read_requests and process_requests
And simplify some matches on the resulting method.
2026-04-18 16:49:21 +02:00
Akshit Gaur 11feb08036 Remove local stuff 2026-04-17 17:30:25 +05:30
Akshit Gaur 854ab48c85 Use local syscall and libredox 2026-04-17 15:22:29 +05:30
bjorn3 6311833765 drivers/graphics/bgad: Remove bgad
The only thing it does it changing the size of the region that the
graphics adapter sees as framebuffer. It doesn't actually tell vesad to
resize the framebuffer nor does it implement an actual full graphics
driver. For basic usage the bootloader setup framebuffer is sufficient
and for anything more advanced, virtio-gpu is a much better option that
we already have a full graphics driver for.
2026-04-14 21:18:43 +02:00
bjorn3 317a0178b6 Introduce scheme-utils crate and HandleMap type
HandleMap deduplicates the id assignment for handles and unlike most
existing implementations handles overflow just fine.
2026-04-13 22:19:07 +02:00
bjorn3 ff4aea2cae dhcpd: Move from the netutils repo to the base repo
This way all components necessary to get a working network connection
are in the base repo. In the future this might help with mounting a
network disk from the initfs. The netutils recipe doesn't get included
in the initfs.
2026-04-11 20:57:42 +02:00
auronandace 59c1f52a8b set missing docs lint to allow for now 2026-03-28 15:24:45 +00:00
Benton60 259f78ae7c bump the libredox version 2026-03-24 17:26:09 -04:00
auronandace a65d6c411c add documentation to public functions in common 2026-03-24 10:30:45 +00:00
auronandace 29b4782015 update thiserror and add to workspace 2026-03-23 07:58:57 +00:00
auronandace e3c6ca1573 upgrade to latest spin crate and add to workspace 2026-03-22 15:43:32 +00:00
auronandace 557a3d1954 consolidate several dependencies into the workspace 2026-03-22 15:11:33 +00:00
auronandace 2f0f5160bb update clap for usbctl 2026-03-22 09:45:09 +00:00
auronandace 7be03d1815 add bitflags to the workspace Cargo.toml 2026-03-20 08:46:28 +00:00
bjorn3 2c69d5f45f Use orbclient from crates.io 2026-03-12 19:22:09 +01:00
bjorn3 d70d648ceb Remove no longer necessary patches
New versions of drm and drm-sys have been released with Redox OS support.
2026-03-06 22:40:12 +01:00
Ibuki Omatsu 2738f69224 feat: Implement std_fs_call handling to initfs, ramfs, acpi and xhci 2026-02-28 08:15:16 -07:00
auronandace 7849aa23b3 make serde and toml workspace dependencies 2026-02-27 08:39:29 +00:00
Jeremy Soller a7cb911864 Update libc, patch rustix, and cargo update 2026-02-20 14:04:49 -07:00
auronandace 5ffce47607 add clippy precedence lint 2026-02-20 13:43:48 +00:00
Jeremy Soller a137054378 Merge branch 'shared_config_locator' into 'main'
Introduce a shared config locator

See merge request redox-os/base!127
2026-02-17 15:20:47 -07:00
bjorn3 0a17fef534 Introduce a shared config locator
And use it for init and pcid-spawner
2026-02-17 22:26:04 +01:00
bjorn3 c611054bbd initfs: Move archive-common package into initfs-tools 2026-02-17 20:54:10 +01:00
Jeremy Soller 4788db00de Update redox-syscall and redox-scheme for stdfscall 2026-02-11 12:21:35 -07:00
bjorn3 c6f564e651 Use upstream rustix
Rustix 1.1.3 supports ioctls on Redox OS.
2026-02-07 13:18:48 +01:00
Jeremy Soller 2d672b7cd9 Add anyhow to workspace 2026-01-29 10:47:45 -07:00
bjorn3 ea96a9a697 Remove alxd
It hasn't been in a functional state for years.
2026-01-25 20:56:11 +01:00
Ibuki Omatsu 334928f151 feat: Introduce userspace namespace manager and adapt all schemes. 2026-01-20 20:56:58 -07:00
Jeremy Soller f740b61774 Use workspace dependencies for many common crates 2026-01-20 10:12:08 -07:00
Wildan M 3d04f523b4 inputd: Implement keymap 2026-01-14 11:35:48 +07:00
Jeremy Soller c772ba8924 ihdgd driver 2025-12-18 10:48:05 -07:00