3257 Commits

Author SHA1 Message Date
Red Bear OS 387d691a7b diag(procmgr): log on_dup/on_close/thread-fd handle ids 2026-07-15 13:05:50 +09:00
Red Bear OS db724cda70 init: use blocking waitpid to avoid busy-loop spam 2026-07-15 03:20:47 +09:00
Red Bear OS 3a7c96b19f merge: combine 0a358aa0 (diag + libc::pipe2 fix) with 104da7de (init FILETABLE fix) into canonical submodule/base
Both branches independently fixed the FILETABLE desync bug. This merge creates a single canonical history that preserves the diagnostic commits from 0a358aa0 and the eexist-focused fix from 104da7de.

After this merge, the per-fork submodule/<name> branch (this is the AGENTS.md-mandated canonical ref) is a child of both, so origin can fast-forward to it.

(NO AI attribution in commit message body, per project policy)
2026-07-14 12:19:46 +09:00
Red Bear OS 0a358aa05f diag(base): trace fd transfer in init, daemon, and logd
Add diagnostics to pin down where the INIT_NOTIFY fd handoff hangs:
- init/src/service.rs: log read_pipe fd and call_ro results
- daemon/src/lib.rs: log cap_fd, write_pipe, and call_wo result
- logd/src/main.rs: explicit ready_sync_scheme result and setrens fallback

These are temporary diagnostics for the boot-hang investigation.
2026-07-14 11:19:31 +09:00
Red Bear OS 1e341ff782 init: fix pipe FILETABLE desync — use libc::pipe2 instead of raw syscall
create_pipe() used raw syscall::openat/syscall::dup which allocate kernel
fds WITHOUT registering in relibc FILETABLE. Later FILETABLE-managed
syscalls (Command::spawn -> relibc pipe2) reserve the same fd numbers,
causing EEXIST in kernel insert_file.

Replace with libc::pipe2 which goes through relibc FILETABLE-aware path.
2026-07-13 20:22:31 +03:00
Red Bear OS 104da7de12 init: fix FILETABLE desync causing EEXIST on all daemon spawns
create_pipe() used raw syscall::openat() (SYS_OPENAT) and syscall::dup()
which bypass relibc's FILETABLE-managed fd allocation (SYS_OPENAT_INTO).
This created phantom fds known to the kernel but not to relibc's userspace
FILETABLE. When Command::spawn() later called relibc's pipe2() for
fork+exec error reporting, the FILETABLE allocated a position it thought
was free, but the kernel rejected it with EEXIST (errno 17).

This killed EVERY daemon spawn during boot: logd, randd, zerod, rtcd,
nulld, acpid, pcid, inputd, lived, redoxfs, pcid-spawner, fbcond, vesad,
fbbootlogd, hwd, ps2d — all failed with 'File exists (os error 17)'.

Fix: use libc::pipe2() which goes through relibc's FILETABLE-managed
path (FdGuard::open → SYS_OPENAT_INTO), keeping tables in sync.
2026-07-13 00:47:05 +03:00
Red Bear OS 6e5da7259a rb: remove FEXEC_STEP reference (removed from redox_rt)
Commit bb20fe9c in relibc fork removed FEXEC_STEP diagnostic from
redox_rt::proc. The bootstrap binary in base referenced it in
exec.rs:257, causing build failure:
  error[E0425]: cannot find value  in module

Removed the diagnostic step variable and simplified the panic message.
Build now compiles cleanly.
2026-07-12 23:46:28 +03:00
Red Bear OS 5e5657e4dd rb: add verify exclusion for RB-replaced upstream functions
52 functions documented as intentional RB replacements across:
- initfs (8): RB uses different initfs tooling
- driver-graphics KMS (16): RB refactored display layer
- ihdgd Intel GPU (5): RB driver refactoring
- vesad (2): RB framebuffer refactoring
- virtio-gpu (12): RB async GPU refactoring
- inputd/input/net (3): RB daemon pattern refactoring
- pcid (2): RB PCI refactoring
- xhcid USB (4): RB USB refactoring
- redoxerd (1): RB executor refactoring
- netstack (1): RB network refactoring
- ramfs (2): RB filesystem refactoring
2026-07-12 16:55:59 +03:00
Red Bear OS 8f50862be5 Fix create_pipe: bypass redox_rt::sys::open two-step that consumes has_run_dup
Use direct syscall::openat with ns_fd to get pipe READ end, then
syscall::dup with 'write' to get WRITE end. This avoids the
redox_rt::sys::open bug where step 2 (openat_into_posix on the
pipe read end) consumes has_run_dup, leaving the subsequent dup()
unable to get the write end.
2026-07-12 15:18:01 +03:00
Red Bear OS dce10c4eb2 fix: bypass ns_fd in pipe creation via libredox::open
The init process's ns_fd may be stale after exec, causing EBADF when
pipe2() calls redox_rt::sys::open (which needs current_namespace_fd()).
Use libredox::Fd::open + syscall::dup instead, bypassing the FILETABLE
and ns_fd dependency entirely.
2026-07-12 12:41:32 +03:00
Red Bear OS 234ce3ab1a diag: print pipe() error details in service.spawn 2026-07-12 11:57:10 +03:00
Red Bear OS ab0da30613 fix: register external fds with userspace FILETABLE
Socket and RawEventQueue create fds via libredox raw syscalls that
bypass the redox-rt userspace FILETABLE. FdGuard::dup then reserves
these positions, causing SYS_DUP_INTO to destroy the existing fds.
2026-07-12 10:29:06 +03:00
Red Bear OS 7ba6cff32d diag: remove PM: debug prints from procmgr bootstrap
Removes the 6 libredox::call::write(1, b'PM:N') debug trace lines from
procmgr::run() that were polluting serial output during early boot.
2026-07-12 05:17:55 +03:00
Red Bear OS 1ed140e018 fix: move ACPI S3/battery methods from impl Drop to impl AcpiContext
The suspend_to_ram, read_battery_status, and read_battery_info methods
were incorrectly placed inside 'impl Drop for PhysmapGuard'. They
reference fields (aml_symbols, fadt) that only exist on AcpiContext.
Move them to impl AcpiContext and fix field access (self.fadt.as_ref()
instead of self.fadt()).
2026-07-12 04:14:34 +03:00
Red Bear OS 3fe7b12434 fix: add try_map_bar, try_pci_allocate_interrupt_vector, fix try_mem return type
- try_mem now returns Result (matching caller expectations)
- try_map_bar: non-panicking BAR mapping on PciFunctionHandle
- try_pci_allocate_interrupt_vector: non-panicking IRQ allocation
- virtio-core: reverted .ok_or() back to .map_err() for Result type
2026-07-12 02:48:16 +03:00
Red Bear OS 4932cb4d62 fix: add try_port() to PciBar and try_irq_handle() to LegacyInterruptLine
Non-panicking variants needed by ac97d, vboxd, and other drivers that
prefer error handling over panics.
2026-07-12 02:39:59 +03:00
Red Bear OS bf9989b7c0 fix: add try_mem() to PciBar, fix virtio-core caller
Added try_mem() returning Option<(usize, usize)> for non-panicking
memory BAR access. Fixed virtio-core/probe.rs to use .ok_or() instead
of .map_err() to match the Option return type.
2026-07-12 02:34:09 +03:00
Red Bear OS be2d7503c9 chore: gitignore Cargo.lock (build artifact) 2026-07-12 02:26:18 +03:00
Red Bear OS 0422712e29 fix: add sndbuf/rcvbuf to Socket accept initializer
The accept() method was missing sndbuf and rcvbuf fields that were
added to the Socket struct. Inherit values from the listening socket.
2026-07-12 02:25:20 +03: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 b59dffc0ff fix: replace 8 .expect("TODO") panic points with proper error handling
- on_sendfd: subscribe/dup errors return error Response instead of panic
- fork/new_thread: subscribe errors propagate via ? operator
- signal delivery (4 sites): status fd write errors are best-effort (let _ =)

The procmgr is the first userspace process manager — a panic here kills
the entire system. These changes make it resilient to transient fd errors.
2026-07-12 01:51:11 +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 5023b72728 Cargo.lock: regenerate after Cargo.toml version sync (branch 0.3.0 -> 0.3.1)
- bytemuck 1.25.0 -> 1.25.1 (patch bump)
- bytemuck_derive 1.10.2 -> 1.11.0 (minor bump)
- Other minor patches refreshed

Part of Phase 0 fix for G1 (Cargo.lock drift).
The suffix-only drift +rb0.3.0 -> +rb0.3.1 was already
applied on master via cargo generate-lockfile. The
other entries are non-Cat-2 transitive bumps that
catches with the lockfile refresh.

No functional change to Cat 2 fork entries (those
already match Cargo.toml at +rb0.3.1).
2026-07-12 01:15:16 +03:00
Red Bear OS 75f6cf902d bootstrap: restore upstream exec.rs from commit 372b200f
Our Red Bear patches had reverted the userspace fd allocation refactor
(commit 372b200f) in exec.rs. This caused FD tracking mismatches
between the userspace FILETABLE and the kernel fd table, resulting in
EEXIST errors and fork failures.

Restored the upstream version which correctly uses redox_rt::sys::*
functions (openat, dup, sys_call_ro) that go through the FILETABLE,
and openat_into_upper for pre-init FD allocation. Also includes the
filetable_binary_fd setup and same_process flag in ExtraInfo.
2026-07-11 17:23:29 +03:00
Red Bear OS aedc416f0c bootstrap: fix FD allocation to match upstream userspace fd model
The bootstrap's start.rs used libredox::call::openat which resolved to
the bootstrap's own redox_openat_v1 in initfs.rs, calling syscall::openat
(SYS_OPENAT). This let the kernel allocate POSIX FDs 0,1,2 for
stdin/stdout/stderr, but the userspace FILETABLE was never updated.

Later, exec.rs called auth.dup(b'cur-context') via redox_rt::sys::dup,
which asked the empty FILETABLE for a free slot (returning 0), then
passed it to SYS_DUP_INTO. The kernel rejected it with EEXIST because
posix_fdtbl[0] was already occupied by stdin.

Fix: use syscall::openat_into to directly specify FD slots 0,1,2 in
start.rs, and use syscall::dup_into with a computed FD index for
cur-context in exec.rs. Both bypass the FILETABLE, which is only
populated later by redox_rt::initialize_freestanding.
2026-07-11 17:02:37 +03:00
Red Bear OS f4c7552767 bootstrap: fix refutable pattern for Option<FexecResult> 2026-07-11 14:21:59 +03:00
Red Bear OS 479138d02f bootstrap: adapt to upstream redox-rt API changes
- ExtraInfo now requires filetable_fd and same_process fields
- fexec_impl now returns Option<FexecResult>
2026-07-11 14:13:50 +03:00
Red Bear OS 979b5fa55c base: update Cargo.lock 2026-07-11 12:02:49 +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 1b17b3fc24 Merge branch 'pty-redoxer' into 'main'
redoxerd: Proper pty init

See merge request redox-os/base!303
2026-07-10 17:35:02 -06:00
Wildan M eb48b04b54 redoxerd: Proper pty init 2026-07-10 11:22:55 +07: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
Jeremy Soller 9a855b3c43 Merge branch 'main' into 'main'
ptyd: add documentation for the `pty' scheme's resources

See merge request redox-os/base!302
2026-07-08 16:30:43 -06:00
Connor-GH 46965493a0 ptyd: add documentation for the `pty' scheme's resources 2026-07-08 13:13:06 -05:00
Jeremy Soller 3e5007b3d8 Merge branch 'main' into 'main'
ptyd: implement tcflush, tcdrain, and tcsendbreak

See merge request redox-os/base!301
2026-07-07 16:55:01 -06:00
Connor-GH cc03dca2c8 ptyd: implement tcflush, tcdrain, and tcsendbreak 2026-07-07 16:43:18 -05:00
Jeremy Soller 2e702052f9 Merge branch 'cwd-boot' into 'main'
init: Change cwd to `/` at boot

See merge request redox-os/base!289
2026-07-06 05:42:20 -06:00
Wildan M f80b51411b init: Change cwd to / at boot 2026-07-06 05:17:35 +07:00
Jeremy Soller ae1538c27e Merge branch 'path-update' into 'main'
Update redox-path to relax canonical path requirement

See merge request redox-os/base!300
2026-07-05 10:54:36 -06:00
Jeremy Soller a2f68597c2 Merge branch 'raspi-fix' into 'main'
randd: Fix ARM hardware seed detection, raspi: Fix bcm driver init

See merge request redox-os/base!299
2026-07-05 05:44:14 -06:00
Wildan M 4692e32455 Update redox-path to relax canonical path requirement 2026-07-05 18:03:54 +07:00
Wildan M 572561035b raspi: Fix bcm driver init 2026-07-05 11:08:50 +07:00
Wildan M d75260e0d8 randd: Fix ARM hardware seed detection 2026-07-05 11:07:37 +07:00
Jeremy Soller 2878a22564 Merge branch 'fix_fbcond_enter' into 'main'
Fix enter key in fbcond

See merge request redox-os/base!297
2026-07-03 06:01:44 -06:00
bjorn3 d1b51888b6 Fix enter key in fbcond 2026-07-02 19:57:52 +02:00
Jeremy Soller 5238db02b0 Merge branch 'gpu_drm45' into 'main'
drivers/graphics/driver-graphics: Implement cursor planes

See merge request redox-os/base!296
2026-07-02 11:55:22 -06:00
bjorn3 31793e7c0c drivers/graphics/driver-graphics: Implement cursor planes 2026-07-02 19:33:53 +02:00
Jeremy Soller ff274f62b8 Merge branch 'gpu_drm44' into 'main'
drivers/graphics/driver-graphics: Implement DRM_IOCTL_MODE_CLOSEFB

See merge request redox-os/base!292
2026-07-01 14:13:58 -06:00
Jeremy Soller 00a3dfb215 Merge branch 'better_panic_message' into 'main'
Improve panic message when manually starting a daemon

See merge request redox-os/base!291
2026-07-01 14:13:23 -06:00
bjorn3 4411f8cfb6 drivers/graphics/driver-graphics: Implement DRM_IOCTL_MODE_CLOSEFB 2026-07-01 21:49:11 +02:00
bjorn3 f74a6f8765 Improve panic message when manually starting a daemon 2026-07-01 21:42:05 +02:00
Jeremy Soller f1c44511ec Merge branch 'less_board_config' into 'main'
Unconditionally compile bcm2835-sdhcid

See merge request redox-os/base!290
2026-07-01 13:35:39 -06:00
bjorn3 ed73d8a36d Rustfmt 2026-07-01 21:11:55 +02:00
bjorn3 f71d388c5b Unconditionally compile bcm2835-sdhcid
This moves us closer towards having a single unified image for all arm64
systems. Only init still has the board compiled in rather than detecting
it from the device tree or ACPI tables.
2026-07-01 21:06:41 +02:00
Jeremy Soller a301f50bca Merge branch 'avoid-blocking-nsmgr' into 'main'
refactor: Adapt to userspace fd allocation

See merge request redox-os/base!283
2026-07-01 08:20:05 -06:00
Ibuki Omatsu 372b200f26 refactor: Adapt to userspace fd allocation 2026-07-01 08:20:05 -06:00
Jeremy Soller 29a1f4f8ec Merge branch 'remove_unnecessary_struct_repr' into 'main'
Remove unnecessary struct reprs

See merge request redox-os/base!288
2026-06-26 06:30:51 -06:00
bjorn3 9c52365339 Remove unnecessary struct reprs 2026-06-26 12:13:28 +02:00
Jeremy Soller 98996d26b0 usbhidd: set xbox 360 LED 2026-06-25 14:23:25 -06:00
Jeremy Soller 74eb45cb26 xhcid: fix endpoint handling issues and use newtype for endpoint number 2026-06-25 14:21:09 -06:00
Jeremy Soller fc487b3ee2 usbhidd: fix set report value word 2026-06-25 13:05:29 -06:00
Jeremy Soller fdff2d29a6 Update Cargo.lock 2026-06-25 13:03:46 -06:00
Jeremy Soller 76385adca3 xhcid: do not read interface names and add more debugging 2026-06-25 13:03:19 -06:00
Jeremy Soller d230839c64 Merge branch 'main' into 'main'
misc(netstack): update `smoltcp` to v0.13.1

See merge request redox-os/base!287
2026-06-25 12:16:28 -06:00
Anhad Singh cdea756569 fix(tcp/write_buf): incorrect return value
On success, the number of bytes written should be returned.

Previously `buf.len()` was always returned. The function `send_slice`
> ... returns the amount of octets actually enqueued, which is limited
> by the amount of free space in the transmit buffer; down to zero.

"down to zero" is okay as that is checked by `can_send`.

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2026-06-25 23:55:00 +10: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
Anhad Singh 7bfca6c5ab misc(netstack): update smoltcp to v0.13.1
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2026-06-24 16:56:05 +10:00
Jeremy Soller 4fc813f3ef Send controller events from usbhidd 2026-06-23 20:21:40 -06:00
Jeremy Soller 759b3cfeec Support triggers and adjust gamepad threshold 2026-06-23 18:12:24 -06:00
Jeremy Soller 7fcc18ec06 Use different mappings for gamepad dpad 2026-06-23 17:50:56 -06:00
Jeremy Soller ff7492949e Initial gamepad support 2026-06-23 17:29:25 -06:00
Ribbon 97dc1d2aa4 Merge branch 'improve-info' into 'main'
Small changes

See merge request redox-os/base!197
2026-06-20 21:24:44 -03:00
Wildan Mubarok 82504a917e Merge branch 'fix-redoxer-pty' into 'main'
ptyd: Revert pty master fpath

See merge request redox-os/base!285
2026-06-20 07:52:56 +00:00
Wildan M 812e0f6f1e ptyd: Revert pty master fpath 2026-06-20 13:24:10 +07:00
auronandace c3789b4ed3 only perform a single write and assert the amount written 2026-06-17 14:09:47 +01:00
auronandace 05a8954e0a add and apply unused_io_amount clippy lint 2026-06-17 13:40:16 +01:00
Mathew John Roberts c906030759 Merge branch 'base-minor-clippy-cleanup' into 'main'
tackle some minor clippy lints in ptyd and its dependencies

See merge request redox-os/base!281
2026-06-17 12:52:55 +01:00
Mathew John Roberts e957042c45 Apply 1 suggestion(s) to 1 file(s)
Co-authored-by: Wildan Mubarok <willnode@wellosoft.net>
2026-06-17 12:46:36 +01:00
auronandace 997155ef2c tackle some minor clippy lints in ptyd and its dependencies 2026-06-17 10:41:06 +01:00
Jeremy Soller dab7d039e2 Merge branch 'update-orbclient' into 'main'
Update orbclient

See merge request redox-os/base!280
2026-06-12 15:28:52 -06:00
Wildan M bd752fb95f Update orbclient 2026-06-12 20:27:17 +07:00
Jeremy Soller 4581183c10 Merge branch 'ev' into 'main'
Do not send TextInputEvent for control characters

See merge request redox-os/base!279
2026-06-08 19:19:45 -06:00
Wildan M e8f1b1a888 Do not send TextInputEvent for control characters 2026-06-09 04:15:22 +07:00
4lDO2 9dd6901d59 acpid: setrens before ready(), fixing deadlock.
Otherwise, an open call to /scheme/acpi/tables will result in nsmgr
blocking on an `openat(acpi_root, "tables")` call, which will never
occur if acpid is itself blocking on a `ForkNs` call to nsmgr before it
can serve any scheme requests.
2026-06-05 11:03:32 +02:00
Jeremy Soller 718041b8b0 Merge branch 'fix-ci-sysroot' into 'main'
Fix test since sysroot is implicit in redoxer

See merge request redox-os/base!277
2026-06-04 06:20:07 -06:00
Jeremy Soller abc66dd4d5 Merge branch 'ptyd-improvements' into 'main'
ptyd: implement TIOCGPTN and TIOC{S,G}PTLCK

See merge request redox-os/base!276
2026-06-03 19:26:08 -06:00
Connor-GH ddd6c4f3ac ptyd: implement TIOCGPTN and TIOC{S,G}PTLCK
This functionality is needed according to POSIX. Additionally, some
logic had to be changed in order for the ptsname to be correct for the
manager terminal (ptmx). If you want to obtain a pty, you must go
through the `posix_openpt`-`grantpt`-`unlockpt`-`ptsname`-`open`
process. Alternatively, relibc as a function called `openpty`.

This is part of my ptyd series. This can be safely merged once the MRs
for relibc/ and userutils/ are merged at the same time.
2026-06-03 19:33:09 -05:00
Wildan M 586213b681 Fix test since sysroot is implicit in redoxer 2026-06-04 02:13:50 +07:00
4lDO2 2272746215 Run rustfmt. 2026-06-03 10:38:36 +02:00
Jeremy Soller 2045364b58 Merge branch 'simplify_acpi' into 'main'
Use simplified kernel ACPI interface.

See merge request redox-os/base!275
2026-06-02 19:54:36 -06:00
4lDO2 4a34c3251e Use simplified kernel ACPI interface. 2026-06-02 15:40:28 +02:00
Jacob Lorentzon 24a98c0309 Merge branch 'relpathat' into 'main'
feat: Implement realpathat for ramfs

See merge request redox-os/base!271
2026-05-29 13:13:36 +02:00
Ibuki Omatsu 52b1d04e12 feat: Implement realpathat for ramfs 2026-05-29 13:13:35 +02:00
Jeremy Soller bceb3925bd Merge branch 'fix_warnings' into 'main'
Fix warnings for updated rustc

See merge request redox-os/base!273
2026-05-27 13:35:26 -06:00
bjorn3 24fb66e144 Fix warnings for updated rustc
And move away from an internal feature now that there is a proper
(unstable) function for it.
2026-05-27 21:11:53 +02:00
Jeremy Soller 784801908e Merge branch 'fix_console_draw' into 'main'
drivers/graphics/console-draw: Fix corrupted drawing

See merge request redox-os/base!272
2026-05-24 13:09:09 -06:00
bjorn3 5701459db4 drivers/graphics/console-draw: Use font height rather than width where necessary
This fixes major corruption of the drawn text.
2026-05-24 20:36:18 +02:00
bjorn3 54b2697a6d drivers/graphics/console-draw: Missed change 2026-05-24 20:31:51 +02:00
bjorn3 5e800afd1b drivers/graphics: Couple of misc fbcond/fbbootlogd cleanups 2026-05-24 20:23:05 +02:00
Jeremy Soller 2dbc3c46a3 Merge branch 'patch-1' into 'main'
Remove fbcond dependency in initfs graphics target

See merge request redox-os/base!270
2026-05-17 06:16:48 -06:00
Migue Magic 655c2fe691 Remove fbcond dependency in initfs graphics target 2026-05-16 16:55:53 +00:00
bjorn3 9ed223af09 Merge branch 'fix-build' into 'main'
fbbootlogd: Fix build

See merge request redox-os/base!269
2026-05-16 09:42:41 +00:00
Wildan M b70f565ec5 fbbootlogd: Fix build 2026-05-16 15:26:38 +07:00
Jeremy Soller a0e34b92e5 Merge branch 'console-font-support' into 'main'
Implement font support

See merge request redox-os/base!261
2026-05-15 17:21:18 -06:00
Migue Magic ae77a4f0ad Implement font support 2026-05-15 17:21:18 -06:00
Jeremy Soller 7bc1442eb9 Merge branch 'gpu_drm43' into 'main'
drivers/graphics/driver-graphics: Extract ioctl impls into a separate module

See merge request redox-os/base!268
2026-05-14 15:02:06 -06:00
Jeremy Soller c587cda80e Merge branch 'gpu_drm42' into 'main'
drivers/graphics/driver-graphics: Expose a bunch of properties on planes

See merge request redox-os/base!267
2026-05-14 13:24:31 -06:00
bjorn3 fc2d098f70 drivers/graphics/driver-graphics: Move property ioctls to a separate module 2026-05-14 18:37:55 +02:00
bjorn3 3e7b757f0b drivers/graphics/driver-graphics: Deduplicate code between MODE_CURSOR and MODE_CURSOR2 2026-05-14 17:40:43 +02:00
bjorn3 798ef0738e drivers/graphics/driver-graphics: Move cursor ioctls to a separate module 2026-05-14 17:36:55 +02:00
bjorn3 df845d6566 drivers/graphics/driver-graphics: Move framebuffer ioctls to a separate module 2026-05-14 17:32:39 +02:00
bjorn3 2ac2182caa drivers/graphics/driver-graphics: Move ioctl impls to a new module 2026-05-14 17:25:02 +02:00
bjorn3 22060149c2 drivers/graphics/driver-graphics: Extract ioctl implementations into a function 2026-05-14 17:22:15 +02:00
bjorn3 241bae84e7 drivers/graphics/driver-graphics: Fix leftover of dummy planes 2026-05-14 17:13:31 +02:00
bjorn3 c66c9e95fa drivers/graphics/driver-graphics: Introduce DrmHandle 2026-05-14 17:05:47 +02:00
bjorn3 a53777050c drivers/graphics/driver-graphics: Expose a bunch of properties on planes 2026-05-14 16:43:10 +02:00
Jeremy Soller dbff1566a4 Merge branch 'gpu_drm41' into 'main'
Support planes in the drm interface

See merge request redox-os/base!266
2026-05-14 08:29:00 -06:00
bjorn3 607906de28 Rustfmt 2026-05-14 16:19:10 +02:00
bjorn3 b0d7b6135e Restore some FIXMEs 2026-05-14 16:09:07 +02:00
bjorn3 6a039c29fe drivers/graphics/ihdgd: Don't access CRTC in set_plane 2026-05-14 16:05:57 +02:00
bjorn3 5d6faacfb3 drivers/graphics/driver-graphics: Couple of fixups 2026-05-14 16:00:30 +02:00
bjorn3 0ee128ad8d drivers/graphics: Make everything work 2026-05-14 15:50:15 +02:00
bjorn3 ab8bfb9d5d drivers/graphics/driver-graphics: Report actual planes from MODE_GET_PLANE 2026-05-14 15:33:17 +02:00
bjorn3 76d6398473 drivers/graphics/driver-graphics: Add primary plane for every CRTC 2026-05-14 15:29:58 +02:00
Meijlen 835be6f654 drivers/graphics: Implement support for planes 2026-05-14 15:29:56 +02:00
bjorn3 53da1b0dc4 drivers/graphics/driver-graphics: Fix ioctl order 2026-05-14 15:29:24 +02:00
Jeremy Soller 30ba2e2cfb Merge branch 'gpu_drm40' into 'main'
drivers/graphics/driver-graphics: Implement some things that libdrm needs

See merge request redox-os/base!265
2026-05-14 07:01:32 -06:00
bjorn3 5f4e5016a8 drivers/graphics/driver-graphics: Implement MODE_ADD_FB2 2026-05-14 14:56:33 +02:00
bjorn3 0eb6390fe1 drivers/graphics/driver-graphics: Report DRM_MAJOR as device major 2026-05-14 12:23:54 +02:00
bjorn3 6875c90850 drivers/graphics/driver-graphics: Implement SET_VERSION and GET_UNIQUE
libdrm needs these when searching for drm devices.
2026-05-14 12:09:55 +02:00
Jeremy Soller f37a5206d6 Merge branch 'gpu_drm39' into 'main'
drivers/graphics: Couple of refactorings

See merge request redox-os/base!264
2026-05-13 14:11:32 -06:00
bjorn3 d110147d62 drivers/graphics/driver-graphics: Introduce KmsObjects::remove helper 2026-05-13 21:19:05 +02:00
bjorn3 d1cf7d53d2 drivers/graphics/driver-graphics: Introduce set_connector_edid helper
And don't create a new blob unless the EDID actually changes.
2026-05-13 21:18:59 +02:00
bjorn3 74bd1db73a drivers/graphics/virtio-gpu: Move some block_on calls to the callers 2026-05-13 20:02:01 +02:00
bjorn3 e2c67fa8f8 drivers/graphics/virtio-gpu: Extract create_dumb_buffer_inner as async function 2026-05-13 20:00:25 +02:00
bjorn3 ebdf681eab drivers/graphics/virtio-gpu: Introduce send_request_cursor 2026-05-13 19:46:56 +02:00
Jeremy Soller 68abd4bd56 Merge branch 'gpu_drm38' into 'main'
drivers/graphics/driver-graphics: Match error codes of Linux

See merge request redox-os/base!263
2026-05-12 14:08:24 -06:00
bjorn3 7c533510a9 drivers/graphics/driver-graphics: Match error codes of Linux 2026-05-12 21:15:59 +02:00
Jeremy Soller 1d0e8b556a Merge branch 'fbcond-outside-initfs' into 'main'
Move fbcond outside initfs

See merge request redox-os/base!262
2026-05-12 11:41:28 -06:00
Migue Magic 0e08a6ef00 Move fbcond outside initfs 2026-05-12 11:41:28 -06:00
Jeremy Soller 259863fcf6 Merge branch 'drm_gpu37' into 'main'
drivers/graphics: Couple of tweaks

See merge request redox-os/base!260
2026-05-10 08:05:47 -06:00
bjorn3 e4462ccc09 drivers/graphics/driver-graphics: Report dummy TILE property for connectors 2026-05-10 15:28:39 +02:00
bjorn3 3f4ad965de drivers/graphics/driver-graphics: Report ACTIVE property for CRTCs 2026-05-10 15:22:15 +02:00
bjorn3 e93431cac0 drivers/graphics/driver-graphics: Replace From and TryFrom impls with KmsObjectKind trait 2026-05-10 15:09:34 +02:00
bjorn3 009a9130d2 drivers/graphics: Report DRM_CAP_DUMB_PREFERRED_DEPTH to clients 2026-05-10 14:54:47 +02:00
bjorn3 853e050fc8 drivers/graphics/driver-graphics: Use unzip in get_object_properties_data 2026-05-10 12:17:35 +02:00
Jeremy Soller 1a0f2a4c89 Merge branch 'less_physmap' into 'main'
drivers/pcid: Map BAR through pcid

See merge request redox-os/base!259
2026-05-09 13:24:20 -06:00
bjorn3 e9fd66c78e drivers/pcid: Map BAR through pcid
This way PCI drivers don't need to use the privileged physmap interface,
but only need access to a pcid handle. This is not yet enough for
running drivers as unprivileged processes. Interrupts also need
privileges and we need IOMMU support in the kernel.
2026-05-09 20:53:21 +02:00
bjorn3 d528fb73b4 drivers: Use map_bar instead of physmap where possible
Physmap requires root, while map_bar in the future could be run as
unprivileged process given a pcid handle for the target device.
2026-05-09 20:12:41 +02:00
Jeremy Soller 0f2291ed8b Merge branch 'gpu_drm36' into 'main'
drivers/graphics: Avoid unnecessary force probes

See merge request redox-os/base!258
2026-05-09 06:21:08 -06:00
bjorn3 018d795eb0 drivers/graphics: Avoid unnecessary force probes
Force probes can be rather expensive on real hardware so according to
the drm_mode_get_connector docs it should only be done at startup, on a
hotplug event and when explicitly requested by the user.
2026-05-09 12:16:22 +02:00
bjorn3 2436639271 drivers/graphics: Avoid duplicate get_connector calls 2026-05-09 12:07:58 +02:00
bjorn3 15c3327adb drivers/graphics/ihdgd: Remove unnecessary reset call
alloc_buffers already starts as empty.
2026-05-08 20:24:09 +02:00
Jeremy Soller 8e37b8d6b5 Merge branch 'update_cargo_lock' into 'main'
Update Cargo.lock

See merge request redox-os/base!257
2026-05-08 12:14:43 -06:00
bjorn3 4a3517569c Update Cargo.lock 2026-05-08 19:59:57 +02:00
Jeremy Soller 485f2949ba Merge branch 'usb-rework' into 'main'
[xhcid] Push class specific descriptor parsing to the drivers

See merge request redox-os/base!255
2026-05-07 14:37:44 -06:00
Jeremy Soller c5f098ad34 Merge branch 'drm_gpu35' into 'main'
drivers/graphics/driver-graphics: Couple of minor cleanups

See merge request redox-os/base!256
2026-05-07 14:37:11 -06:00
bjorn3 1dcf00dc8e drivers/graphics/driver-graphics: Replace hw_cursor_size with has_cursor_plane
Clients get the cursor size using get_cap. hw_cursor_size is only used
to determine the existence of a cursor plane nowadays.
2026-05-07 22:20:59 +02:00
bjorn3 e9188e0f91 drivers/graphics/driver-graphics: Reduce visibility of some functions 2026-05-07 22:20:12 +02:00
Antoine Reversat 3f6c0c706f Run cargo fmt 2026-05-07 15:22:33 -04:00
Antoine Reversat f6bb61ba18 Move report descriptor parsing into usbhid 2026-05-07 14:05:13 -04:00
Antoine Reversat e22712d920 Replace hid_descs with unknown_descs 2026-05-07 12:20:07 -04:00
Jeremy Soller e2c4a1aa28 Merge branch 'gpu_drm33' into 'main'
drivers/graphics/ihdgd: Support page flipping and back dumb buffers by gpu memory

See merge request redox-os/base!253
2026-05-06 16:00:51 -06:00
Jeremy Soller 3f58fb33f0 Merge branch 'fix-logging' into 'main'
Remove max loglevel feature from netstack and reduce default loglevel

See merge request redox-os/base!254
2026-05-06 15:24:17 -06:00
Antoine Reversat a43de9ea5d Run cargo fmt 2026-05-06 17:04:19 -04:00
Antoine Reversat ddb7de4ea7 Remove max loglevel feature from netstack and reduce default loglevel 2026-05-06 16:30:45 -04:00
bjorn3 7a08d30285 Rustfmt 2026-05-06 21:43:53 +02:00
bjorn3 8fdd5f3998 drivers/graphics/ihdgd: Replace DeviceFb with GpuBuffer for dumb buffers
Dumb buffers only have a size like GpuBuffer, not width, height and
stride like DeviceFb.
2026-05-06 21:32:32 +02:00
bjorn3 221d228f36 drivers/graphics/ihdgd: Support page flipping 2026-05-06 21:32:29 +02:00
Jeremy Soller c75e5a3c67 Update dependencies 2026-05-04 12:31:48 -06:00
Jeremy Soller 09d8f7535d Merge branch 'console-draw-optimization' into 'main'
Optimize console-draw write function

See merge request redox-os/base!252
2026-05-03 09:06:37 -06:00
Migue Magic e577bfc2ea Optimize console-draw write function 2026-05-03 09:06:37 -06:00
Jeremy Soller f445211de8 Merge branch 'uds-nowarn' into 'main'
ipcd: Don't warn for opening stat

See merge request redox-os/base!251
2026-05-02 17:58:50 -06:00
Jeremy Soller df1d306a95 Merge branch 'legacy-spawn' into 'main'
daemon: Fix boot stuck in pcid spawning drivers

See merge request redox-os/base!250
2026-05-02 06:25:07 -06:00
Wildan M 55146b6e8e ipcd: Don't warn for opening stat 2026-05-02 18:46:51 +07:00
Wildan M 9022f8a842 daemon: Fix boot stuck in pcid spawning drivers 2026-05-02 12:11:34 +07:00
Jeremy Soller 03de886c96 audiod: fix deadlock 2026-05-01 17:05:57 -06:00
Jeremy Soller 698f90a064 Merge branch 'init-stuck' into 'main'
init: Fix boot stuck caused by driver exiting

See merge request redox-os/base!249
2026-04-28 09:07:19 -06:00
Wildan M b085d6d88b build: Fix rebuilding 2026-04-28 22:03:47 +07:00
Wildan M eeee52f206 init: Fix boot stuck caused by driver exiting 2026-04-28 22:03:20 +07:00
Jeremy Soller 4b8158b111 Merge branch 'fix_compilation' into 'main'
Fix compilation

See merge request redox-os/base!248
2026-04-27 14:19:03 -06:00
bjorn3 009ffe1dbc Fix compilation 2026-04-27 22:09:53 +02:00
Jeremy Soller 6821e38eba Merge branch 'fix_init_path' into 'main'
Fix init path passed to fexec_impl

See merge request redox-os/base!247
2026-04-27 12:37:35 -06:00
bjorn3 7757d2d32f Fix init path passed to fexec_impl
Getting this path wrong breaks dynamically linking init.
2026-04-27 20:35:05 +02:00
Jeremy Soller bf52e1e12b Merge branch 'main' into 'main'
Fix typos across 3 drivers

See merge request redox-os/base!246
2026-04-27 12:27:11 -06:00
Migue Magic 180bfe15a7 Fix typos across 3 drivers 2026-04-27 12:27:11 -06:00
Jeremy Soller ff22e40766 Merge branch 'upstream-acpi' into 'main'
Update ACPI crate

See merge request redox-os/base!243
2026-04-27 06:51:53 -06:00
Wildan M f2f834d412 Update ACPI crate 2026-04-27 15:57:46 +07:00
Jeremy Soller b1136568fa Merge branch 'refactor_initfs2' into 'main'
More refactors to initfs building

See merge request redox-os/base!245
2026-04-26 12:58:02 -06:00
bjorn3 e0cffb0a36 initfs: Allow building an initfs without assembling it on disk first 2026-04-26 18:36:23 +02:00
bjorn3 b0c675634b initfs: Minor cleanups 2026-04-26 18:36:23 +02:00
bjorn3 34471854e2 initfs: Remove Dir wrapper 2026-04-26 18:36:23 +02:00
bjorn3 929486d078 initfs: Replace metadata field on Entry with executable field on EntryKind::File 2026-04-26 18:36:23 +02:00
Jeremy Soller 8279be01d3 Merge branch 'initfs_reproducibility' into 'main'
initfs: Hard code creation time

See merge request redox-os/base!23
2026-04-26 07:13:04 -06:00
bjorn3 cdf45983fa initfs: Hard code creation time
This improves reproducibility of the initfs.
2026-04-26 12:16:30 +02:00
Jeremy Soller 1c2a3dcc53 Merge branch 'refactor_initfs' into 'main'
Refactor initfs building

See merge request redox-os/base!244
2026-04-25 09:48:12 -06:00
bjorn3 dd27c1ae08 initfs: Introduce InodeTable 2026-04-25 13:58:52 +02:00
bjorn3 2052b70212 initfs: Allocate inodes in write_inode 2026-04-25 13:54:23 +02:00
bjorn3 108a9343e3 initfs: Move inode_count write from read_directory to allocate_contents 2026-04-25 13:53:39 +02:00
bjorn3 7e4e3864e5 initfs: Write inode table at the end 2026-04-25 13:53:39 +02:00
bjorn3 42fee3ca8d initfs: Simplify archive cli 2026-04-25 13:53:38 +02:00
bjorn3 8b1fb36e6b initfs: Fix test 2026-04-25 13:49:49 +02:00
Jeremy Soller 6b33cd623a Merge branch 'xhcid_config_files' into 'main'
drivers/usb/xhcid: Load config files at runtime rather than compile time

See merge request redox-os/base!242
2026-04-22 15:02:26 -06:00
Jeremy Soller 4bf1229a3e Merge branch 'device_symlink' into 'main'
Move device file symlinks into the base repo

See merge request redox-os/base!241
2026-04-22 15:01:11 -06:00
bjorn3 e217ff2c6a drivers/usb/xhcid: Load config files at runtime rather than compile time 2026-04-22 22:36:40 +02:00
bjorn3 1633b96135 Move device file symlinks into the base repo 2026-04-22 21:48:50 +02:00
Jeremy Soller 463f76b960 Merge branch 'update_lockfile' into 'main'
Update outdated lockfile

See merge request redox-os/base!240
2026-04-22 12:36:02 -06:00
bjorn3 1b8434abe4 Update outdated lockfile 2026-04-22 20:34:01 +02:00
Jeremy Soller d1aa5f662a Merge branch 'merge_base_initfs_recipe' into 'main'
Build the base system and initfs in a single recipe

See merge request redox-os/base!239
2026-04-22 12:20:33 -06:00
bjorn3 6d1b19e55b Only set REDOX_SYSROOT for redoxer install redoxfs 2026-04-22 20:05:24 +02:00
Jeremy Soller ba2b7775e6 Merge branch 'dep_update' into 'main'
Update yanked drm version

See merge request redox-os/base!238
2026-04-21 15:15:00 -06:00
bjorn3 4cc92b3ccf Build the base system and initfs in a single recipe 2026-04-21 22:38:02 +02:00
aarch 8522ed4eec Update yanked drm version 2026-04-21 19:33:35 +00:00
Jeremy Soller e37bedd11c Merge branch 'update_makefile' into 'main'
Update Makefile in preparation for using it in the base recipes

See merge request redox-os/base!236
2026-04-20 16:29:10 -06:00
bjorn3 8e2b451965 Update Makefile in preparation for using it in the base recipes 2026-04-20 21:00:10 +02:00
Jeremy Soller d49a764f2c Merge branch 'test-multi-boot' into 'main'
Test boot with multicore

See merge request redox-os/base!237
2026-04-20 11:28:21 -06:00
Wildan M 08c36bed26 Test boot with multicore 2026-04-20 09:31:54 +07:00
Jeremy Soller f7f40b0932 Merge branch 'fix_i586' into 'main'
Fix building bootstrap for i586

See merge request redox-os/base!235
2026-04-19 16:55:20 -06:00
bjorn3 69c1f56cf0 Workaround hardlink issue in CI 2026-04-19 21:24:09 +02:00
bjorn3 6adebf03c8 Fix install-initfs 2026-04-19 21:00:08 +02:00
bjorn3 4fa1ef7c98 Fix building bootstrap for i586 2026-04-19 20:49:19 +02:00
Jeremy Soller f2a01c4d1f Merge branch 'make_always_rebuild' into 'main'
Always rebuild in the Makefile

See merge request redox-os/base!234
2026-04-19 12:28:14 -06:00
bjorn3 6ff5e9fdcd Always rebuild in the Makefile
And let cargo do the dependency tracking instead.
2026-04-19 20:02:43 +02:00
Jeremy Soller 5b93fe9a6f Merge branch 'scheme_cleanups3' into 'main'
scheme-utils: Introduce FpathWriter helper

See merge request redox-os/base!233
2026-04-19 11:52:40 -06:00
bjorn3 daf726c30d scheme-utils: Have FpathWriter handle writing the scheme name 2026-04-19 19:07:41 +02:00
bjorn3 64d23e9e05 scheme-utils: Introduce FpathWriter helper 2026-04-19 19:07:41 +02:00
Jeremy Soller 648939b5b8 Merge branch 'scheme_cleanups2' into 'main'
Introduce Blocking as counterpart to ReadinessBased for blocking schemes

See merge request redox-os/base!232
2026-04-19 08:43:54 -06:00
Jeremy Soller 1f52d10786 Merge branch 'makefile' into 'main'
Add compiling and testing with Makefile

See merge request redox-os/base!231
2026-04-19 08:41:14 -06:00
bjorn3 28900f7c49 scheme-utils: Introduce Blocking as counterpart to ReadinessBased for blocking schemes 2026-04-19 11:05:04 +02:00
Wildan M 40b1dce975 Add compiling and testing with Makefile 2026-04-19 15:48:52 +07:00
bjorn3 6686c73d26 Implement on_close method of SchemeSync instead of using a separate method 2026-04-19 10:42:19 +02:00
Jeremy Soller b2ba41e935 Merge branch 'Sv39' into 'main'
RISCV64: Change VA scheme to Sv39 for real hardware support

See merge request redox-os/base!217
2026-04-18 09:45:13 -06:00
aarch eb82e9cc88 RISCV64: Change VA scheme to Sv39 for real hardware support 2026-04-18 09:45:13 -06:00
Jeremy Soller 80233d0d62 Merge branch 'scheme_cleanups' into 'main'
scheme-utils: Copy ReadinessBased from redox-scheme to scheme-utils

See merge request redox-os/base!230
2026-04-18 08:52:34 -06:00
bjorn3 07657eb50e scheme-utils: Panic on nonblocking scheme write 2026-04-18 16:49:21 +02:00
bjorn3 a2bc1dd79c scheme-utils: Panic on scheme EOF
EOF used to be triggered by unmounting a scheme, but this is no longer
the case since namespaces got moved to userspace. Unmounting now only
closes the scheme root fd.
2026-04-18 16:49:21 +02: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
bjorn3 4ef2c7ad6f scheme-utils: Remove the need for RefCell wrappers around schemes for ReadinessBased 2026-04-18 16:49:21 +02:00
bjorn3 ca281c9395 scheme-utils: Copy ReadinessBased from redox-scheme to scheme-utils
To allow improving the implementation and interface in this repo and
move it back into redox-scheme later.
2026-04-18 16:49:03 +02:00
Jeremy Soller 0669f41847 Merge branch 'workaround_deadlock' into 'main'
Workaround deadlock in initnsmgr

See merge request redox-os/base!229
2026-04-18 06:54:50 -06:00
bjorn3 01183044a3 Workaround deadlock in initnsmgr 2026-04-18 12:58:41 +02:00
Jeremy Soller fd80a6625d Merge branch 'update-relibc' into 'main'
Update redox-rt

See merge request redox-os/base!228
2026-04-17 19:01:49 -06:00
Wildan M db5209afbd Update redox-rt 2026-04-18 03:33:52 +07:00
Jeremy Soller 5b5a2b8e2b Merge branch 'priority-sched' into 'main'
Add priority support

See merge request redox-os/base!194
2026-04-17 06:54:01 -06: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
Akshit Gaur 4a527cb374 Add ProcCall 2026-04-17 14:39:58 +05:30
Akshit Gaur 2ccd96cf3d revamp sync_kernel_attrs 2026-04-17 14:39:58 +05:30
Akshit Gaur ec1e02e712 ens to prio 2026-04-17 14:39:58 +05:30
Jeremy Soller e2fa1c5c14 Merge branch 'initfs_build_rework' into 'main'
bootstrap: Move a bunch of build flags from the recipe

See merge request redox-os/base!227
2026-04-16 15:59:39 -06:00
bjorn3 c0f548f219 bootstrap: Move a bunch of build flags from the recipe 2026-04-16 19:54:15 +02:00
Jeremy Soller 871b08bd0c Merge branch 'misc_changes' into 'main'
Couple of misc changes

See merge request redox-os/base!226
2026-04-16 11:51:24 -06:00
bjorn3 cb34b3da67 Update ipcd to rand 0.10 2026-04-16 19:10:34 +02:00
bjorn3 cdede58055 Couple of minor scheme related cleanups 2026-04-16 18:44:07 +02:00
bjorn3 06af174ce6 drivers/virtio-core: Reduce log verbosity 2026-04-16 18:43:54 +02:00
bjorn3 8d6017d799 init: Make spawning for legacy scripts self-contained 2026-04-16 18:43:54 +02:00
Jeremy Soller 20e058062b Merge branch 'fix-ided-timeout' into 'main'
Extend ided read timeout

See merge request redox-os/base!225
2026-04-16 06:53:23 -06:00
Wildan M 9e7e04e3b8 Extend ided read timeout 2026-04-16 05:28:28 +07:00
Jeremy Soller 5db1b43b94 Merge branch 'remove_bgad' into 'main'
drivers/graphics/bgad: Remove bgad

See merge request redox-os/base!224
2026-04-14 13:56:25 -06:00
bjorn3 feff62ba38 drivers/acpid: Couple minor cleanups 2026-04-14 21:54:25 +02:00
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 f80c51d2e1 drivers/audio: Minor code cleanups 2026-04-14 21:00:48 +02:00
Jeremy Soller b801bef16d Merge branch 'scheme_utils' into 'main'
Introduce scheme-utils crate and HandleMap type

See merge request redox-os/base!223
2026-04-13 14:49:06 -06: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
Jeremy Soller 6deaaa71a7 Merge branch 'check-shadow-buf' into 'main'
drivers/graphics: Add API to check if shadow buffer present

See merge request redox-os/base!222
2026-04-12 06:49:51 -06:00
Wildan M c2f46bf383 drivers/graphics: Add API to check if shadow buffer present 2026-04-12 12:39:09 +07:00
Jeremy Soller fa5463e0cb Merge branch 'move_dhcpd' into 'main'
dhcpd: Move from the netutils repo to the base repo

See merge request redox-os/base!221
2026-04-11 14:37:53 -06:00
bjorn3 7e07108b41 Rustfmt 2026-04-11 21:12:56 +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
Jeremy Soller 16e69d89c7 Merge branch 'init_rework11' into 'main'
Move audiod service definition into this repo and more init refactorings

See merge request redox-os/base!220
2026-04-11 08:11:48 -06:00
bjorn3 ee8109fe1d init: Move some legacy script complexity into Script::from_str 2026-04-11 15:51:54 +02:00
bjorn3 dd1c590131 init: Remove echo special case from legacy init scripts
The standalone echo command works fine too.
2026-04-11 15:45:27 +02:00
bjorn3 baaddd7ccf init: Support reading env vars from /usr/lib/environment.d 2026-04-11 15:40:38 +02:00
bjorn3 2e6cf9df68 init: Remove notify and scheme support from legacy init scripts 2026-04-11 15:24:12 +02:00
bjorn3 44920aef59 init: Move audiod service definition into this repo
And convert it into a scheme daemon.
2026-04-11 15:23:34 +02:00
bjorn3 347287a3ed init: Move run and run_command to the scheduler 2026-04-11 15:02:25 +02:00
Jeremy Soller 4291b0da0a Merge branch 'init_rework10' into 'main'
init: Migrate the base services from init scripts

See merge request redox-os/base!219
2026-04-11 06:40:05 -06:00
bjorn3 20429746f8 init: Migrate the base services from init scripts
And move them into the base repo.
2026-04-11 10:47:34 +02:00
Jeremy Soller 05ab0a2633 Merge branch 'init_rework9' into 'main'
Some preparations for parallel service spawning

See merge request redox-os/base!218
2026-04-10 18:54:17 -06:00
bjorn3 853a26918f init: Move initfs configs to init.initfs.d
This frees up init.d for init configs on the rootfs.
2026-04-10 22:14:24 +02:00
bjorn3 02b074f2e6 init: Unify child spawning calls 2026-04-10 22:14:24 +02:00
bjorn3 8506ae5581 init: Move daemon spawning from daemon to init
In preparation for concurrent daemon spawning.
2026-04-10 22:14:24 +02:00
bjorn3 24ff4f294e init: Start logd as a regular service 2026-04-10 22:14:24 +02:00
Jeremy Soller 6b41e68be4 Merge branch 'init_rework8' into 'main'
init: Introduce a basic job scheduler

See merge request redox-os/base!215
2026-04-09 15:21:05 -06:00
Mathew John Roberts d50164a6b5 Merge branch 'disconnected_udp' into 'main'
Move to separate 0.0.0.0:0 and disconnected states for udp AF_UNSPEC

See merge request redox-os/base!216
2026-04-09 08:18:36 +01:00
Benton60 2440ef302b switch to using the remote endpoint for getpeername checks 2026-04-07 02:08:15 -04:00
Benton60 321f15c850 fix 0.0.0.0:non-zero port getpeername calls 2026-04-06 18:14:09 -04:00
Benton60 5fc7dc360a add a check for connectivity in get_peer_name 2026-04-06 13:22:08 -04:00
Benton60 5d1981bf23 fix failing os-test by correcting disconnect behavior 2026-04-06 12:50:21 -04:00
bjorn3 1b50d1b543 init: Inline SwitchRoot 2026-04-05 18:27:10 +02:00
bjorn3 8e6b1f8643 init: Introduce a basic job scheduler 2026-04-05 18:25:35 +02:00
bjorn3 ec0d29285e daemon: Remove check that can never fail 2026-04-05 17:32:59 +02:00
bjorn3 6a59d6f2d4 daemon: Introduce pass_fd helper 2026-04-05 17:32:59 +02:00
bjorn3 a93e4c5fcc init: Remove unnecessary derives for SwitchRoot 2026-04-05 17:32:59 +02:00
bjorn3 a4cb95bd61 init: Extract Unit::conditions_met method 2026-04-05 16:59:41 +02:00
bjorn3 e09f28f1b0 init: Pass reference to Unit to run 2026-04-05 16:59:41 +02:00
bjorn3 57d74e8e17 init: Turn default dependencies into regular dependencies at load time 2026-04-05 16:59:40 +02:00
Jeremy Soller 6056059e49 Merge branch 'inputd_improvements' into 'main'
Couple of inputd related improvements

See merge request redox-os/base!214
2026-04-05 07:55:19 -06:00
Jeremy Soller fa014c787d Merge branch 'connect' into 'main'
Remove a remote endpoint check to allow dup to clone endpoint 0.0.0.0:0

See merge request redox-os/base!213
2026-04-05 07:37:34 -06:00
bjorn3 5712c8f34c drivers/graphics/vesad: Remove unnecessary env var inherit in service 2026-04-05 13:09:45 +02:00
bjorn3 0915db5ec4 drivers/inputd: Remove unused open_display method 2026-04-05 13:09:02 +02:00
bjorn3 071ce1e98f drivers/graphics/ihdgd: Fix a couple of warnings 2026-04-05 13:06:06 +02:00
bjorn3 2572723da9 drivers/inputd: Remove unused fields from VtEvent 2026-04-05 13:05:51 +02:00
bjorn3 21d1db3538 drivers/graphics/driver-graphics: Extract activate_vt method 2026-04-05 12:56:30 +02:00
Benton60 b375f2da24 remove dup check to allow unconnect to dup to an unconnected socket 2026-04-04 18:21:10 -04:00
Jeremy Soller 619c2798e4 Merge branch 'aarch64-rand' into 'main'
randd: Add hardware randomness source for aarch64

Closes #11

See merge request redox-os/base!188
2026-03-29 15:33:58 -06:00
Philipp Bartsch 32995d5c68 randd: Add hardware randomness source for aarch64
Currently feature detection via
std::arch::is_aarch64_feature_detected!("rand") always returns false.

Closes: https://gitlab.redox-os.org/redox-os/base/-/issues/11
2026-03-29 22:22:16 +02:00
Jeremy Soller 5b18972d0c Merge branch 'improve_cpu_backed_buffer' into 'main'
drivers/graphics: Replace CpuBackedBuffer::sync_range with CpuBackedBuffer::sync_rect

See merge request redox-os/base!212
2026-03-28 10:00:27 -06:00
Jeremy Soller 6aec86ef55 Merge branch 'missing-docs' into 'main'
set missing docs lint to allow for now

See merge request redox-os/base!211
2026-03-28 09:59:57 -06:00
bjorn3 bf5286d25d drivers/graphics: Replace CpuBackedBuffer::sync_range with CpuBackedBuffer::sync_rect
This can be a bit more efficient by doing bounds checks before the main
loop.
2026-03-28 16:53:59 +01:00
auronandace 59c1f52a8b set missing docs lint to allow for now 2026-03-28 15:24:45 +00:00
Jeremy Soller 58459178b0 Merge branch 'gpu_drm36' into 'main'
drivers/graphics/ihdgd: Implement support for mapping memory to the GPU

See merge request redox-os/base!208
2026-03-27 20:40:22 -06:00
Jeremy Soller 67689e1cb5 Merge branch 'ihdgd_alchemist_pipes' into 'main'
drivers/graphics/ihdgd: List correct pipes for Alchemist

See merge request redox-os/base!210
2026-03-27 19:18:30 -06:00
bjorn3 6473d987c3 drivers/graphics/ihdgd: List correct pipes for Alchemist 2026-03-28 00:02:38 +01:00
Jeremy Soller ad371443f0 Merge branch 'rustfmt' into 'main'
Rustfmt

See merge request redox-os/base!209
2026-03-27 16:01:16 -06:00
bjorn3 ec4bc65323 Rustfmt 2026-03-27 22:57:39 +01:00
bjorn3 f152bbad23 drivers/graphics/ihdgd: Implement support for mapping memory to the GPU
This is done by adding entries to the global GTT page table. At startup
it only contains entries for a small chunk of memory reserved for the
GPU. This small chunk is rarely enough to contain all framebuffers we
need to allocate.
2026-03-27 22:45:26 +01:00
Jeremy Soller cc1dea2a82 Merge branch 'sgl_prot_none' into 'main'
drivers/common: PROT_NONE in Sgl::new for memory reservation

See merge request redox-os/base!207
2026-03-27 15:24:25 -06:00
bjorn3 1f8d5a62ef drivers/common: PROT_NONE in Sgl::new for memory reservation 2026-03-27 22:22:12 +01:00
Jeremy Soller ed739009c2 Merge branch 'gpu_drm37' into 'main'
drivers/graphics/ihdgd: Introduce GpuBuffer

See merge request redox-os/base!206
2026-03-27 14:49:47 -06:00
Jeremy Soller ca1d7bf729 Merge branch 'recvmsg' into 'main'
fix os-test recvfrom hang

See merge request redox-os/base!205
2026-03-27 10:06:52 -06:00
Benton60 4d6c9db9c0 fix a todo 2026-03-27 09:43:50 -04:00
Jeremy Soller bede348e52 Merge branch 'impl_recvmsg_handler' into 'main'
Impl recvmsg handler

See merge request redox-os/base!202
2026-03-25 07:02:28 -06:00
Benton60 259f78ae7c bump the libredox version 2026-03-24 17:26:09 -04:00
Benton60 87bda3ec32 udpate the fpath return value to reflect the new format 2026-03-24 12:34:05 -04:00
Benton60 0ad36bf5b4 implement recvmsg handler for tcp 2026-03-24 12:34:05 -04:00
Benton60 f8eff8bec3 implement the recvmsg handler for udp 2026-03-24 12:34:05 -04:00
Benton60 c9653b50eb initial setup for recvmsg, all handlers return EOPNOTSUPP for now 2026-03-24 12:34:05 -04:00
Jeremy Soller 9f94592834 Merge branch 'doc-daemon' into 'main'
add docs for daemon

See merge request redox-os/base!201
2026-03-24 10:09:07 -06:00
auronandace b65c24b12a add docs for daemon 2026-03-24 14:26:08 +00:00
Jeremy Soller 14aeec01d9 Merge branch 'common-docs' into 'main'
add documentation to public functions in common

See merge request redox-os/base!200
2026-03-24 07:04:25 -06:00
auronandace 749d0bb5ef cargo fmt 2026-03-24 10:34:07 +00:00
auronandace a65d6c411c add documentation to public functions in common 2026-03-24 10:30:45 +00:00
Jeremy Soller e0a6c3b574 Merge branch 'thiserror' into 'main'
update thiserror and add to workspace

See merge request redox-os/base!199
2026-03-23 17:52:30 -06:00
bjorn3 70bba179c4 drivers/graphics/ihdgd: Introduce GpuBuffer
Unlike DeviceFb a GpuBuffer only has a size, not a width, height and
stride. In the future GpuBuffer can be used for dumb buffers as well as
any other kind of memory we may need to allocate on the gpu.
2026-03-23 22:23:32 +01:00
Jeremy Soller 107f8696fd Merge branch 'gpu_drm35' into 'main'
Couple of GPU buffer improvements

See merge request redox-os/base!198
2026-03-23 07:23:21 -06:00
auronandace 29b4782015 update thiserror and add to workspace 2026-03-23 07:58:57 +00:00
bjorn3 d274ac2817 drivers/graphics: Return proper pitch to the drm client for dumb buffers 2026-03-22 19:53:38 +01:00
bjorn3 8ae815aca7 drivers/graphics: Replace width and height methods on Buffer with size
A buffer is not necessarily a framebuffer. It may also be a blob of
bytes.
2026-03-22 19:46:32 +01:00
Ribbon 65a29d8f63 Small changes 2026-03-22 14:44:49 -03:00
Jeremy Soller 27ecc0f524 Merge branch 'upgrade-spin' into 'main'
upgrade to latest spin crate and add to workspace

See merge request redox-os/base!196
2026-03-22 09:49:09 -06:00
auronandace e3c6ca1573 upgrade to latest spin crate and add to workspace 2026-03-22 15:43:32 +00:00
Jeremy Soller 1a045bb752 Merge branch 'consolidate-deps' into 'main'
consolidate several dependencies into the workspace

See merge request redox-os/base!195
2026-03-22 09:24:23 -06:00
auronandace 557a3d1954 consolidate several dependencies into the workspace 2026-03-22 15:11:33 +00:00
Jeremy Soller 12034cf7b0 Merge branch 'gpu_drm34' into 'main'
drivers/graphics/ihdgd: Measure fb stride in bytes rather than pixels

See merge request redox-os/base!193
2026-03-22 06:57:55 -06:00
Jeremy Soller adca8ad85a Merge branch 'usbctl-clap' into 'main'
update clap for usbctl

See merge request redox-os/base!192
2026-03-22 06:56:39 -06:00
Jeremy Soller 4b7742255b Merge branch 'libredox' into 'main'
update libredox dependency for hwd

See merge request redox-os/base!191
2026-03-22 06:56:12 -06:00
bjorn3 fcee1d7d86 drivers/graphics/ihdgd: Measure fb stride in bytes rather than pixels
This is how stride is generally stored.
2026-03-22 12:54:34 +01:00
auronandace 2f0f5160bb update clap for usbctl 2026-03-22 09:45:09 +00:00
auronandace 5645702748 actually use workspace dependency 2026-03-22 08:28:04 +00:00
auronandace 1151ec36a9 update libredox dependency for hwd 2026-03-22 08:07:48 +00:00
Jeremy Soller bd484c51a7 Merge branch 'gpu_drm34' into 'main'
drivers/graphics: Implement shadow buffer for dumb buffers

See merge request redox-os/base!190
2026-03-21 12:06:35 -06:00
bjorn3 7177fe0a86 drivers/graphics: Implement shadow buffer for dumb buffers
This is necessary to get even remotely acceptable performance when dumb
buffers are backed by write-combining memory.
2026-03-21 19:01:54 +01:00
bjorn3 e6efc5f99b drivers/graphics/fbcond: Fix log message 2026-03-21 18:02:38 +01:00
Jeremy Soller 399671e122 Merge branch 'gpu_drm32' into 'main'
Cleanup plane configuration and framebuffer creation in ihdgd

See merge request redox-os/base!189
2026-03-21 07:22:52 -06:00
bjorn3 05ca76bf59 drivers/inputd: Remove some leftover code from the old way display resizing was handled 2026-03-21 13:49:46 +01:00
bjorn3 afa6b64104 drivers/graphics/ihdgd: Introduce DeviceFb::alloc 2026-03-21 13:31:05 +01:00
bjorn3 56552cc6b3 drivers/graphics/ihdgd: Introduce helpers to fetch current plane state 2026-03-21 13:31:05 +01:00
bjorn3 36a9669c57 drivers/graphics/ihdgd: Pass DeviceFb to Plane::set_framebuffer 2026-03-21 13:31:04 +01:00
bjorn3 b1e4bcf54b drivers/graphics/ihdgd: Extract most of the plane configuration into separate functions 2026-03-21 13:21:29 +01:00
Jeremy Soller f0c8d7d321 Merge branch 'bitflags' into 'main'
add bitflags to the workspace Cargo.toml

See merge request redox-os/base!182
2026-03-20 16:36:17 -06:00
Jeremy Soller f529dd139f Merge branch 'gpu_drm31' into 'main'
Some more preparations for atomic modesetting

See merge request redox-os/base!187
2026-03-20 16:35:53 -06:00
bjorn3 f5ce77203e drivers/graphics/ihdgd: Initialize planes inside GraphicsAdapter::init 2026-03-20 23:22:17 +01:00
bjorn3 6def27936a drivers/graphics: Pass KmsCrtcState to set_crtc 2026-03-20 23:19:50 +01:00
bjorn3 925951ce85 drivers/graphics: Make KmsCrtcState::fb_id an Option 2026-03-20 23:19:50 +01:00
bjorn3 d08300c8b5 drivers/graphics: Make objects generic over GraphicsAdapter rather than specific driver data 2026-03-20 23:19:50 +01:00
bjorn3 5e7fc9d71a drivers/graphics: Remove refcounting for all KmsObject's
Doing the refcounting outside the enum doesn't allow refcounting a
downcasted object. And most objects don't need refcounting after all.
2026-03-20 23:19:50 +01:00
Jeremy Soller 3b8cb31dca Merge branch 'gpu_drm30' into 'main'
Rework how properties are defined

See merge request redox-os/base!181
2026-03-20 13:53:47 -06:00
bjorn3 781aa57e4a drivers/graphics: Fix resizing text VTs
This fixes a regression introduced in a40be7b44
2026-03-20 20:24:18 +01:00
auronandace c88ab21c3f update bitflags for xhcid 2026-03-20 12:07:36 +00:00
auronandace e054af78c0 update bitflags for ps2d 2026-03-20 11:58:53 +00:00
auronandace 6cbf83995c remove bitflags from ac97d 2026-03-20 11:55:27 +00:00
auronandace bba8eac7cb remove bitflags from ahcid 2026-03-20 11:52:15 +00:00
auronandace 7be03d1815 add bitflags to the workspace Cargo.toml 2026-03-20 08:46:28 +00:00
bjorn3 eaa390156d drivers/graphics: Split out state modified during atomic mode setting 2026-03-19 23:39:32 +01:00
bjorn3 5b88dadc4f drivers/graphics: Move connector<->crtc binding to KmsConnector
A connector can only get input from one CRTC and the CRTC_ID property is
on the connector. There is no CONNECTOR_IDS property on CRTCs.
2026-03-19 23:25:37 +01:00
bjorn3 e49dc8e8be drivers/graphics: Introduce define_object_props helper macro 2026-03-19 22:56:46 +01:00
bjorn3 dcf1e5cdd6 drivers/graphics: Derive property values from object fields 2026-03-19 22:46:44 +01:00
bjorn3 ee1b5377db drivers/graphics: Remove KmsObject and rename KmsObjectKind to KmsObject 2026-03-19 22:45:21 +01:00
bjorn3 79e9e0987d drivers/graphics: Move property values into individual objects 2026-03-19 22:26:55 +01:00
bjorn3 4ccdb59a47 drivers/graphics: Dedup property value conversion code
This will make it easier to change the way properties are represented
internally.
2026-03-19 19:45:55 +01:00
Jeremy Soller b89fbd224c Merge branch 'gpu_drm29' into 'main'
Couple of DRM property related improvements

See merge request redox-os/base!178
2026-03-18 15:38:03 -06:00
bjorn3 cd5e1ab4f4 drivers/graphics: Nicer debug printing of properties 2026-03-18 21:14:44 +01:00
bjorn3 e586c26fc7 drivers/graphics: Move enum variant fixed size name computation to property add time 2026-03-18 21:09:56 +01:00
bjorn3 919bad8f1e drivers/graphics: Replace magic constant with definition from drm-fourcc crate 2026-03-18 20:53:46 +01:00
Jeremy Soller c9692eb187 Merge branch 'gpu_drm28' into 'main'
drivers/graphics: Remove an orbclient compat hack

See merge request redox-os/base!177
2026-03-18 06:36:00 -06:00
bjorn3 89be881a08 drivers/graphics: Remove an orbclient compat hack
Orbital now handles this instead.
2026-03-17 23:04:07 +01:00
Jeremy Soller a3513ff256 Merge branch 'gpu_drm27' into 'main'
Remove last custom DRM ioctl

See merge request redox-os/base!176
2026-03-17 14:24:35 -06:00
bjorn3 cdb4ec4575 drivers/graphics: Remove unnecessary graphic-ipc dependencies
And other unnecessary dependencies. Also move all graphics-ipc contents
to the top of the crate.
2026-03-17 20:26:18 +01:00
bjorn3 09a23a3c4a drivers/graphics: Remove Damage from graphics-ipc 2026-03-17 20:19:52 +01:00
bjorn3 c4908a5114 drivers/graphics: Remove UPDATE_PLANE 2026-03-17 20:06:21 +01:00
Jeremy Soller 752213a3b5 Merge branch 'gpu_drm26' into 'main'
Implement MODE_DIRTYFB and replace UPDATE_PLANE usage in fbbootlogd and fbcond

See merge request redox-os/base!175
2026-03-17 13:02:29 -06:00
bjorn3 a40be7b446 drivers/graphics: Use set_crtc+dirtyfb in V2DisplayMap 2026-03-17 19:41:09 +01:00
bjorn3 f150813cfa drivers/graphics: Slightly encapsulate V2DisplayMap 2026-03-17 19:41:09 +01:00
bjorn3 3903fe4f5a drivers/graphics: Implement MODE_DIRTYFB 2026-03-17 19:40:41 +01:00
Jeremy Soller 7f533b52da Merge branch 'main' into 'main'
driver-graphics: MODE_SET_CRTC implementation

See merge request redox-os/base!173
2026-03-17 05:44:05 -06:00
Alexander Usenko a198776ce8 driver-graphics: MODE_SET_CRTC implementation 2026-03-17 05:44:05 -06:00
Jeremy Soller e1999171f9 Merge branch 'fix_build' into 'main'
Fix duplicate description key

See merge request redox-os/base!174
2026-03-16 17:11:53 -06:00
bjorn3 cdf810d1cd Move description for amlserde 2026-03-16 21:09:15 +01:00
bjorn3 c99d874ac4 Fix duplicate description key 2026-03-16 20:18:08 +01:00
Jeremy Soller f60cbae526 Merge branch 'add-info' into 'main'
Add missing Cargo package description and update drivers README

See merge request redox-os/base!171
2026-03-16 10:39:15 -06:00
Ribbon 90ea974ce0 Add missing Cargo package description and update drivers README 2026-03-16 10:39:15 -06:00
Jeremy Soller 4e679f03ff Merge branch 'gpu_drm14' into 'main'
Implement proper support for DRM framebuffers and nicer handling of standard DRM properties

See merge request redox-os/base!172
2026-03-15 06:55:25 -06:00
bjorn3 e27726e8c3 drivers/graphics: Remove GraphicsAdapter::display_count 2026-03-15 13:30:00 +01:00
bjorn3 93a8179d1f drivers/graphics: Remove GraphicsAdapter::display_size
It is no longer used.
2026-03-15 13:10:25 +01:00
bjorn3 460ae0d57c drivers/graphics/console-draw: Fix depth for framebuffer 2026-03-15 13:01:34 +01:00
bjorn3 d7974b3143 drivers/graphics: Nicer way to define standard properties
All standard properties are now pre-allocated at KmsObjects creation and
given a fixed object id.
2026-03-15 12:29:51 +01:00
bjorn3 be6ae85541 drivers/graphics: Implement proper support for framebuffers
Including support for creating and destroying framebuffers.
2026-03-15 11:19:59 +01:00
Jeremy Soller 27212a57f9 Merge branch 'logd_fixes' into 'main'
logd: Synchronously log to the kernel debug log

See merge request redox-os/base!170
2026-03-14 18:00:56 -06:00
bjorn3 159a09a663 logd: Synchronously log to the kernel debug log
This should not block and ensures that logs will still show up on the
serial port even if one of the log sinks blocks because for example the
graphics driver crashed, taking fbbootlogd with it. In the future we
might want to have a dedicated worker per log sink, but for now this
helps a log with debugging the graphics subsystem in a VM.
2026-03-14 22:38:39 +01:00
Jeremy Soller 75390766e2 Revert "Merge branch 'drm/set_crtc' into 'main'"
This reverts merge request !169
2026-03-14 11:51:26 -06:00
Jeremy Soller d093eca09c Merge branch 'drm/set_crtc' into 'main'
graphics-ipc: Initial implementation of SET_CRTC

See merge request redox-os/base!169
2026-03-14 11:36:50 -06:00
Meijlen e9d782cabb set_crtc realisation 2026-03-14 17:23:32 +00:00
Jeremy Soller 58a6134f28 Merge branch 'gpu_drm22' into 'main'
Various graphics subsystem improvements

See merge request redox-os/base!168
2026-03-14 09:15:44 -06:00
bjorn3 7b8ebe9dca drivers/graphics: Return size of CRTC from fpath
This is the actual size of the Orbital desktop. Previously resizing a
virtio-gpu window after Orbital started but before logging in would
cause the launcher to be out of view.
2026-03-14 16:09:46 +01:00
bjorn3 d11da9440b drivers/graphics: Fix mixup between buffers and framebuffers 2026-03-14 16:03:39 +01:00
bjorn3 359e845437 drivers/graphics: Rename buffer related fields and variables
And clarify that buffers have a separate index namespace by removing
usage of dumb_buffer_id.
2026-03-14 15:29:08 +01:00
Jeremy Soller 7c40b28ce8 Merge branch 'gpu_drm21' into 'main'
drivers/graphics: Remove UPDATE_CURSOR custom ioctl

See merge request redox-os/base!167
2026-03-14 07:34:10 -06:00
bjorn3 f6d2f2a6af drivers/graphics: Remove UPDATE_CURSOR custom ioctl
Orbital now uses MODE_CURSOR and MODE_CURSOR2 instead.
2026-03-14 14:27:44 +01:00
Jeremy Soller 6fc714cf35 Merge branch 'gpu_drm13' into 'main'
Introduce read-only CRTC objects and support proper cursor ioctls

See merge request redox-os/base!166
2026-03-14 07:19:11 -06:00
bjorn3 84f6f67a98 drivers/graphics: Implement the cursor drm ioctls 2026-03-14 14:15:13 +01:00
Jeremy Soller c243d5536f Merge branch 'gpu_drm20' into 'main'
drivers/graphics: Replace KmsObject trait with an enum

See merge request redox-os/base!165
2026-03-14 07:12:30 -06:00
bjorn3 985612d5e0 drivers/graphics: Changes to support SETCRTC in the future 2026-03-14 12:52:51 +01:00
bjorn3 63ca9efb8c drivers/graphics: Introduce CRTC objects
Currently still read-only.
2026-03-14 12:37:41 +01:00
bjorn3 fdb4d45e72 drivers/graphics: Replace KmsObject trait with an enum
The set of possible KMS object types is fixed.
2026-03-14 12:18:08 +01:00
Jeremy Soller 5e9f94b36b Merge branch 'gpu_drm19' into 'main'
drivers/graphics: Refcount all DRM objects

See merge request redox-os/base!162
2026-03-13 19:02:22 -06:00
bjorn3 20834544b7 drivers/graphics: Move KMS object handling to a submodule 2026-03-13 23:57:14 +01:00
bjorn3 977e13077d drivers/graphics: Require Debug to be implemented for Buffer 2026-03-13 23:23:16 +01:00
bjorn3 f6a7c194b2 drivers/graphics: Refcount all DRM objects
This is necessary to be able to properly handle objects that reference
each other and in doing so keep each other alive.
2026-03-13 23:23:15 +01:00
Jeremy Soller 901ec180a7 Merge branch 'gpu_drm18' into 'main'
Various DrmConnector improvements

See merge request redox-os/base!161
2026-03-13 15:31:42 -06:00
bjorn3 7f8ddd7a7e drivers/graphics: Add helpers for updating the connector state 2026-03-13 22:15:59 +01:00
bjorn3 c088e48948 drivers/graphics: Move DrmConnector and DrmEncoder to a separate module 2026-03-13 21:57:44 +01:00
bjorn3 37264a9e96 drivers/graphics: Slightly improve accuracy of connector info 2026-03-13 21:42:36 +01:00
Jeremy Soller efc2d688e3 Merge branch 'gpu_drm17' into 'main'
drivers/graphics: Unify buffer types between regular and cursor planes

See merge request redox-os/base!160
2026-03-13 14:09:35 -06:00
bjorn3 c6e479a622 drivers/graphics: Inline single call update_whole_screen method 2026-03-13 20:50:50 +01:00
bjorn3 5285281ff2 drivers/graphics: Slightly simplify add_connector 2026-03-13 20:31:47 +01:00
bjorn3 45d26b5374 drivers/graphics: Remove unnecessary object mutable accesses 2026-03-13 20:27:02 +01:00
bjorn3 d329c5b24a drivers/graphics: Allow disabling display output by setting no framebuffer 2026-03-13 19:42:17 +01:00
bjorn3 c8c5a3e240 drivers/graphics: Remove separate cursor framebuffer create/map methods 2026-03-13 19:42:17 +01:00
bjorn3 4317189d7b drivers/graphics: Unify buffer types between regular and cursor planes
Also correct the cursor size for virtio-gpu.
2026-03-13 19:42:17 +01:00
Jeremy Soller 2c8bc9bbf6 Update dependencies 2026-03-13 09:02:10 -06:00
Jeremy Soller 683b8fb74e Merge branch 'allow-skip' into 'main'
init: Allow skipping services, print service name in debug

See merge request redox-os/base!155
2026-03-12 18:46:59 -06:00
Jeremy Soller 93249717e8 Merge branch 'gpu_drm16' into 'main'
drivers/graphics: Mostly remove support for the v1 graphics api

See merge request redox-os/base!159
2026-03-12 17:00:29 -06:00
bjorn3 0d0fbd1935 drivers/graphics: Mostly remove support for the v1 graphics api
Orbclient still needs opening + fpath support for the v1 graphics api.
2026-03-12 21:40:40 +01:00
Jeremy Soller 05cf6f6814 Merge branch 'support_detecting_hwcursor' into 'main'
drivers/graphics: Support detecting hardware cursors for DRM

See merge request redox-os/base!158
2026-03-12 14:13:48 -06:00
Jeremy Soller 75b14b0891 Merge branch 'swcursor_fix_part1' into 'main'
driver/graphics: Avoid unconditionally enabling CursorPlaneHotspot

See merge request redox-os/base!157
2026-03-12 14:13:37 -06:00
bjorn3 60754b6fde drivers/graphics: Support detecting hardware cursors for DRM 2026-03-12 20:52:44 +01:00
bjorn3 d94edccf9a driver/graphics: Avoid unconditionally enabling CursorPlaneHotspot
This is necessary to fix software cursor support in Orbital.
2026-03-12 20:31:16 +01:00
Jeremy Soller 39cce0fd11 Merge branch 'orbclient_crates_io' into 'main'
Use orbclient from crates.io

See merge request redox-os/base!156
2026-03-12 12:26:05 -06:00
bjorn3 2c69d5f45f Use orbclient from crates.io 2026-03-12 19:22:09 +01:00
Wildan M 2784c98ddd init: Allow skipping services, print service name in debug 2026-03-12 21:20:04 +07:00
Jeremy Soller 725bf9f6f1 Merge branch 'gpu_drm15' into 'main'
drivers/graphics: Add framebuffer indirection to the DRM interface

See merge request redox-os/base!154
2026-03-11 18:05:43 -06:00
Jeremy Soller 26470d176e Merge branch 'fix_warnings' into 'main'
Fix a bunch of warnings

See merge request redox-os/base!153
2026-03-11 16:51:59 -06:00
bjorn3 f01d0fe8a1 drivers/graphics: Introduce UPDATE_CURSOR ioctl
Orbital needs this as we don't implement cursor planes yet.
2026-03-11 23:17:38 +01:00
bjorn3 511c6080ca drivers/graphics: Add framebuffer indirection to the DRM interface
This matches the Linux DRM interface. With this I believe the only
divergence from the Linux DRM interface that would be a breaking change
to the in-tree users of the graphics api to change to the proper
interface is the use of the UPDATE_PLANE ioctl in the place of proper
modesetting interface. It should be possible to support this in
parallel to UPDATE_PLANE, so updating Orbital to the DRM interface
should now be possible. Orbital can be updated to the proper modesetting
interface once it is implemented.
2026-03-11 22:49:19 +01:00
bjorn3 9795abb0ea Fix a bunch of warnings 2026-03-11 22:05:44 +01:00
Jeremy Soller 49ef369fed Merge branch 'ps2d-self-test' into 'main'
ps2d: disable keyboard before running self test

See merge request redox-os/base!152
2026-03-11 07:18:08 -06:00
Jeremy Soller 3ea1fbf5f7 Merge branch 'no-panic-aml' into 'main'
acpid: Do not panic on AML failure

See merge request redox-os/base!151
2026-03-11 07:16:28 -06:00
Connor-GH 15790b1e1a ps2d: disable keyboard before running self test
Beforehand, if you spammed 'enter' (or any key) upon startup, your self
test would fail with 1C or 9C (the scancodes for pressing and releasing
enter respectively). We now disable the keyboard earlier, and this fixes
the issue.
2026-03-10 14:19:11 -05:00
Wildan M 89855606c2 acpid: Do not panic on AML failure 2026-03-10 23:38:47 +07:00
Jeremy Soller 6393a33380 Merge branch 'shm_single_segment' into 'main'
ipcd: Use a single segment + mremap for shm

See merge request redox-os/base!150
2026-03-09 13:11:27 -06:00
bjorn3 53327b0969 ipcd: Use a single segment + mremap for shm
This way mmap fully functions even in the presence of growing. Fixes a
crash of Wayland applications when resizing the SHM pool.
2026-03-09 20:06:54 +01:00
Jeremy Soller 5fdc723c38 ps2d: limit mouse resets to 10 2026-03-08 20:23:09 -06:00
Jeremy Soller 683771cc3e Merge branch 'shm_fixes' into 'main'
Couple of shm fixes for Wayland

See merge request redox-os/base!149
2026-03-08 14:45:29 -06:00
bjorn3 bd6bc56d4d ipcd: Support ftruncate in shm 2026-03-08 21:42:50 +01:00
bjorn3 db4292da49 ipcd: Implement fsize for shm
To fix seek support.
2026-03-08 21:35:52 +01:00
Jeremy Soller 3338fc7708 Merge branch 'namespace_unmount' into 'main'
Support removing schemes from a namespace

See merge request redox-os/base!148
2026-03-07 14:38:40 -07:00
bjorn3 331189d846 Rustfmt 2026-03-07 22:12:56 +01:00
bjorn3 44614a0b3f Support removing schemes from a namespace
This can be done using rmdir /scheme/my_scheme. Scheme implementations
do not yet exit when all fds are closed, but you can now kill the
service and restart it after you removed its scheme.
2026-03-07 22:07:34 +01:00
Jeremy Soller be93450c91 Merge branch 'move_display_handle_create' into 'main'
Move DisplayHandle creation into GraphicsScheme::new

See merge request redox-os/base!147
2026-03-07 10:20:14 -07:00
bjorn3 48c652f5d1 Move DisplayHandle creation into GraphicsScheme::new 2026-03-07 17:49:45 +01:00
Jeremy Soller 70fe985736 Merge branch 'no_nulld' into 'main'
zerod: Don't require a copy named nulld for /dev/null

See merge request redox-os/base!146
2026-03-07 09:44:30 -07:00
bjorn3 0380521186 zerod: Don't require a copy named nulld for /dev/null
This saves 600kb on the initfs size.
2026-03-07 17:40:55 +01:00
Jeremy Soller 59cc1c30b2 Merge branch 'tidier_bootstrap_mappings' into 'main'
Tidier bootstrap memory mappings

See merge request redox-os/base!145
2026-03-07 06:32:10 -07:00
bjorn3 3a406b75e2 bootstrap: Only keep the initfs data mapped in the initfs process 2026-03-07 12:46:45 +01:00
bjorn3 ecaa58d5e5 bootstrap: Remove outdated fixme
The initfs data is already mapped as read-only by the "rest of memory"
mprotect.
2026-03-07 12:46:45 +01:00
bjorn3 a8f3e83e9d bootstrap: Map .data.rel.ro, GOT and PLT as read-only 2026-03-07 12:46:45 +01:00
Jeremy Soller 0216268ee3 Merge branch 'graphics_cleanup' into 'main'
Couple of cleanups to the graphic subsystem

See merge request redox-os/base!144
2026-03-06 14:56:37 -07:00
Jeremy Soller f6f29d8d93 Merge branch 'remove_unnecessary_patches' into 'main'
Remove no longer necessary patches

See merge request redox-os/base!143
2026-03-06 14:56:14 -07:00
bjorn3 3c79908b5a drivers/graphics: Directly pass scheme name to DisplayHandle::new 2026-03-06 22:55:50 +01:00
bjorn3 f518db3d6a drivers/inputd: Minor cleanup 2026-03-06 22:55:33 +01:00
bjorn3 bae900b79c driver/graphics: Replace direct redox_sys_call_v0 usage with libredox 2026-03-06 22:55:21 +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
Jeremy Soller fa3f4cb825 Merge branch 'bootstrap_refactors2' into 'main'
Use FdGuard in bootstrap where possible

See merge request redox-os/base!142
2026-03-06 14:29:51 -07:00
bjorn3 311e180019 bootstrap: Move scheme socket creation to spawn 2026-03-06 22:25:20 +01:00
bjorn3 b31f48cb59 bootstrap: Directly pass event cap fd to procmgr 2026-03-06 22:25:19 +01:00
bjorn3 890f325368 bootstrap: Store FdGuard's in KernelSchemeMap 2026-03-06 22:25:18 +01:00
bjorn3 b641ed3741 bootstrap: Pass proc auth FdGuard by-value 2026-03-06 22:25:16 +01:00
bjorn3 0d957f8d20 bootstrap: Return FdGuard for the scheme root in spawn 2026-03-06 22:25:14 +01:00
bjorn3 fe3f09133d bootstrap: Use FdGuard for scheme_creation_cap 2026-03-06 22:25:05 +01:00
Jeremy Soller 3eb1309923 Merge branch 'init_rework7' into 'main'
Change from push to a pull for loading units and support unit instancing

See merge request redox-os/base!141
2026-03-05 12:12:33 -07:00
bjorn3 a063db73a4 init: Support unit instancing
And use it for the logging ramfs by having a generic ramfs unit.
2026-03-05 19:42:17 +01:00
bjorn3 0869d8184c init: Nicer error handling 2026-03-05 19:41:30 +01:00
bjorn3 1424a470d3 init: Change from push to a pull for loading units
Rather than starting all services in the config dir, we only start those
which are a dependency of the target we want to reach. This is necessary
to handle unit templating, service start stop and an alternative target
for recovery or graceful shutdown.
2026-03-04 21:55:11 +01:00
bjorn3 7cea939540 init: Switch root upon reaching initfs.target 2026-03-04 21:53:48 +01:00
Jeremy Soller c4e3a7e98f Merge branch 'init_rework6' into 'main'
Migrate the entire initfs to service definitions

See merge request redox-os/base!140
2026-02-28 09:07:13 -07:00
bjorn3 6d243d666c init: Convert rootfs to a service
With this the entire initfs now uses service definitions.
2026-02-28 17:03:25 +01:00
bjorn3 e86dbfa17e Init: Introduce support for conditionally spawning services
depending on the architecture and selected board. With this the
migration of initfs daemons to service definitions is almost done.
2026-02-28 16:55:26 +01:00
Jeremy Soller 352d90332f Use libredox::protocol in ipcd and netstack 2026-02-28 08:20:24 -07:00
Jeremy Soller 7c1a183b12 Merge branch 'base-stdfscall' into 'main'
feat: Implement std_fs_call handling to initfs, ramfs, acpi and xhci

See merge request redox-os/base!134
2026-02-28 08:15:16 -07:00
Ibuki Omatsu 2738f69224 feat: Implement std_fs_call handling to initfs, ramfs, acpi and xhci 2026-02-28 08:15:16 -07:00
Jeremy Soller 9624cd3c2c Merge branch 'serde-toml' into 'main'
make serde and toml workspace dependencies

See merge request redox-os/base!139
2026-02-27 06:19:36 -07:00
auronandace 7849aa23b3 make serde and toml workspace dependencies 2026-02-27 08:39:29 +00:00
Jeremy Soller 3a94262aff Downgrade scheme not found log level to info 2026-02-26 10:00:39 -07:00
Jeremy Soller e9e514efce Merge branch 'init_rework5' into 'main'
Convert all service definitions to toml

See merge request redox-os/base!138
2026-02-26 09:56:59 -07:00
bjorn3 124f11bde1 init: Convert all service definitions to toml 2026-02-26 17:41:39 +01:00
bjorn3 a7ee3a2364 Update to toml 1.0 2026-02-26 17:28:12 +01:00
Jeremy Soller 34acae8990 Merge branch 'fix_bootlog' into 'main'
Add missing vesad dependency to fbbootlogd

See merge request redox-os/base!137
2026-02-26 09:04:21 -07:00
bjorn3 a5041f7d7a init: Add missing vesad dependency to fbbootlogd 2026-02-26 17:03:14 +01:00
Jeremy Soller f5219072e4 Merge branch 'init_rework4' into 'main'
Convert 10_logging, 20_graphics and 30_live to services

See merge request redox-os/base!136
2026-02-26 08:50:52 -07:00
bjorn3 4f90c249ff init: Fix some issues in driver configs for arm64
Remove an unnecessary unset, remove a duplicate hwd spawn and update
requires_weak dependencies.
2026-02-26 16:46:29 +01:00
bjorn3 3d2951a23d init: Convert vesad, fbbootlogd and fbcond to services 2026-02-26 16:38:56 +01:00
bjorn3 e55bd17530 drivers/graphics: Fix a couple of warnings 2026-02-26 16:23:32 +01:00
bjorn3 31489ce7ca init: Convert inputd and lived to services 2026-02-26 16:03:41 +01:00
bjorn3 72b96695b0 init: Add a couple of service descriptions 2026-02-26 15:38:14 +01:00
bjorn3 fb051cd486 init: Special case logd
Logd is a special case. Every other service effectively has an implicit
dependency on it for sending log messages to it and even init itself
depends on it for it's own log messages.
2026-02-26 15:18:19 +01:00
Jeremy Soller e46bfb0005 Merge branch 'er' into 'main'
fix: add descriptive error messages for -K flag

See merge request redox-os/base!135
2026-02-26 06:38:14 -07:00
Jeremy Soller 1bcf92eba9 Merge branch 'cwd-fd' into 'main'
feat: Pass initial cwd fd to init

See merge request redox-os/base!131
2026-02-26 06:36:30 -07:00
Ibuki Omatsu ac3d816672 feat: Pass initial cwd fd to init 2026-02-26 06:36:30 -07:00
nekluu 49f000a3ed fix: add descriptive error messages for -K flag 2026-02-26 16:23:22 +03:00
Jeremy Soller 75b9f07a92 Merge branch 'init_rework3' into 'main'
Introduce dependency handling to init

See merge request redox-os/base!133
2026-02-25 15:02:54 -07:00
bjorn3 bb2a00114f init: Introduce dependency handling 2026-02-25 22:43:11 +01:00
bjorn3 6fcb07e7dd init: Introduce UnitStore
This will be necessary to store persistent information about units like
if they are currently started and which process is associated with them.
2026-02-25 22:06:25 +01:00
bjorn3 73cc0b0a07 init: Begin introducing units
Dependencies are not yet functional.
2026-02-25 20:57:47 +01:00
bjorn3 f364bf1f60 init: Introduce a json format for services
While I would have like to use toml, something inside the toml crate
seems to be using randomness, which is not yet available when init
starts.
2026-02-25 20:18:42 +01:00
Jeremy Soller a7cb911864 Update libc, patch rustix, and cargo update 2026-02-20 14:04:49 -07:00
Jeremy Soller 403fddab68 Merge branch 'precedence' into 'main'
add clippy precedence lint

See merge request redox-os/base!132
2026-02-20 08:55:01 -07:00
auronandace 4e77bb0f96 add precedence lint to drivers 2026-02-20 15:00:43 +00:00
auronandace 5ffce47607 add clippy precedence lint 2026-02-20 13:43:48 +00:00
bjorn3 4e772728ad init: Introduce Service type
A future commit will use it to define services in toml format.
2026-02-19 22:18:29 +01:00
bjorn3 c9d691fa29 init: Remove export and unset commands
They manipulate global state and none of the init scripts use them anymore.
2026-02-19 21:57:45 +01:00
Jeremy Soller 35af6f9672 Merge branch 'init_rework2' into 'main'
Reduce global state manipulation in init

See merge request redox-os/base!130
2026-02-19 13:54:52 -07:00
bjorn3 0f0f12fb12 graphics/vesad: Fix multi-monitor support 2026-02-19 21:49:21 +01:00
Jeremy Soller a8e9a5e73b ipcd: use first segment size for limits of mmap 2026-02-19 13:23:35 -07:00
bjorn3 87abd3fb70 init: Maintain default service env vars separate from init env vars
With this only the env vars set using export or explicitly specify for a
service are passed to services (in addition to RUST_BACKTRACE, PATH and
LD_LIBRARY_PATH). As such we no longer need to manually unset bootloader
env vars to keep the environment clean. And finally this means that env
var substitutions in shell scripts always use the bootloader provided
env vars rather than locally specified ones.

This does regress multi monitor support when there is no proper graphics
driver.
2026-02-19 21:06:53 +01:00
Jeremy Soller c2c7020063 ipcd: block uds stream connect until accept 2026-02-19 12:56:23 -07:00
bjorn3 b7524c3a65 init: Allow passing env vars to individual services 2026-02-19 20:50:48 +01:00
bjorn3 029f56eebe init: Remove cd command
The working directory doesn't matter for services and login sessions
already cd to the user home directory. This removes one source of global
state manipulation.
2026-02-19 20:26:51 +01:00
bjorn3 0227c0677c init: Introduce switchroot command
This sets PATH, LD_LIBRARY_PATH and runs init scripts for the new root.
In the future this could replace the entire set of services that should
run, restarting any services for which a newer executable is available
in the new root and stopping any services which don't exist in the new
root. This behavior could also be useful for soft-reboots in the future
to handle updates without rebooting the entire system.
2026-02-19 20:18:07 +01:00
Jeremy Soller a5168828ad Merge branch 'dyn-shm' into 'main'
ipcd: Allow non contiguous shm allocation

See merge request redox-os/base!129
2026-02-19 11:00:05 -07:00
Wildan M 2875e8f26e ipcd: Allow non contiguous shm allocation 2026-02-19 13:19:39 +07:00
Jeremy Soller fc162ac4cf Merge branch 'init_rework' into 'main'
Begin moving towards a more declarative init

See merge request redox-os/base!128
2026-02-18 14:47:09 -07:00
bjorn3 dfee8f50d7 ps2d: Fix warnings 2026-02-18 22:41:05 +01:00
bjorn3 7ebeceb41d init: Allow init to register the scheme for a daemon
Unfortunately the scheme still has to be created by the daemon due to a
kernel bug, but once that is fixed, it would allow delayed spawning of
scheme daemons.
2026-02-18 22:40:09 +01:00
bjorn3 7dad7af1f0 init: Explicitly specify LD_LIBRARY_PATH in init scripts 2026-02-18 21:46:08 +01:00
bjorn3 2d071a5b75 init: Separate init script parsing and executing
And remove the run command and eagerly apply env var subsitution before
execution.
2026-02-18 21:46:02 +01: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
Jeremy Soller aceeef5bae Merge branch 'initfs_cleanups' into 'main'
A bunch of initfs cleanups

See merge request redox-os/base!126
2026-02-17 15:20:42 -07:00
bjorn3 b997641418 Split up init.rc 2026-02-17 22:26:04 +01: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 200ba82e57 initfs: Actually use Length newtype 2026-02-17 20:57:11 +01:00
bjorn3 7248eda128 initfs: Remove unused function 2026-02-17 20:57:11 +01:00
bjorn3 0e0287cb6d initfs: Use fixed modes for inode types
This also ensures that the write bit is never set and the execute bit
is always set for directories.
2026-02-17 20:57:10 +01:00
bjorn3 c028c49c55 initfs: Symlinks should be resolved relative to symlink parent 2026-02-17 20:54:53 +01:00
bjorn3 fc4b48df67 initfs: Fix stat for symlinks 2026-02-17 20:54:47 +01:00
bjorn3 f0413aec8e initfs: Fill in st_ino
Otherwise ls and other tools will think they have already visited a
directory when recursively enumerating all files.
2026-02-17 20:54:40 +01:00
bjorn3 edd1c249e9 initfs: Remove uid and gid fields for inodes
The initfs creation code always puts 0 in them.
2026-02-17 20:54:35 +01:00
bjorn3 3e62ff9ec7 initfs: Use CARGO_TARGET_TMPDIR in test 2026-02-17 20:54:30 +01:00
bjorn3 223b497234 initfs: Make redox-initfs library unconditionally no_std 2026-02-17 20:54:19 +01:00
bjorn3 c611054bbd initfs: Move archive-common package into initfs-tools 2026-02-17 20:54:10 +01:00
Jeremy Soller 5c1f034a27 Merge branch 'fix-initfs-debug-space' into 'main'
Fix initfs space insufficient issue

See merge request redox-os/base!119
2026-02-17 07:54:12 -07:00
Jeremy Soller 4c8727ed40 Merge branch 'main' into 'main'
misc(Cargo.lock): bump `redox-rt`

See merge request redox-os/base!125
2026-02-16 07:17:44 -07:00
Anhad Singh fff728c5e5 misc(Cargo.lock): bump redox-rt
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2026-02-17 01:03:09 +11:00
Jeremy Soller ab432bab63 Merge branch 'fix_arm64_init_drivers' into 'main'
Fix init_drivers.rc for arm64

See merge request redox-os/base!124
2026-02-14 10:42:14 -07:00
bjorn3 d92b911376 Fix init_drivers.rc for arm64
Fix the path passed to pcid-spawner to match the x86_64 version.
2026-02-14 17:29:56 +01:00
Jeremy Soller 4788db00de Update redox-syscall and redox-scheme for stdfscall 2026-02-11 12:21:35 -07:00
Jeremy Soller 58832cd89f Merge branch 'minor-cleanup' into 'main'
minor cleanup in ptyd

See merge request redox-os/base!122
2026-02-10 06:03:42 -07:00
auronandace 98a2516dd2 minor cleanup in ptyd 2026-02-10 10:01:32 +00:00
Jeremy Soller 0c3936760d Merge branch 'ps2d-panic' into 'main'
ps2d: Don't crash on keyboard scan init

See merge request redox-os/base!120
2026-02-09 20:22:16 -07:00
Wildan M 20eae1f054 ps2d: Don't crash on keyboard scan init 2026-02-10 00:10:21 +07:00
April Grimoire 2c11d1aee6 Fix initfs space insufficient issue
Credit: willnode

Increase initfs space under debug mode from 128MiB to 256MiB.
The old size causes build failure.
2026-02-09 22:56:55 +08:00
Jeremy Soller f08f60dc51 Merge branch 'virtio-sdl-fix' into 'main'
virtio-gpud: Don't crash on no edid descriptor

See merge request redox-os/base!118
2026-02-08 07:37:40 -07:00
Wildan M 36e2fbd537 virtio-gpud: Don't crash on no edid descriptor 2026-02-08 15:50:58 +07:00
Jeremy Soller e79dd0a59b Merge branch 'bootstrap_refactors' into 'main'
Improve IO safety of bootstrap

See merge request redox-os/base!117
2026-02-07 12:33:56 -07:00
bjorn3 9ec0733951 bootstrap: Move computation of schemes from initnsmgr to main 2026-02-07 20:32:09 +01:00
bjorn3 a04626044e bootstrap: Use FdGuard inside initnsmgr 2026-02-07 20:06:06 +01:00
bjorn3 029e3a48e2 bootstrap: Use FdGuard for sync_pipe 2026-02-07 20:06:06 +01:00
bjorn3 c0c002bfbc bootstrap: Remove Arc around KernelSchemeMap 2026-02-07 20:06:02 +01:00
Jeremy Soller 4a4b890c76 Merge branch 'update_pci_types' into 'main'
Update to pci_types 0.10.1

See merge request redox-os/base!116
2026-02-07 10:07:12 -07:00
bjorn3 7f0e870b76 Update to pci_types 0.10.1
And avoid hiding channel open errors in pcid-spawner. This would have
made the location of the problem more obvious.
2026-02-07 18:02:32 +01:00
Jeremy Soller f2ffbf1eb5 Merge branch 'pin-pci_types-0.10.0' into 'main'
chore: Pin pci_types version to 0.10.0.

See merge request redox-os/base!115
2026-02-07 07:00:17 -07:00
Jeremy Soller 06bda5dabf Merge branch 'gpu_drm12' into 'main'
Couple of ihdgd cleanups and use upstream rustix

See merge request redox-os/base!114
2026-02-07 06:58:31 -07:00
Ibuki.O 22ab1e7878 chore: Pin pci_types version to 0.10.0. 2026-02-07 22:56:50 +09:00
Jeremy Soller 57449fc0a9 Merge branch 'procmgr_cleanups' into 'main'
Couple of procmgr cleanups

See merge request redox-os/base!113
2026-02-07 06:56:33 -07:00
bjorn3 c6f564e651 Use upstream rustix
Rustix 1.1.3 supports ioctls on Redox OS.
2026-02-07 13:18:48 +01:00
bjorn3 6c01349bf4 drivers/graphics/ihdgd: Fix a warning 2026-02-07 13:18:48 +01:00
bjorn3 3d82140155 drivers/graphics/ihdgd: Minor EDID reading improvements
* Enable unproven feature of embedded-hal. We depend on it. Currently it
  gets implicitly enabled by bitbang-hal.
* Reduce nesting in probe_edid
2026-02-07 13:18:46 +01:00
bjorn3 842855e26f Fix /scheme/proc/ps header 2026-02-07 12:32:52 +01:00
bjorn3 9e28791c2b Fix a couple of warnings 2026-02-07 12:19:41 +01:00
Jeremy Soller e9f414bea6 Merge branch 'remove_rens' into 'main'
Remove setrens handling and the rns/ens process fields

See merge request redox-os/base!111
2026-02-06 14:01:10 -07:00
bjorn3 a40955bb80 Remove setrens handling and the rns/ens process fields
It is no longer used due to the capability rework.
2026-02-06 21:59:17 +01:00
Jeremy Soller b1cced329c Merge branch 'uds-preaccept' into 'main'
ipcd: Allow data transfer before accept

See merge request redox-os/base!110
2026-02-06 08:39:05 -07:00
Wildan M 99c3193764 ipcd: Allow data transfer before accept 2026-02-06 14:03:08 +07:00
4lDO2 c6f5703313 Fix typo causing rt signals not to wakeup thread. 2026-02-05 15:13:47 +01:00
Jeremy Soller cac7266a54 Merge branch 'fix-udp-dup' into 'main'
Return EADDRNOTAVAIL in UDP scheme if dup called with unspecified address

See merge request redox-os/base!109
2026-02-04 06:19:08 -07:00
Bendeguz Pisch 05d01a9351 Return EADDRNOTAVAIL in UDP scheme if dup called with unspecified address 2026-02-04 10:35:27 +01:00
Jeremy Soller f5e177cb1b Merge branch 'ptyd-cast' into 'main'
prefer from instead of as cast

See merge request redox-os/base!108
2026-02-03 16:51:37 -07:00
auronandace af14ff0597 prefer from instead of as cast 2026-02-03 20:30:31 +00:00
4lDO2 ebf4c4185a Fix sigqueue limit off-by-one, rustfmt. 2026-02-01 13:13:21 +01:00
Jeremy Soller 19c71bba06 xhcid: remove unnecessary eprintln 2026-01-29 11:20:18 -07:00
Jeremy Soller 3d56a47aeb xhcid: reduce logging 2026-01-29 11:02:13 -07:00
Jeremy Soller a58f9b9ae8 ps2d: format 2026-01-29 11:01:21 -07:00
Jeremy Soller 7ae1a61d0e usbhidd: use anyhow for error handling 2026-01-29 10:52:17 -07:00
Jeremy Soller 2d672b7cd9 Add anyhow to workspace 2026-01-29 10:47:45 -07:00
Jeremy Soller c1a2c567e2 init_drivers.rc: remove unused ps2d argument 2026-01-29 10:35:57 -07:00
Jeremy Soller ed3a696873 init.rc: Activate framebuffer log VT 2026-01-29 10:35:43 -07:00
Jeremy Soller 65966e9371 ps2d: add missing TouchpadCommand enum 2026-01-29 08:56:42 -07:00
Jeremy Soller ce9c2a1fb4 ps2d: add MouseTx abstraction and WIP touchpad identification 2026-01-29 08:56:00 -07:00
Jeremy Soller 3edfd63eec ihdgd: use default output level 2026-01-29 08:53:45 -07:00
Jeremy Soller d11fd0c6ca Merge branch 'ps2-qemu' into 'main'
Workaround PS/2 mouse init timeout

See merge request redox-os/base!107
2026-01-29 06:26:39 -07:00
Wildan M ac1f3c7f6e Workaround PS/2 mouse init timeout 2026-01-29 15:24:56 +07:00
Jeremy Soller 64a1039873 Merge branch 'init_daemonize' into 'main'
Let init handle daemonization

See merge request redox-os/base!106
2026-01-26 13:54:25 -07:00
bjorn3 6096fffe5d Let init handle daemonization
This way init can track the lifecycle of services in the future. It may
also help with parallel booting in the future.
2026-01-26 21:51:14 +01:00
Jeremy Soller db78254203 Only init mouse when vmmouse not detected 2026-01-25 20:19:42 -07:00
Jeremy Soller 68c732b438 Merge branch 'usbhid-enh' into 'main'
usbhidd: Adjust logs, add mouse filter to prevent jumps

See merge request redox-os/base!105
2026-01-25 13:55:57 -07:00
Jeremy Soller aed1b25403 Merge branch 'remove_alxd' into 'main'
Remove alxd

See merge request redox-os/base!104
2026-01-25 13:52:42 -07:00
bjorn3 ea96a9a697 Remove alxd
It hasn't been in a functional state for years.
2026-01-25 20:56:11 +01:00
Jeremy Soller 8da3a40bc0 Merge branch 'support_dylink_initfs' into 'main'
Support dynamic linking in initfs

See merge request redox-os/base!103
2026-01-25 12:47:19 -07:00
Jeremy Soller d9e5b0c326 Merge branch 'move_common_init' into 'main'
Move common::init call into pcid_interface::pci_daemon

See merge request redox-os/base!102
2026-01-25 12:46:46 -07:00
bjorn3 686b052dea Support dynamic linking in initfs
With this the only changes necessary to dynamically link the initfs are
in the build recipe.
2026-01-25 20:25:01 +01:00
bjorn3 fc1c391340 Move common::init call into pcid_interface::pci_daemon 2026-01-25 20:08:49 +01:00
Jeremy Soller f2723badb5 Merge branch 'ps2-mouse-refactor' into 'main'
PS2 mouse refactor

See merge request redox-os/base!100
2026-01-25 10:07:58 -07:00
Jeremy Soller 511d446993 PS2 mouse refactor 2026-01-25 10:07:58 -07:00
Jeremy Soller 10dd00f0cb Merge branch 'getsockopt' into 'main'
netstack: Add GetSockOpt

See merge request redox-os/base!101
2026-01-25 08:56:57 -07:00
Akshit Gaur c480fa6362 netstack: Add GetSockOpt 2026-01-25 21:12:09 +05:30
Wildan M 7bfcda6ffd usbhidd: Adjust logs, add mouse filter to prevent jumps 2026-01-25 21:14:59 +07:00
Jeremy Soller b7f4212414 Merge branch 'init-opts' into 'main'
init: Add log and skip options

See merge request redox-os/base!99
2026-01-23 11:30:46 -07:00
Jeremy Soller 971d3dd9d1 Merge branch 'fbcond-err' into 'main'
fbcond: Do not panic on absent display

See merge request redox-os/base!98
2026-01-23 10:04:17 -07:00
Jeremy Soller 8f97fd64ee usbhidd: spin instead of sleep for better throughput 2026-01-22 19:21:13 -07:00
Jeremy Soller d7303832b1 Fix usb error message typo 2026-01-22 14:54:38 -07:00
Jeremy Soller 5223fe351c ihdgd: call common::init 2026-01-22 14:50:32 -07:00
Jeremy Soller 5b675c3c9a init: print errors to stderr 2026-01-22 14:50:11 -07:00
Wildan M b0d9f8114a bootstrap: Quote scheme log 2026-01-23 02:25:51 +07:00
Wildan M f24affc111 init: Add log and skip options 2026-01-23 02:25:07 +07:00
Wildan M 7a350efae4 Fix fmt 2026-01-23 01:13:41 +07:00
Wildan M 84d5dae607 fbcond: Do not panic on absent display 2026-01-23 01:03:05 +07:00
Jeremy Soller a53f915ba9 Merge branch 'virtio-disk-memory_root_fd' into 'main'
fix: Retrieve memory root FD to enable memory access for virtio-blkd

See merge request redox-os/base!97
2026-01-22 07:36:03 -07:00
Ibuki.O 36e957e7b0 chore: Improve error message when memory root fd is not initialized. 2026-01-22 14:17:16 +09:00
Ibuki.O bc6ad8c5f7 fix: Call common::init in virtio-blkd main. 2026-01-22 13:34:14 +09:00
Ibuki.O 5b336e9d5e chore: Update error log when memory root fd is not initialized in drivers common. 2026-01-22 13:29:42 +09:00
Jacob Lorentzon 900bbabda5 Merge branch 'initnsmgr-fstat' into 'main'
feat: Implement fstat handling in nsmgr.

See merge request redox-os/base!96
2026-01-21 12:10:38 +01:00
Ibuki.O 34d337fedb feat: Implement fstat handling in nsmgr. 2026-01-21 19:18:47 +09:00
Jeremy Soller 53f194d668 Merge branch 'bootstrap-redox-rt' into 'main'
chore: Use redox-rt from upstream in bootstrap.

See merge request redox-os/base!95
2026-01-20 21:22:09 -07:00
Ibuki.O 914645baea chore: Use redox-rt from upstream in bootstrap. 2026-01-21 13:19:28 +09:00
Jeremy Soller 40055bd8f9 Merge branch 'namespace-improvement' into 'main'
feat: Introduce userspace namespace manager and adapt all schemes.

See merge request redox-os/base!80
2026-01-20 20:56:58 -07:00
Ibuki Omatsu 334928f151 feat: Introduce userspace namespace manager and adapt all schemes. 2026-01-20 20:56:58 -07:00
Jeremy Soller 1753859f75 Merge branch 'workspace-depends' into 'main'
Use workspace dependencies for many common crates

See merge request redox-os/base!94
2026-01-20 10:49:24 -07:00
Jeremy Soller ceebc93762 Set log dependency to workspace in netstack 2026-01-20 10:47:08 -07:00
Jeremy Soller 9b2b0d4930 Downgrade fdt to fix CI failure 2026-01-20 10:38:12 -07:00
Jeremy Soller f740b61774 Use workspace dependencies for many common crates 2026-01-20 10:12:08 -07:00
Jeremy Soller fdeea3c4b2 Merge branch 'fix-shutdown-regression' into 'main'
Fix 'shutdown' regression

See merge request redox-os/base!93
2026-01-19 13:53:16 -07:00
Connor-GH 0580c2c761 Fix 'shutdown' regression
We did not update the relibc version needed for redox-rt or generic-rt.
Additionally, base @6b9593946 was missing an updated callsite for
`can_recv()`.
2026-01-19 14:45:19 -06:00
Jeremy Soller 795952adac Merge branch 'udp-packet-filtering' into 'main'
Add UDP Packet Filtering to netstack

See merge request redox-os/base!90
2026-01-19 10:06:45 -07:00
Akshit Gaur af908029f8 Add UDP Packet Filtering to netstack 2026-01-19 10:06:45 -07:00
Jeremy Soller 72d842ffd8 Merge branch 'shutdown' into 'main'
netstack: Add shutdown syscall

See merge request redox-os/base!92
2026-01-19 09:39:44 -07:00
Akshit Gaur 557491b5e3 netstack: Add shutdown syscall 2026-01-19 22:06:15 +05:30
Jeremy Soller 41659cce0f Merge branch 'uds-hanging' into 'main'
Unblock connect(), allow getpeername while connecting

See merge request redox-os/base!91
2026-01-15 14:25:41 -07:00
Wildan M 58cdb72051 uds: Fix accept blocking 2026-01-15 12:28:35 +07:00
Wildan M 05b83ae9c8 uds: merge two connect impl 2026-01-15 11:20:57 +07:00
Wildan M 5b06aa1439 Fixes for socketpair wouldblock 2026-01-15 10:44:51 +07:00
Wildan M 7efad0a989 uds: Unblock accept(), allow getpeername while connecting 2026-01-15 03:36:33 +07:00
Ribbon a558a9e0ce COMMUNITY-HW.md: small improvements and fixes 2026-01-14 14:45:44 -03:00
Jeremy Soller 4c99d06506 Merge branch 'inputd-keymap' into 'main'
Implement keymap to inputd

See merge request redox-os/base!89
2026-01-14 06:30:59 -07:00
Wildan M 3d04f523b4 inputd: Implement keymap 2026-01-14 11:35:48 +07:00
Jeremy Soller 9581b8e526 Merge branch 'ps2-init-refactor' into 'main'
Make ps2 init logs useful

See merge request redox-os/base!88
2026-01-13 06:35:42 -07:00
Wildan M fd84f1d0fe Make ps2 init logs useful 2026-01-13 05:35:04 +07:00
Jeremy Soller 6091b46620 Merge branch 'boot-log-level' into 'main'
Make boot log level adjustable

See merge request redox-os/base!87
2026-01-10 08:17:27 -07:00
Wildan M d08c6cbe6f Split driver log level env 2026-01-10 06:35:06 +07:00
Wildan M 992b856d66 Make boot log level adjustable 2026-01-10 04:58:11 +07:00
Jeremy Soller 214ee1a532 Merge branch 'ipcd-setsockopt' into 'main'
ipcd: temporarily allow setsockopt SO_SNDBUF

See merge request redox-os/base!86
2026-01-08 18:44:20 -07:00
Jeremy Soller 52fe7cd9a1 Merge branch 'revert-6dddb01d' into 'main'
Revert "Use atomic counter in UDS to avoid race condition"

See merge request redox-os/base!81
2026-01-08 18:43:51 -07:00
Jeremy Soller bd0c609756 Merge branch 'netstack-setsockopt' into 'main'
netstack: Temporarily fix EBADF from setsockopt

See merge request redox-os/base!85
2026-01-08 18:43:10 -07:00
Jeremy Soller 667d8bd390 Merge branch 'netstack-syscall' into 'main'
netstack: Handle SYS_CALL

See merge request redox-os/base!84
2026-01-08 08:52:01 -07:00
Jeremy Soller c7d46adc76 Merge branch 'udp-resolv' into 'main'
Fix UDP resolving connection

See merge request redox-os/base!83
2026-01-08 06:09:43 -07:00
Wildan M 2818310738 ipcd: temporarily allow setsockopt SO_SNDBUF 2026-01-08 05:58:29 +07:00
Wildan M b9eea683c0 netstack: Temporarily fix EBADF from setsockopt 2026-01-08 05:03:40 +07:00
Wildan M 385f82c777 netstack: Handle SYS_CALL 2026-01-08 04:00:07 +07:00
Wildan M 808fa3b765 Update TCP fpath 2026-01-07 22:53:07 +07:00
Wildan M f5fb58a55b Fix UDP resolving connection 2026-01-07 22:49:28 +07:00
Wildan Mubarok 648753bb9b Revert "Use atomic counter in UDS to avoid race condition"
This reverts commit 6dddb01d63
2026-01-01 11:38:22 +00:00
Jeremy Soller 1cd9ff9103 ihdgd: fix surface allocation on cards with more than 4 GiB 2025-12-31 10:28:19 -07:00
Jeremy Soller cad42ae301 Merge branch 'audio_drivers_write_response' into 'main'
fix: Write responses after polling requests in audio and net drivers.

See merge request redox-os/base!79
2025-12-24 06:33:59 -07:00
Ibuki Omatsu e405b11d43 fix: Write responses after polling requests in audio and net drivers. 2025-12-24 06:33:59 -07:00
Jeremy Soller 91dc324ed2 Merge branch 'gpu_drm11' into 'main'
Various graphics infrastructure refactorings and fix ihdgd when BIOS data can't be mapped

See merge request redox-os/base!78
2025-12-22 06:41:27 -07:00
bjorn3 d76d583048 drivers/graphics/ihdgd: Don't fail when physmap of the BIOS region fails 2025-12-22 12:32:42 +01:00
bjorn3 f9fa43df40 drivers/graphics/ihdgd: Move I2cBB creation to GpioPort 2025-12-22 12:32:42 +01:00
bjorn3 a4a0fbd198 drivers/graphics/ihdgd: Move edid probing into ddi.rs 2025-12-22 11:48:47 +01:00
bjorn3 ff3cb3ce64 drivers/graphics/virtio-gpud: Poor attempt at parsing the EDID data 2025-12-22 11:30:02 +01:00
bjorn3 d5cf3db428 drivers/graphics: Move handling of properties to a separate file 2025-12-22 10:48:35 +01:00
bjorn3 461b8d6706 drivers/graphics: Introduce DrmObject trait to reduce code duplication 2025-12-22 10:48:35 +01:00
Jeremy Soller adfe27cf34 Merge branch 'gpu_drm10' into 'main'
Begin supporting DRM object properties

See merge request redox-os/base!77
2025-12-21 14:02:36 -07:00
bjorn3 510d3576df driver/graphics: Add support for blob properties
And support fetching the EDID in virtio-gpud.
2025-12-21 21:56:35 +01:00
bjorn3 13f8b090cf driver/graphics: Initial support for object properties
No support for writing property values or reading blob properties yet.
2025-12-21 21:56:30 +01:00
bjorn3 3f982185f2 Update redox-ioctl 2025-12-21 21:55:47 +01:00
Jeremy Soller c15b0f31bb Merge branch 'gpu_drm9' into 'main'
Introduce DrmObjects and track connectors and encoders using it

See merge request redox-os/base!76
2025-12-20 13:02:48 -07:00
bjorn3 15fb94aabb driver/graphics: Ensure determinstic iteration order for resources 2025-12-20 20:57:47 +01:00
bjorn3 521fd433b9 driver/graphics: Implement Debug for a bunch of things 2025-12-20 20:39:24 +01:00
bjorn3 090a63d5c6 drivers/graphics: Only pass driver data to add_connector
And instead fill out the rest of DrmConnector in probe_connector.
2025-12-20 20:25:29 +01:00
bjorn3 816d661c9d drivers/graphics: Implement force probing of connectors in virtio-gpud 2025-12-20 20:24:04 +01:00
Jeremy Soller 866e2e7222 Merge branch 'gpu_drm8' into 'main'
Update redox-ioctl

See merge request redox-os/base!75
2025-12-20 09:06:55 -07:00
bjorn3 0e98a36495 drivers/graphics: Introduce DrmObjects and track connectors and encoders using it 2025-12-20 16:36:55 +01:00
bjorn3 40510aa759 Update redox-ioctl 2025-12-20 16:31:49 +01:00
Jeremy Soller b1c95d31e7 ihdgd: start parsing BIOS tables 2025-12-19 08:15:06 -07:00
Ribbon 499b26e6a4 Some improvements and fixes to the drivers README 2025-12-18 18:41:06 -03:00
Jeremy Soller 9600238eab Merge branch 'misc_graphics_changes' into 'main'
Misc graphics subsystem changes

See merge request redox-os/base!74
2025-12-18 13:28:12 -07:00
bjorn3 c46d5dea7a drivers/graphics/fbbootlogd: Reduce flickering while scrolling 2025-12-18 21:12:19 +01:00
bjorn3 aa0373af61 drivers/graphics: Move dumb buffer creation into console-draw 2025-12-18 20:49:17 +01:00
bjorn3 fe383e5ee0 drivers/graphics: Exclusively use V2DisplayMap in the public api of console-draw 2025-12-18 20:39:31 +01:00
Jeremy Soller ebf3680dae Merge branch 'ihdgd_cleanup' into 'main'
drivers/graphics/ihdgd: Fix a bunch of warnings

See merge request redox-os/base!73
2025-12-18 12:17:42 -07:00
bjorn3 03783e61e9 drivers/graphics: Move DisplayMap to console-draw
And inline a bunch of V2GraphicsHandle methods
2025-12-18 20:17:21 +01:00
Jeremy Soller 0fee261866 Allow reading PCI ROM address and size 2025-12-18 12:15:23 -07:00
bjorn3 123fe53c5d driver/graphics/graphics-ipc: Remove most helpers for the v1 api
They aren't used within this repo and orbital has it's own copy of the
rest.
2025-12-18 20:14:12 +01:00
bjorn3 2422b3860c drivers/graphics/ihdgd: Fix a bunch of warnings 2025-12-18 19:58:41 +01:00
Jeremy Soller 5b4a664111 cargo fmt 2025-12-18 11:04:56 -07:00
Jeremy Soller 9ea76934e0 Merge branch 'ihdgd' into 'main'
ihdgd driver

See merge request redox-os/base!46
2025-12-18 10:49:38 -07:00
Jeremy Soller c49075a3be Disable usbscsid until it is more reliable 2025-12-18 10:48:06 -07:00
Jeremy Soller c772ba8924 ihdgd driver 2025-12-18 10:48:05 -07:00
Jeremy Soller 2ed4eb92b2 Merge branch 'gpu_drm7' into 'main'
Mostly use drm ioctls in graphics_ipc::v2

See merge request redox-os/base!72
2025-12-18 06:33:29 -07:00
bjorn3 a4a5d86efa drivers/graphics: Use drm dumb buffer ioctls 2025-12-18 10:36:37 +01:00
bjorn3 e8bf0d180b drivers/graphics: Use DRM_IOCTL_MODE_GETCONNECTOR for getting display size in graphics-ipc 2025-12-18 10:36:29 +01:00
bjorn3 ac5a73210c Switch back to redox-os/relibc for redox-ioctl 2025-12-18 10:35:28 +01:00
Jeremy Soller 72317a4451 Merge branch 'ramfs-unlinkat' into 'main'
refactor: Replace unlink and rmdir with unlinkat in ramfs. Update redox-scheme and redox-rt for bootstrap.

See merge request redox-os/base!65
2025-12-17 18:46:06 -07:00
Ibuki Omatsu 3681e1b74a refactor: Replace unlink and rmdir with unlinkat in ramfs. Update redox-scheme and redox-rt for bootstrap. 2025-12-17 18:46:05 -07:00
Jeremy Soller 7ff1d4546d Merge branch 'p3' into 'main'
fix(bootstrap/procmgr): on child exit, do not set `stop_or_continue` when sending `SIGCHLD`

See merge request redox-os/base!71
2025-12-16 20:32:54 -07:00
Anhad Singh 106c078923 fix(bootstrap/procmgr): on child exit, do not set stop_or_continue
when sending `SIGCHLD`

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2025-12-17 14:29:52 +11:00
Ribbon 747d24ece0 Add a driver licensing note 2025-12-16 21:46:18 -03:00
Ribbon 723364cb45 Improve, update and remove unnecessary READMEs 2025-12-16 21:34:36 -03:00
Jeremy Soller e3c90a6f04 Merge branch 'gpu_drm6' into 'main'
drivers/graphics/graphics-ipc: Use redox-ioctl

See merge request redox-os/base!70
2025-12-16 13:00:58 -07:00
bjorn3 207be75768 drivers/graphics/graphics-ipc: Use redox-ioctl 2025-12-16 20:59:33 +01:00
Jeremy Soller 2a0017bcf2 Merge branch 'p3' into 'main'
fix(ipcd/uds/stream): handle zero-byte payload

See merge request redox-os/base!69
2025-12-16 07:03:17 -07:00
Anhad Singh 9496f6f486 fix(ipcd/uds/steam): perform checks before get_uid_gid_from_pid
Fix
https://gitlab.redox-os.org/redox-os/base/-/merge_requests/69#note_47265

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2025-12-16 22:14:40 +11:00
Anhad Singh 383bd436d8 fix(ipcd/uds/stream): handle zero-byte payload
* sendmsg(2) on `SOCK_STREAM` with zero-byte payload is a no-op even if
  ancillary data is present. Note that this does not apply to
  `SOCK_DGRAM`.
* Pass the `msg_flags` to `get_connected_pear` as non-blocking behaviour
  may be requested.

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2025-12-16 21:19:53 +11:00
Jeremy Soller 0220364704 Merge branch 'gpu_drm5' into 'main'
Port remaining drm ioctls to the new infrastructure

See merge request redox-os/base!68
2025-12-15 15:57:29 -07:00
bjorn3 0eb96178db Port remaining drm ioctls to the new infrastructure 2025-12-15 23:37:16 +01:00
Jeremy Soller 2892c5a1dd Merge branch 'gpu_drm4' into 'main'
Introduce infrastructure for serializing ioctls

See merge request redox-os/base!67
2025-12-15 14:53:08 -07:00
bjorn3 c3f4711403 Introduce infrastructure for serializing ioctls
And use it for a couple of drm interfaces
2025-12-15 22:29:18 +01:00
Jeremy Soller 8b614ea6d7 Merge branch 'fmt' into 'main'
Fix fmt

See merge request redox-os/base!66
2025-12-15 12:37:58 -07:00
Wildan M bdf9e44558 Fix fmt 2025-12-16 02:35:53 +07:00
Jeremy Soller 620b4bd80c Merge branch 'gpu_drm3' into 'main'
drivers/graphics/graphics-ipc: Use drm-sys for types and consts copied from DRM

See merge request redox-os/base!64
2025-12-14 14:43:33 -07:00
bjorn3 621dd6ac2f drivers/graphics/graphics-ipc: Use drm-sys for types and consts copied from DRM 2025-12-14 22:31:39 +01:00
Jeremy Soller e444f6a764 Merge branch 'gpu_drm2' into 'main'
Some fixes for the version and set_client_cap graphics driver commands

See merge request redox-os/base!63
2025-12-14 12:44:56 -07:00
bjorn3 b09bffa8b7 drivers/graphics/graphics-ipc: Actually handle SET_CLIENT_CAP 2025-12-14 20:42:59 +01:00
bjorn3 47d6f879fb drivers/graphics/graphics-ipc: Nicer version handling of version command 2025-12-14 20:25:30 +01:00
Jeremy Soller d52d250a0a Merge branch 'gpu_drm' into 'main'
drivers/graphics/graphics-ipc: Add counterparts for the VERSION, GET_CAP and...

See merge request redox-os/base!62
2025-12-14 09:54:39 -07:00
bjorn3 0c8f1b56d7 drivers/graphics/graphics-ipc: Add counterparts for the VERSION, GET_CAP and SET_CLIENT_CAP drm ioctls 2025-12-14 17:51:37 +01:00
Jeremy Soller 3fe68f6024 Merge branch 'update_redox_scheme2' into 'main'
Update ptyd to redox-scheme 0.8

See merge request redox-os/base!61
2025-12-13 07:11:55 -07:00
bjorn3 91f12cabd9 ptyd: Update to redox-scheme 0.8 2025-12-13 15:06:20 +01:00
Jeremy Soller feee6fe4de Merge branch 'update_cargo_lock' into 'main'
Update Cargo.lock

See merge request redox-os/base!60
2025-12-13 07:04:30 -07:00
bjorn3 63406c5990 Update Cargo.lock 2025-12-13 15:01:12 +01:00
Jeremy Soller 6c3dbf5a86 Merge branch 'update-netstack' into 'main'
feat: Update netstack to use redox-scheme.

See merge request redox-os/base!38
2025-12-13 06:44:43 -07:00
Ibuki Omatsu 4f3cba2cd0 feat: Update netstack to use redox-scheme. 2025-12-13 06:44:43 -07:00
Jeremy Soller 3363174937 Merge branch 'update_redox_scheme' into 'main'
Update redox-scheme for many daemons

See merge request redox-os/base!59
2025-12-13 06:27:01 -07:00
bjorn3 fdae74d0fb audiod: Use redox-scheme from crates.io 2025-12-13 13:10:36 +01:00
bjorn3 9e91a930e5 drivers/input/ps2d: Update to redox-scheme 0.8 2025-12-13 13:08:31 +01:00
bjorn3 d27e7296fc drivers/usb/xhcid: Update to redox-scheme 0.8 2025-12-13 13:08:31 +01:00
bjorn3 4b6d386840 drivers/storage/driver-block: Update to redox-scheme 0.8 2025-12-13 13:08:31 +01:00
bjorn3 256f4fe6b8 drivers/pcid: Update to redox-scheme 0.8 2025-12-13 13:08:31 +01:00
bjorn3 f329988b9d drivers/inputd: Update to redox-scheme 0.8 2025-12-13 13:08:31 +01:00
bjorn3 bab2bc052e drivers/graphics: Update most drivers to redox-scheme 0.8 2025-12-13 13:08:31 +01:00
bjorn3 74d01f34a6 drivers/acpid: Update to redox-scheme 0.8 2025-12-13 13:08:24 +01:00
bjorn3 96c4775c6c logd: Update to redox-scheme 0.8 2025-12-13 13:08:19 +01:00
bjorn3 003fb2a673 ramfs: Update to redox-scheme 0.8 2025-12-13 13:06:36 +01:00
bjorn3 3bfa5a4889 zerod: Update to redox-scheme 0.8 2025-12-13 13:06:16 +01:00
bjorn3 c574eda94a randd: Update to redox-scheme 0.8 2025-12-13 13:06:02 +01:00
bjorn3 1ac570fe06 Couple of minor feature gate changes 2025-12-13 12:38:22 +01:00
Jeremy Soller 18e8a37576 Merge branch 'initfs_mmap' into 'main'
Support zero-copy read-only mmaping in the initfs

See merge request redox-os/base!58
2025-12-12 13:54:18 -07:00
bjorn3 bd184871b7 Update redox-rt 2025-12-12 21:46:32 +01:00
bjorn3 d5ff91f248 Support mmap in initfs 2025-12-12 21:45:10 +01:00
Jeremy Soller a7047c3f28 Merge branch 'redoxer-arm' into 'main'
Move redoxerd and add aarch64 support

See merge request redox-os/base!57
2025-12-11 10:54:00 -07:00
Wildan M 471725ff4e Implement stub for riscv64 2025-12-12 00:16:40 +07:00
Wildan M 76a86e1969 Move redoxerd and add aarch64 support 2025-12-12 00:13:16 +07:00
Jeremy Soller d17a9d8387 Merge branch 'fix-check-arm' into 'main'
Fix cargo check for non x86_64

See merge request redox-os/base!56
2025-12-11 06:19:17 -07:00
Wildan M 10a1e29a64 Try fix for other arch 2025-12-11 18:54:57 +07:00
Wildan M 04d5c5fee8 Fix cargo check for aarch64 2025-12-11 18:47:46 +07:00
Jeremy Soller 713e40fba7 Merge branch 'p0' into 'main'
fix(procmgr/kill): error handling

See merge request redox-os/base!55
2025-12-10 06:18:08 -07:00
Jeremy Soller e188cb7516 Merge branch 'add-ci' into 'main'
ci: Add cargo check

See merge request redox-os/base!54
2025-12-10 06:14:50 -07:00
Anhad Singh 9028509fb8 fix(procmgr/kill): error handling
* Fix `num_succeeded` was never being incremented
* If no processes or process group could be found corresponding to that
  specified by `target`, `ESRCH` should be returned.
* Document this behaviour.

This is the reason why `killpg` test was hanging instead of reporting an
error since `kill` was silently failing.

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2025-12-10 17:17:39 +11:00
Wildan M 0ecad02774 Try add rules 2025-12-10 13:03:57 +07:00
Wildan M 6512ec74dc Reduce logs 2025-12-10 13:00:22 +07:00
Wildan M 997fe9ff50 ci: Add cargo check 2025-12-10 12:52:08 +07:00
Jeremy Soller 2df5447272 Merge branch 'p0' into 'main'
misc: run `cargo update`

See merge request redox-os/base!53
2025-12-08 18:38:05 -07:00
Anhad Singh 854e48c0d6 misc: run cargo update
Fixes compilation of `apcid`
2025-12-09 12:35:28 +11:00
Jeremy Soller 949e1feb55 Merge branch 'bootstrap_cloexec' into 'main'
bootstrap: Open things with O_CLOEXEC where possible

See merge request redox-os/base!52
2025-12-08 16:49:46 -07:00
bjorn3 3bdcd7b04d bootstrap: Open things with O_CLOEXEC where possible 2025-12-08 22:17:41 +01:00
Jeremy Soller bff13cc204 Merge branch 'ec' into 'main'
Initial embedded controller support

See merge request redox-os/base!50
2025-12-08 10:29:16 -07:00
aarch 408eb5c86d Initial embedded controller support 2025-12-08 10:29:16 -07:00
Jeremy Soller 5fac9991c2 Merge branch 'main' into 'main'
fix(procmgr): send SIGCHLD to parent after child exits

See merge request redox-os/base!40
2025-12-07 17:59:52 -07:00
Jeremy Soller 888b51a4eb Merge branch 'update_redox_rt' into 'main'
bootstrap: Update redox-rt

See merge request redox-os/base!51
2025-12-07 13:51:24 -07:00
bjorn3 63907aff45 bootstrap: Update redox-rt 2025-12-07 20:59:32 +01:00
Jeremy Soller 837117485f Merge branch 'minor_init_rc_cleanup' into 'main'
Two minor cleanups to init.rc

See merge request redox-os/base!49
2025-12-06 08:15:24 -07:00
bjorn3 1350cf79cf Remove unnecessary VT switch
We already automatically switch to the first VT that gets created.
2025-12-06 10:51:16 +01:00
Jeremy Soller 85e16c110b Merge branch 'daemon_improvements2' into 'main'
Various improvements to the way daemons work

See merge request redox-os/base!48
2025-12-05 17:31:52 -07:00
bjorn3 6c39bea37a Only depend on redox-rt when compiling for redox
This fixes rust-analyzer when it is not configured to use redox as target.
2025-12-05 22:06:39 +01:00
bjorn3 858ff9cea9 init: Refactor the run function to reduce indentation 2025-12-05 21:02:46 +01:00
bjorn3 1d834c2393 init: Read config files all at once
This is simpler than streaming and likely a bit faster. Config files are
expected to be tiny.
2025-12-05 20:52:50 +01:00
bjorn3 c7adb019b5 Use file as default scheme from the start
This removes one piece of state that init has to manage for the
processes it spawns. This also allows getting rid of the concept of a
default scheme from relibc if we want.
2025-12-05 20:52:50 +01:00
bjorn3 4a182077c9 ipcd: Fix a couple of warnings 2025-12-05 20:52:46 +01:00
bjorn3 3abe41d258 drivers/pcid: Add pci_daemon function
This handles daemonization and getting the PciFunctionHandle.
2025-12-04 11:44:29 +01:00
bjorn3 f06923b201 Standardize main function of all daemons 2025-12-04 11:44:29 +01:00
Jeremy Soller b334e969b1 Merge branch 'daemon_improvements' into 'main'
Move redox-daemon into this repo and improve it

See merge request redox-os/base!47
2025-12-03 15:11:45 -07:00
bjorn3 7aa0776abd Rustfmt 2025-12-03 22:02:20 +01:00
bjorn3 f1057b6750 daemon: Abort on errors
All users did this anyway. And handling it inside the daemon crate
allows avoiding a panic of the parent process when the child process
panicked.
2025-12-03 21:55:47 +01:00
bjorn3 583c2fb3c1 daemon: Use std::io::pipe() 2025-12-03 21:43:09 +01:00
bjorn3 5655d20a64 daemon: Remove libredox dependency 2025-12-03 21:34:40 +01:00
bjorn3 54d81e7423 Merge redox-daemon into this repo 2025-12-03 21:07:13 +01:00
bjorn3 0c2341d53e Remove outdated Cargo.lock files 2025-12-03 21:00:13 +01:00
Anhad Singh 5f3b2cc91f fix(procmgr): send SIGCHLD to parent after child exits
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2025-12-01 11:03:57 +11:00
Jeremy Soller 1a92bd4bef Merge branch 'init_nowait' into 'main'
init: Add a nowait command that immediately daemonizes

See merge request redox-os/base!45
2025-11-30 07:09:29 -07:00
Jeremy Soller e5fe30573b Merge branch 'move_init_rc' into 'main'
Move init.rc from redox repo

See merge request redox-os/base!44
2025-11-30 07:07:21 -07:00
Jeremy Soller 588121d267 Merge branch 'misc_changes' into 'main'
Misc changes

See merge request redox-os/base!43
2025-11-30 07:06:36 -07:00
bjorn3 66ca17f899 init: Add a nowait command that immediately daemonizes
This is useful for daemons on which no other daemon has a dependency as
those would no longer need to use redox_daemon to daemonize themself.
2025-11-30 10:45:55 +01:00
bjorn3 ecdaccd728 Move init.rc from redox repo 2025-11-30 09:08:43 +01:00
bjorn3 5250df46dc Fix a couple of warnings 2025-11-30 09:07:40 +01:00
bjorn3 03087b091d Disable LTO 2025-11-30 09:01:58 +01:00
Jeremy Soller ff578463cb Merge branch 'fix_some_warnings' into 'main'
Fix some warnings in ptyd

See merge request redox-os/base!42
2025-11-29 12:40:06 -07:00
bjorn3 fd0f45eac8 Fix some warnings in ptyd 2025-11-29 19:17:36 +01:00
bjorn3 91a1574c7d Update for drivers repo merge 2025-11-29 19:04:06 +01:00
bjorn3 07a2b97f08 Add 'drivers/' from commit '20ffe4d7f4a85b7cc1f59495d7e6e355fed4cb06'
git-subtree-dir: drivers
git-subtree-mainline: e76ecea4ce
git-subtree-split: 20ffe4d7f4
2025-11-29 19:04:04 +01:00
Jeremy Soller 20ffe4d7f4 Merge branch 'modernize_bgad' into 'master'
graphics/bgad: Use the MMIO based interface rather than port based one

See merge request redox-os/drivers!303
2025-11-29 09:22:25 -07:00
Jeremy Soller df74936858 Merge branch 'fix_x86' into 'master'
pcid: Fix compilation on x86

See merge request redox-os/drivers!304
2025-11-29 09:20:40 -07:00
bjorn3 891a9af623 pcid: Fix compilation on x86 2025-11-29 16:18:10 +01:00
bjorn3 ce9564dd3c graphics/bgad: Use the MMIO based interface rather than port based one
This only works in QEMU, so disable bgad in VirtualBox. It currently
doesn't do much useful anyway. It supports reporting the display size
(which vesad already supports) and changing the display size (which
doesn't really work anyway as the framebuffer mapping used by vesad
doesn't get resized.) And in any case vboxd already has code to use
the BGA interface for resizing that is broken to the same extend the
resizing in bgad is.
2025-11-29 16:05:57 +01:00
Jeremy Soller ff0ac17992 Merge branch 'pcid_int_rework2' into 'master'
Use pci_allocate_interrupt_vector in nvmed

See merge request redox-os/drivers!302
2025-11-29 08:01:56 -07:00
bjorn3 5c55c4bb16 Use pci_allocate_interrupt_vector in nvmed 2025-11-29 15:39:08 +01:00
bjorn3 8dbd454ec8 Merge branch 'latest-redox-scheme' into 'master'
feat: Update some drivers to latest redox-scheme from the legacy scheme.

See merge request redox-os/drivers!296
2025-11-29 14:20:44 +00:00
Ibuki Omatsu a5d502625e feat: Update some drivers to latest redox-scheme from the legacy scheme. 2025-11-29 14:20:44 +00:00
Jeremy Soller fec64b98ef Merge branch 'pci_type_name_fix' into 'master'
Fix arg type typo

See merge request redox-os/drivers!300
2025-11-29 07:20:18 -07:00
aarch 627ead6e06 Fix arg type typo 2025-11-29 14:10:09 +00:00
Jeremy Soller 2f90aee27a Merge branch 'fix_warnings' into 'master'
Fix a bunch of warnings

See merge request redox-os/drivers!299
2025-11-29 06:45:24 -07:00
Jeremy Soller 0f24975ffb Merge branch 'pci_interrupts_rework5' into 'master'
Deduplicate int vector handling between ihdad and rtl network drivers

See merge request redox-os/drivers!298
2025-11-29 06:41:39 -07:00
bjorn3 420fde3c54 Remove a couple of unused feature gates 2025-11-29 11:16:59 +01:00
bjorn3 36e3834d8b Fix a bunch of warnings 2025-11-29 11:15:39 +01:00
bjorn3 f5475fc9a7 Deduplicate int vector handling between ihdad and rtl network drivers
Xhcid and nvmed still use their own get_int_method function as they need
need to distinguish between legacy, MSI and MSI-X interrupts.
2025-11-29 10:40:15 +01:00
Jeremy Soller 4d6581d454 xhcid: add more timeouts 2025-11-26 17:45:46 -07:00
Jeremy Soller 8ca163d575 ihdad: add many more timeouts and error handling 2025-11-26 17:30:03 -07:00
Jeremy Soller 84d43ecbf3 Add timeouts to ihdad, reduce nvmed timeouts 2025-11-26 09:53:25 -07:00
Jeremy Soller e76ecea4ce audiod: daemonize after creating audio scheme 2025-11-26 09:52:32 -07:00
Jeremy Soller d07a33ec0b Add timeouts to more driver spin loops 2025-11-26 09:30:45 -07:00
Jeremy Soller 6de1b07cb1 Merge branch 'recover-netstack' into 'main'
netstack: Do not quit at error

See merge request redox-os/base!39
2025-11-24 06:41:06 -07:00
Wildan M e65fbb6537 netstack: Do not quit at error 2025-11-23 22:09:20 -08:00
Jeremy Soller dd41c4f13e net: scheme created and daemon ready before device init 2025-11-23 09:23:09 -07:00
Jeremy Soller e3d5abdaa1 pcid: also scan bus 0x80 by default for Arrow Lake 2025-11-23 08:14:58 -07:00
Jeremy Soller 6a11465e3e pcid: allow unaligned access 2025-11-23 08:08:11 -07:00
Jeremy Soller 6d8d91ec85 hwd: daemonize 2025-11-22 20:44:15 -07:00
Jeremy Soller ccd8d8f158 hwd: launch pcid after acpid but before probe 2025-11-22 17:30:52 -07:00
Jeremy Soller 2ee3a846fb acpid: do not enter null namespace (workaround for pci) 2025-11-22 17:30:37 -07:00
Jeremy Soller e114fd9bda acpid: use pcid access file 2025-11-22 17:30:10 -07:00
Jeremy Soller cd5adcd848 acpid: initialize aml on demand 2025-11-22 17:29:46 -07:00
Jeremy Soller 2e96800384 pcid: add access file 2025-11-22 17:29:11 -07:00
Jeremy Soller e129875294 Remove unnecessary double evaluation of AML 2025-11-22 10:12:56 -07:00
Jeremy Soller 6107671e10 ihdad: signal ready after scheme creation 2025-11-22 09:45:20 -07:00
Jeremy Soller 732cde5bad Make PS/2 driver cleaner and more resilient 2025-11-21 21:07:05 -07:00
Jeremy Soller e5beee87dd ps2d: fix timeout code 2025-11-21 15:46:27 -07:00
Jeremy Soller 1145e908f1 ipcd: return sane value for SO_SNDBUF 2025-11-17 17:18:02 -07:00
Jeremy Soller c7b82d2c8f bootstrap: add link script for i586 2025-11-16 12:58:25 -07:00
Jeremy Soller 9704a4501e ipcd: refactor fevent handling 2025-11-16 09:02:27 -07:00
Jeremy Soller d609a3878f Merge branch 'use-upper-fdtbl' into 'main'
use upper fd table

See merge request redox-os/base!37
2025-11-16 08:39:31 -07:00
Jeremy Soller f629b061fa use upper fd table 2025-11-16 08:37:46 -07:00
Jeremy Soller 16ac15d5eb ipcd: remove unnecessary debug print 2025-11-14 18:25:36 -07:00
Jeremy Soller f8baa54411 Implement fpath on proc scheme 2025-11-14 11:37:14 -07:00
Jeremy Soller eb2da68f88 Handle MSG_DONTWAIT 2025-11-13 10:19:13 -07:00
Jeremy Soller 594748c1e1 ipcd: make require_connected_connection compatible with O_NONBLOCK 2025-11-10 16:41:55 -07:00
Jeremy Soller 7d2d5e9f60 Go back to redox-os/relibc for redox-rt 2025-11-10 07:36:01 -07:00
Jeremy Soller 386b48103e Merge branch 'getpeername' into 'main'
feat: Add getpeername support for uds schemes.

See merge request redox-os/base!36
2025-11-10 07:34:54 -07:00
Ibuki Omatsu 1033c6f430 feat: Add getpeername support for uds schemes. 2025-11-10 07:34:54 -07:00
Jeremy Soller 092d4001e1 Support SO_PEERCRED in unix streams 2025-11-08 08:39:02 -07:00
Jeremy Soller 68b483b0c7 Block require_connected_connection if already connecting 2025-11-08 07:45:07 -07:00
Jeremy Soller 3019f8f12a Fix return value for nonblock accept and recvfd 2025-11-07 20:11:13 -07:00
Jeremy Soller f311cdd813 Allow SCM_CREDENTIALS 2025-11-07 15:46:41 -07:00
Jeremy Soller 54105cecf8 Implement fstat for shm 2025-11-07 13:26:45 -07:00
Jeremy Soller fc183b1d07 Update dependencies 2025-11-07 08:40:55 -07:00
Jeremy Soller ee6e94ca1e Adjust ps2d timeouts 2025-11-02 08:15:38 -07:00
Jeremy Soller 93eeb4ca0b Adjust pcid logging 2025-11-02 08:00:19 -07:00
Jeremy Soller 28dd3596f3 More logging adjustments and set default level to info 2025-11-02 07:55:32 -07:00
Jeremy Soller 6dc44087bf Reduce logging in rtl ethernet drivers 2025-11-01 21:02:42 -06:00
Jeremy Soller 9ee833d5f2 ps2d: do not block on device init 2025-11-01 20:59:39 -06:00
Jeremy Soller dc605d6cb9 bootstrap: set log level to warn 2025-11-01 20:47:43 -06:00
Jeremy Soller b7b8126731 bootstrap: reduce logging 2025-11-01 20:45:25 -06:00
Jeremy Soller ec49a96640 More logging improvements 2025-11-01 20:44:26 -06:00
Jeremy Soller c560376d24 logd: do not log when ready 2025-11-01 20:33:48 -06:00
Jeremy Soller 212758724e ptyd: do not log when ready 2025-11-01 19:57:35 -06:00
Jeremy Soller c4d28fff23 xhcid: adjust another log message 2025-11-01 19:55:35 -06:00
Jeremy Soller 6d5523de2a Set all log levels, reduce unnecessary logs 2025-11-01 19:36:38 -06:00
Jeremy Soller 9972903dc4 init: do not log successful command completion 2025-11-01 19:29:52 -06:00
Jeremy Soller 4d4038dea7 Merge branch 'root_check_fix' into 'master'
Fix inverted root check

See merge request redox-os/drivers!295
2025-10-25 08:16:30 -06:00
aarch 22ab2fe17d Fix inverted root check 2025-10-25 15:42:45 +02:00
Jeremy Soller 53548166f7 Merge branch 'acpi_aml' into 'master'
Expose AML evaluation through acpi scheme

See merge request redox-os/drivers!292
2025-10-24 11:48:30 -06:00
aarch 63bad63321 Expose AML evaluation through acpi scheme 2025-10-24 11:48:29 -06:00
Jeremy Soller 57ca3be975 Fixup for last commit 2025-10-24 08:21:01 -06:00
Jeremy Soller 8bf5d60e96 Adjust logging, ensure drivers get unique logfiles 2025-10-24 08:19:34 -06:00
Jeremy Soller 731d22366d Merge branch 'bootlog-scroll' into 'master'
Add scrollback into fbbootlogd

See merge request redox-os/drivers!294
2025-10-22 11:56:40 -06:00
Wildan M fa9127ca34 Require shift key for scrollback and have better limit 2025-10-23 00:14:05 +07:00
Jeremy Soller f59f893d5b Merge branch 'loopback-fix' into 'main'
Fix smolnet not handling loopback address

See merge request redox-os/base!34
2025-10-22 05:48:42 -06:00
Wildan M 6c9822893e Fix double key register on dbbootlogd 2025-10-22 17:02:03 +07:00
Wildan M 306079c091 Fix fmt 2025-10-22 16:27:38 +07:00
Wildan M b9d0599bac Add scrollback into fbbootlogd 2025-10-22 16:27:32 +07:00
Wildan M 62c8b62b1e Fix smolnet not handling loopback address 2025-10-22 13:29:41 +07:00
Jeremy Soller dfb977875f ahcid: add timeouts to all spin loops 2025-10-21 15:13:26 -06:00
Jeremy Soller 9ff116f4bb Merge branch 'uds-race-cond' into 'main'
Use atomic counter in UDS to avoid race condition

See merge request redox-os/base!32
2025-10-21 10:30:56 -06:00
Jeremy Soller 9510a3db00 Merge branch 'shm-handling-2' into 'main'
Further fixes of shm read/write handling

See merge request redox-os/base!33
2025-10-21 10:30:43 -06:00
Wildan M aab6157871 Further fixes of shm read/write handling 2025-10-21 23:18:40 +07:00
Wildan Mubarok 6dddb01d63 Use atomic counter in UDS to avoid race condition 2025-10-21 15:20:50 +00:00
Jeremy Soller 71e9fc3a14 Merge branch 'ps2-keymap-config' into 'master'
Add ps2 scheme to make the keymap configurable

See merge request redox-os/drivers!293
2025-10-20 11:30:24 -06:00
Wildan M f18cd76081 Fix fmt 2025-10-20 23:36:38 +07:00
Wildan M d23eaf616a Add keymap config via ps2 scheme 2025-10-20 23:36:19 +07:00
Jeremy Soller 99160faeb1 hwd: debug devicetree devices 2025-10-18 19:49:18 -06:00
Jeremy Soller f7540f24f6 hwd: describe more ACPI devices 2025-10-18 17:53:51 -06:00
Jeremy Soller 7359af31de Add two more ACPI IDs to hwd 2025-10-18 16:58:09 -06:00
Jeremy Soller 7109334d2b hwd: require dtb to parse in order to use devicetree backend 2025-10-18 16:51:04 -06:00
Jeremy Soller 16f24757ea Update dependencies 2025-10-18 13:56:23 -06:00
Jeremy Soller ce10c962c9 hwd: spawn acpid and provide abstraction for acpi/dtb/legacy 2025-10-18 12:09:59 -06:00
Jeremy Soller a463b5dcb5 Update acpi crate 2025-10-18 11:55:17 -06:00
Jeremy Soller 47f056490f Merge branch 'shm-handling' into 'main'
Fixes for shm handling

See merge request redox-os/base!31
2025-10-17 15:02:45 -06:00
Wildan Mubarok 97cefd26a1 Fixes for shm handling 2025-10-17 15:02:45 -06:00
Jeremy Soller 3f13e59870 Merge branch 'remove_useless_loop' into 'master'
Remove a useless loop in driver-block

See merge request redox-os/drivers!291
2025-10-14 12:26:18 -06:00
bjorn3 ae84627479 Rustfmt 2025-10-14 20:22:49 +02:00
bjorn3 322b7440bf Remove a useless loop in driver-block
This is a leftover from switching from a readiness based api to async
functions.
2025-10-14 20:15:35 +02:00
Ribbon 1ca468f66d Improve README 2025-10-06 07:19:29 -03:00
Jeremy Soller 86aea82139 Update rust-toolchain.toml 2025-10-04 09:18:58 -06:00
Jeremy Soller 9d0ef503e4 Merge branch 'fixes' into 'master'
Replace removed nightly features.

See merge request redox-os/drivers!289
2025-10-04 08:17:57 -06:00
Jeremy Soller 2c423e9a44 Update bootstrap to edition 2024 2025-10-04 08:15:24 -06:00
Jeremy Soller 77cf4c0001 Update bootstrap dependencies 2025-10-04 08:12:36 -06:00
Jeremy Soller b7e260747f array_chunks feature is stable in new nightly 2025-10-04 08:10:15 -06:00
4lDO2 05f80e6841 Replace removed nightly features. 2025-10-04 16:08:14 +02:00
Jeremy Soller 565f69f68b Update dependencies 2025-10-04 08:06:12 -06:00
Jeremy Soller 24a4cfc640 Update dependencies 2025-10-04 08:03:28 -06:00
Jeremy Soller 2ddf07ad26 Merge branch 'reorganised-usb-structure' into 'master'
Reorganised usb structure

See merge request redox-os/drivers!288
2025-10-01 13:28:35 -06:00
Filippo Mutta c00056e791 USB: reorganised order. 2025-10-01 18:56:27 +02:00
Filippo Mutta dd17e81cc9 USB: Fixed relative paths for deps in usb/ dir 2025-10-01 08:12:41 +02:00
Filippo Mutta e157117890 USB: Added new paths in cargo.toml 2025-09-30 23:10:46 +02:00
Filippo Mutta 68f0fc6f80 USB: reorganised directory structure. 2025-09-30 22:48:28 +02:00
Jeremy Soller e3fdca0c35 Merge branch 'acpi-update' into 'master'
Update to latest acpi crate

See merge request redox-os/drivers!286
2025-09-28 08:53:18 -06:00
Jeremy Soller 62fab168e5 Update to latest acpi crate 2025-09-28 08:53:18 -06:00
Jeremy Soller 6b335d4f90 hwd: decode some ACPI IDs 2025-09-27 18:22:05 -06:00
Jeremy Soller 0b3d81e06b lived: preserve original disk data for performant installer 2025-09-25 09:50:06 -06:00
Jeremy Soller 407533201f Add tested Thinkpad T60 ethernet to e1000d driver 2025-09-24 17:26:07 -06:00
Jeremy Soller 85db6774fb Merge branch 'allow_larger_fbs' into 'master'
graphics/driver-graphics: Allow larger framebuffers

See merge request redox-os/drivers!285
2025-09-23 14:34:45 -06:00
bjorn3 1756244e10 graphics/driver-graphics: Allow larger framebuffers
Previously only frame buffers up to 0x1_000_000 bytes were allowed,
while we use 0x10_000_000 as multiplier for the fake offsets and thus
can safely accept framebuffers this large. This should be enough for 4k
displays.
2025-09-23 22:28:19 +02:00
4lDO2 3354a9148d Fix SIGSTOP panic, ignore sigs for exited procs. 2025-09-21 10:14:52 +02:00
Jeremy Soller bed0b52961 ipcd/uds: implement fevent and misc fixes 2025-09-17 14:43:53 -06:00
Jeremy Soller 19570db45e Merge branch 'xhci-csz' into 'master'
xhci: support 64-bit contexts (CSZ)

See merge request redox-os/drivers!283
2025-09-12 09:42:58 -06:00
Jeremy Soller 00b06cb915 xhci: support 64-bit contexts (CSZ) 2025-09-12 09:42:58 -06:00
Jeremy Soller 12e601b336 xhcid: improvements based on real hardware testing 2025-09-11 21:06:21 -06:00
Jeremy Soller 69a80a6a13 xhcid: fix reset procedure on real hardware 2025-09-11 15:31:15 -06:00
4lDO2 d0a841536b Properly indicate SIGKILL termination for waitpid. 2025-09-10 14:26:40 +02:00
Jeremy Soller 966fd1adb1 Merge branch 'ptyd-use-write-for-fn-path' into 'main'
Simplify Pty::path with write!

See merge request redox-os/base!28
2025-09-06 07:13:52 -06:00
Jeremy Soller 1577506765 Merge branch 'pci_interrupts_rework3' into 'master'
Various interrupt handling improvements

See merge request redox-os/drivers!282
2025-08-31 09:49:08 -06:00
bjorn3 131063eb0e Rustfmt 2025-08-31 16:07:57 +02:00
bjorn3 7e3e841f69 xhcid: Fix reading EHB flag in received_irq 2025-08-31 15:58:56 +02:00
bjorn3 e4aab16782 xhcid: Don't exit the event loop when using irqs 2025-08-31 15:58:56 +02:00
bjorn3 2c9be2e9b8 xhcid: Remove unused InterruptSources methods and fields 2025-08-31 15:58:15 +02:00
Josh Megnauth 6e76601529 Simplify Pty::path with write!
Pty::path is a manual implementation of write! that also allocates.
Using write! avoids the alloc and is simpler too.

The original function didn't return an error even if called with a small
buffer and this version preserves that.
2025-08-31 01:58:33 -04:00
bjorn3 b9ce02ea90 storage/nvmed: Remove unused InterruptSources methods and fields 2025-08-30 20:11:05 +02:00
Jeremy Soller cbc4987dc4 Merge branch 'pci_interrupts_rework4' into 'master'
Cleanup and deduplicate a bunch of MSI/MSI-X handling

See merge request redox-os/drivers!281
2025-08-30 11:29:31 -06:00
bjorn3 2945b86b82 pcid: Helper to allocate first MSI interrupt 2025-08-30 19:14:01 +02:00
bjorn3 ea47c97bf8 Check for MSI-X before checking for MSI 2025-08-30 19:14:01 +02:00
bjorn3 0a314b0bad nvmed: Use std::hint::spin_loop 2025-08-30 19:14:01 +02:00
bjorn3 0b6b5e0d04 pcid: Move MappedMsixRegs to pcid_interface 2025-08-30 19:14:01 +02:00
bjorn3 191e6ac4eb pcid: Disable MSI and MSI-X before launching a driver 2025-08-30 18:34:41 +02:00
bjorn3 e4609257fa Merge branch 'fbcond-vim-panic' into 'master'
Fix fbcond panicking when vim quit

See merge request redox-os/drivers!280
2025-08-30 12:48:59 +00:00
Wildan Mubarok 259999c9c3 Fix fbcond panicking when vim quit 2025-08-30 12:27:35 +00:00
Jeremy Soller 8f278dcb63 Merge branch 'fix-xhci-panic' into 'master'
Fix possible panic in device enumeration

See merge request redox-os/drivers!279
2025-08-25 07:21:30 -06:00
Wildan M 34b37410be Merge branch 'master' of https://gitlab.redox-os.org/willnode/drivers into fix-xhci-panic 2025-08-24 20:10:01 +07:00
Wildan M e8bfe4448c Fix possible panic in device enumeration 2025-08-24 20:06:14 +07:00
Jeremy Soller f0fa4125ba Merge branch 'add-vdisable' into 'main'
Add _POSIX_VDISABLE to pty to disable control chars

See merge request redox-os/base!27
2025-08-15 06:57:36 -06:00
Josh Megnauth 1744adb7c1 Add _POSIX_VDISABLE to disable control chars
This is a POSIX extension to disable control chars when set in the c_cc
array. Fish and other programs use it.

See:
* redox-os/relibc!689
* redox-os/termios!3
2025-08-14 01:07:00 -04:00
Jeremy Soller 0922b7d95d Merge branch 'enlarge-debug' into 'main'
Increase initfs in debug build

See merge request redox-os/base!26
2025-08-01 06:50:42 -06:00
Wildan Mubarok fde6dab626 Increase initfs in debug build 2025-08-01 06:00:53 +00:00
Jeremy Soller 24ff0865b6 Merge branch 'bulk-send-recvfd' into 'main'
feat: Implement bulk fd passing

See merge request redox-os/base!25
2025-07-30 18:49:38 -06:00
Ibuki Omatsu 3cad0e8a33 feat: Implement bulk fd passing 2025-07-30 18:49:37 -06:00
Jeremy Soller d03f2cddd1 Merge branch 'integrate-bind-connect-redoxfs' into 'main'
feat: Reimplement bind and connect operation using token and switch GetProcCredentials to capability-based approach.

See merge request redox-os/base!19
2025-07-21 07:56:03 -06:00
Ibuki Omatsu 9a8af7c993 feat: Reimplement bind and connect operation using token and switch GetProcCredentials to capability-based approach. 2025-07-21 07:56:03 -06:00
Jeremy Soller 257e07209d Merge branch 'disable-get_proc_credentials' into 'main'
fix: Fix build errors related to uds scheme

See merge request redox-os/base!24
2025-07-19 12:13:15 -06:00
Ibuki Omatsu 1004be449d fix: Fix build errors related to uds scheme 2025-07-19 12:13:15 -06:00
Jeremy Soller e7388ae2fb Merge branch 'scheme0.6-uds' into 'main'
feat: Implement uds_dgram and uds_stream schemes.

See merge request redox-os/base!16
2025-07-18 21:58:53 -06:00
Ibuki Omatsu 9189c4c6dc feat: Implement uds_dgram and uds_stream schemes. 2025-07-18 21:58:53 -06:00
Jeremy Soller 7f2212836a Merge branch 'logd_improvements' into 'main'
Better handling of kernel logs

See merge request redox-os/base!22
2025-07-13 06:40:44 -06:00
4lDO2 a232996fe8 Add missing OnClose handler in procmgr, fixes leak. 2025-07-13 11:00:41 +02:00
bjorn3 8c8aa29468 logd: Avoid echoing back kernel logs to the kernel debug scheme 2025-07-12 17:14:12 +02:00
bjorn3 8f319d4081 logd: Improve implementation of kernel log copying
I hadn't meant to upstream it yet. I accidentally added it in a commit
touching the netstack. In any case this commit integrates the kernel log
copying directly into LogScheme.

The kernel log copying is meant to show the kernel log on the fbbootlogd
rendered bootlog. Even once the kernel graphical debug has been disabled
or if it never got enabled due to the bootloader not presenting a
framebuffer.
2025-07-12 17:14:12 +02:00
bjorn3 afa109c088 logd: Implement backfilling of logs when adding a new sink 2025-07-12 17:14:12 +02:00
bjorn3 a567d87842 logd: Open kernel log inside LogScheme::new.
This allows a future commit to skip writing to the kernel log when
necessary.
2025-07-12 17:13:17 +02:00
Jeremy Soller 36e37958c9 e1000d: do not print in busy loop 2025-07-11 09:06:10 -06:00
Jeremy Soller fc7ab34d32 Merge branch 'ipcd-scheme-version-up' into 'main'
feat: Update the redox-scheme version to 0.6 in ipcd.

See merge request redox-os/base!17
2025-07-10 21:01:41 -06:00
Ibuki Omatsu 8a3bb40a1f feat: Update the redox-scheme version to 0.6 in ipcd. 2025-07-10 21:01:40 -06:00
Jeremy Soller c39c26ebe7 Merge branch 'virtio_gpu_resize2' into 'master'
graphics/fbcond: Handle display resizing

See merge request redox-os/drivers!277
2025-07-07 14:56:09 -06:00
bjorn3 a6a6dce185 graphics/fbcond: Handle display resizing
Currently resizing only happens when writing to the terminal.
2025-07-07 21:59:08 +02:00
bjorn3 b5caa86906 graphics/fbcond: Use the v2 graphics api 2025-07-07 21:59:07 +02:00
Jeremy Soller cc7170faf7 Merge branch 'graphics_improvements' into 'master'
Various improvements to the graphics subsystem

See merge request redox-os/drivers!276
2025-07-07 12:53:41 -06:00
Jeremy Soller e614d267bb Merge branch 'ttl-to-hoplimit' into 'main'
rename Setting::Ttl to Setting::HopLimit

See merge request redox-os/base!21
2025-07-07 06:37:44 -06:00
auronandace 9240eabe67 rename Setting::Ttl to Setting::HopLimit 2025-07-06 17:29:34 +01:00
bjorn3 93e95f6fe8 graphics: Fix memory leak when resizing the display 2025-07-06 16:22:53 +02:00
bjorn3 ded7a6ed86 graphics/graphics-ipc: Update handle doc comments 2025-07-06 15:30:05 +02:00
bjorn3 918efd01cd graphics/fbcond: Inline open_display 2025-07-06 15:28:42 +02:00
bjorn3 9abeafde8d graphics: Move disable-graphical-debug to driver-graphics
This ensures it graphical debug gets disabled even when vesad never
runs.
2025-07-05 15:43:21 +02:00
bjorn3 e59d4ac7e1 graphics/vesad: Move FrameBuffer to scheme.rs 2025-07-05 15:21:40 +02:00
Jeremy Soller 1659cacf60 Merge branch 'update_redox_scheme_0_6' into 'master'
Update most crates to redox-scheme 0.6

See merge request redox-os/drivers!275
2025-07-04 14:44:37 -06:00
bjorn3 04ae0158c9 Update most crates to redox-scheme 0.6
A couple of crates need to stay on redox-scheme 0.4 as they need
cancellation for async schemes.
2025-07-04 22:13:24 +02:00
Jeremy Soller 2abbf581c2 Merge branch 'tiny_randd_improvement' into 'main'
Remove the socket field of RandScheme

See merge request redox-os/base!20
2025-07-04 14:04:36 -06:00
bjorn3 582005fbbe Remove the socket field of RandScheme
No code inside RandScheme needs it. And the main function can access the
socket it opened directly. This also fixes running tests for randd.
2025-07-04 21:58:29 +02:00
Jeremy Soller ba3e2b7679 Merge branch 'virtio_gpu_ub_fix' into 'master'
graphics/virtio-gpud: Destroy virtio-gpu resource before freeing fb memory

See merge request redox-os/drivers!274
2025-07-03 13:02:47 -06:00
bjorn3 a261f1257d graphics/virtio-gpud: Destroy virtio-gpu resource before freeing fb memory
This fixes a gpu side use-after-free.
2025-07-03 20:57:55 +02:00
Jeremy Soller 813a29b5ba Merge branch 'virtio_gpu_resize' into 'master'
graphics: Handle virtio-gpu display resizing in fbbootlogd

See merge request redox-os/drivers!273
2025-07-02 09:33:48 -06:00
bjorn3 cc0db37209 graphics/fbbootlogd: Use the new graphics api 2025-07-02 15:43:55 +02:00
bjorn3 4f7b0eb6b6 graphics: Introduce a new graphics api
This allows page flipping and handling display resizing. Hardware
cursors and getting notifications about display resizing are not yet
supported.
2025-07-02 15:43:55 +02:00
bjorn3 27ca1c3296 graphics/virtio-gpud: Handle VIRTIO_GPU_EVENT_DISPLAY
This doesn't yet provide a way for individual consumers to resize their
own framebuffer in response to the display changing size.
2025-07-02 15:16:52 +02:00
Jeremy Soller 181f0ea4ec Merge branch 'driver_graphics_improvements' into 'master'
Various changes to driver-graphics

See merge request redox-os/drivers!272
2025-07-01 15:58:14 -06:00
bjorn3 8ac07539b0 graphics/driver-graphics: Handle mmap offset 2025-07-01 21:46:20 +02:00
bjorn3 2f756fd29d virtio-core: Fix a warning 2025-07-01 21:44:06 +02:00
bjorn3 565add84b1 graphics/driver-graphics: Update to redox-scheme 0.6 2025-07-01 21:40:57 +02:00
Jeremy Soller 10cd204e60 Merge branch 'graphics_refactorings' into 'master'
graphics: Various refactorings

See merge request redox-os/drivers!271
2025-06-30 15:18:49 -06:00
bjorn3 7f3f181775 graphics/virtio-gpud: Create DisplayHandle after registering the scheme
This fixes a race-condition. It is unlikely to cause issues in practice
though.
2025-06-30 23:03:40 +02:00
bjorn3 7f5c58892c graphics/driver-graphics: Eagerly create contents of VtState 2025-06-30 23:01:52 +02:00
bjorn3 7882372dab graphics/driver-graphics: Introduce VtState
This contains the current state for a single VT.
2025-06-30 22:10:02 +02:00
bjorn3 c2249f2fa0 graphics/driver-graphics: Couple of minor changes 2025-06-30 21:40:02 +02:00
bjorn3 993b23e63c graphics/driver-graphics: Prepare for future abi versions 2025-06-30 20:04:40 +02:00
bjorn3 74bb9f40e5 graphics/graphics-ipc: Introduce a common module for code shared between versions 2025-06-30 19:59:52 +02:00
bjorn3 56d4fdd025 graphics: Replace adapter.displays() with .display_count() 2025-06-30 19:58:25 +02:00
bjorn3 5ddddd91df graphics: Pass CursorPlane by shared ref to handle_cursor 2025-06-29 18:03:01 +02:00
Jeremy Soller 3770b439c5 Merge branch 'netstack_cleanups' into 'main'
Bunch of netstack cleanups

See merge request redox-os/base!18
2025-06-28 08:45:13 -06:00
bjorn3 c9806f68fc netstack: Remove a bunch of dead code 2025-06-28 16:21:16 +02:00
bjorn3 2f51590d9f netstack: Merge the redox_netstack lib into smolnetd 2025-06-28 16:18:34 +02:00
bjorn3 20ee161085 netstack: Move the smolnetd source 2025-06-28 16:16:30 +02:00
bjorn3 cfef0413e5 netstack: Remove dnsd
It isn't used anywhere. Relibc has it's own dns resolver.
2025-06-28 16:16:15 +02:00
4lDO2 196a59824b Implement cancellation for waitpid. 2025-06-21 11:32:59 +02:00
Jeremy Soller b6d6ef27f0 Merge branch 'ps2d_move_expects' into 'master'
input/ps2d: More helpful panic locations when initializing fails

See merge request redox-os/drivers!270
2025-05-22 12:47:08 -06:00
bjorn3 ff7325df14 input/ps2d: More helpful panic locations when initializing fails 2025-05-22 20:44:07 +02:00
Jeremy Soller e9b839b484 Merge branch 'initfs_main_workspace' into 'main'
Add initfs to the main workspace

See merge request redox-os/base!15
2025-05-20 17:17:55 -06:00
Jeremy Soller a75f108167 Merge branch 'disk_driver_notify_early' into 'master'
storage: Notify readiness as soon as the disk scheme has been created

See merge request redox-os/drivers!269
2025-05-20 17:17:24 -06:00
bjorn3 71f1838eea acpid: Rustfmt 2025-05-20 22:03:10 +02:00
bjorn3 a1b0feaadb storage: Notify readiness as soon as the disk scheme has been created
This prevents boot hangs when the disk driver hangs between creating the
disk scheme and being fully initialized, while still preventing race
conditions.
2025-05-20 22:03:01 +02:00
bjorn3 a31bc0301e Fix a couple of procmgr warnings 2025-05-20 21:08:49 +02:00
bjorn3 7655b09d33 Add initfs to the main workspace 2025-05-20 20:34:59 +02:00
Ribbon 6bd3396d04 Explain the initfs purpose 2025-05-17 18:54:04 -03:00
Ribbon 632459e5be Add a README and simplify the daemon READMEs 2025-05-15 23:29:52 -03:00
Jeremy Soller 9403db2125 Merge branch 'ps2d-right-ctrl' into 'master'
Accept right ctrl key from ps2 keyboard

See merge request redox-os/drivers!268
2025-05-02 11:23:29 -06:00
Arne de Bruijn 5827a0e309 Accept right ctrl key from ps2 keyboard
Map both ctrl keys to K_CTRL for now, same as usbhidd.
2025-05-02 19:06:53 +02:00
Jeremy Soller 5e4d4427db Timeout of five seconds for nvmed init 2025-04-25 12:14:09 -06:00
Jeremy Soller 5b1e472431 Clean up aml::Handler 2025-04-25 10:16:08 -06:00
bjorn3 2cebcade9f Remove duplicate files 2025-04-23 20:05:33 +02:00
bjorn3 2c96332aa7 Add 'initfs/' from commit 'd0802237d7894881df7ddd338dfc64220d0646ff'
git-subtree-dir: initfs
git-subtree-mainline: bb25f45f43
git-subtree-split: d0802237d7
2025-04-23 19:56:49 +02:00
bjorn3 bb25f45f43 Remove unnecessary .gitignore 2025-04-23 17:21:52 +02:00
bjorn3 e72e49840a Don't include bootstrap in the main workspace 2025-04-21 19:08:46 +02:00
bjorn3 cf3d7a74f6 Add 'bootstrap/' from commit '6898d8b14c078805b7b0b6c4b5d9359ca911bbc6'
git-subtree-dir: bootstrap
git-subtree-mainline: 16e0cb79b9
git-subtree-split: 6898d8b14c
2025-04-21 19:03:38 +02:00
4lDO2 6898d8b14c Filter out trailing NUL bytes when renaming procs. 2025-04-21 18:34:25 +02:00
Jeremy Soller 0fed1bf2c0 Merge branch 'orphan_sighup' into 'master'
Implement SIGCONT+SIGHUP on exit when new pgrp becomes orphaned.

See merge request redox-os/bootstrap!19
2025-04-21 16:20:14 +00:00
4lDO2 fd80526dc6 Implement SIGCONT+SIGHUP on exit when new pgrp becomes orphaned. 2025-04-21 13:58:39 +02:00
4lDO2 7f08436bb0 Return EBADFD/ECHILD in waitpid, not ESRCH. 2025-04-21 13:46:03 +02:00
4lDO2 74eb75f0e7 Fix EACCES check. 2025-04-20 16:50:45 +02:00
4lDO2 bb570062e5 Allow making setpgid return EACCESS, e.g. after execv. 2025-04-20 16:35:25 +02:00
4lDO2 6e89e4528b Enforce stricter setpgid checks. 2025-04-20 16:15:18 +02:00
Jeremy Soller 1c5d322614 Merge branch 'iopl_lib' into 'master'
Use capability-based interfaces for iopl and virttophys

See merge request redox-os/drivers!267
2025-04-19 18:13:23 +00:00
Jeremy Soller c2b25e100c Merge branch 'procmgr' into 'master'
Implement process manager

See merge request redox-os/bootstrap!18
2025-04-19 18:13:01 +00:00
4lDO2 883b05b899 Use redox-os/relibc git dep. 2025-04-19 20:10:04 +02:00
Jeremy Soller 16e0cb79b9 Merge branch 'audiod' into 'main'
Remove thisproc from audiod mkns.

See merge request redox-os/base!11
2025-04-19 18:05:14 +00:00
4lDO2 5c43f39641 Update syscall 2025-04-19 19:30:57 +02:00
4lDO2 0c72bd778d Use redox-os/syscall git dep. 2025-04-19 19:29:17 +02:00
4lDO2 47784aa56d Update redox-rt. 2025-04-19 18:50:31 +02:00
4lDO2 fa8aa2857b Remove thisproc from audiod mkns. 2025-04-19 14:08:04 +02:00
4lDO2 10a41dbcf3 Synchronize kernel proc attrs properly. 2025-04-19 13:17:48 +02:00
4lDO2 02e9a2a19c Update redox_scheme. 2025-04-19 12:53:06 +02:00
4lDO2 c6de9f768c Make thread fds Weak; reparent to init, not ppid. 2025-04-19 12:52:18 +02:00
4lDO2 1b092a11d5 Add /scheme/proc/ps handler for reading info. 2025-04-19 12:52:18 +02:00
4lDO2 7fc0f04f03 Store process name. 2025-04-19 12:52:18 +02:00
4lDO2 ba823cf5f1 Add ProcCall::Getppid and implement reparenting. 2025-04-19 12:52:17 +02:00
4lDO2 5cbcb06727 Fix ECHILD check and reap, fixing bash. 2025-04-19 12:52:17 +02:00
4lDO2 771993b260 Potential fix for KillThread for sig>32. 2025-04-19 12:52:17 +02:00
4lDO2 3e58f6ad16 Mod sig_idx by 32. 2025-04-19 12:52:17 +02:00
4lDO2 486c8496b5 Add missing kill uid checks. 2025-04-19 12:52:17 +02:00
4lDO2 26371995cb Fix kill(getpid(), ...). 2025-04-19 12:52:17 +02:00
4lDO2 c881b14698 Allow indicating 'exited from signal'. 2025-04-19 12:52:17 +02:00
4lDO2 898c5268ef Fix misc TODOs. 2025-04-19 12:52:17 +02:00
4lDO2 4b27f83bf9 Handle both 'any' and 'any pgid-matching' child in waitpid. 2025-04-19 12:52:17 +02:00
4lDO2 713ba3b23d Import sig numbers from redox_rt rather than syscall. 2025-04-19 12:52:16 +02:00
4lDO2 baeb9d0f9c Add reference to NLnet project. 2025-04-19 12:52:16 +02:00
4lDO2 0036fffd82 WIP: Recognize SIGKILL and unhandled exceptions. 2025-04-19 12:52:16 +02:00
4lDO2 8784fb5010 Handle stop signals correctly for orphaned pgrps, fixing bash. 2025-04-19 12:52:16 +02:00
4lDO2 7bebb711d3 Properly return EINVAL if sig>64. 2025-04-19 12:52:16 +02:00
4lDO2 dd53cebf91 Implement Sigdeq, fixing sigqueue test. 2025-04-19 12:52:16 +02:00
4lDO2 b4d42897d8 Return ERESTART when caller kills itself. 2025-04-19 12:52:16 +02:00
4lDO2 f6898a0e45 Pass exit status to waitpid correctly. 2025-04-19 12:52:16 +02:00
4lDO2 4ff5ddb242 Update Cargo.lock. 2025-04-19 12:52:15 +02:00
4lDO2 3f54d0c80c Remove unnecessary debug. 2025-04-19 12:50:46 +02:00
4lDO2 368fe1c186 Do not internally spawn exit() dying thread was last. 2025-04-19 12:50:46 +02:00
4lDO2 7edba6b84b Fix fd mismatch for thread event handling. 2025-04-19 12:50:46 +02:00
4lDO2 b7cb70859f Implement ThreadCall::SignalThread. 2025-04-19 12:50:46 +02:00
4lDO2 9c590bf369 Fix waitpid hang for exception-caused termination. 2025-04-19 12:50:46 +02:00
4lDO2 9441775331 Embed Id in VirtualId. 2025-04-19 12:50:46 +02:00
4lDO2 d59597b3dd Add TODO for proc termination without explicit exit. 2025-04-19 12:50:46 +02:00
4lDO2 ab3f59b22b Reacquire thread fd as procmgr-managed before exec init. 2025-04-19 12:50:45 +02:00
4lDO2 53705b7049 Some fixes. 2025-04-19 12:50:45 +02:00
4lDO2 362daf5ca9 Add SIGCHLD logic. 2025-04-19 12:50:45 +02:00
4lDO2 7845d74df1 Impl SIGCONT and SIGSTOP. 2025-04-19 12:50:45 +02:00
4lDO2 a47396e2b9 Fix SyncTctl and SyncPctl. 2025-04-19 12:50:45 +02:00
4lDO2 7902fc7c4d Add thread handle type, thus wrapping open_via_dup. 2025-04-19 12:50:45 +02:00
4lDO2 ae05abf69d Fix two instances of double RefCell borrow. 2025-04-19 12:50:45 +02:00
4lDO2 bdf9563688 Make setresugid atomic. 2025-04-19 12:50:45 +02:00
4lDO2 8434aa9fd8 Add ThisGroup selector for kill. 2025-04-19 12:50:45 +02:00
4lDO2 4d18d17dd2 Remove redundant match arm. 2025-04-19 12:50:44 +02:00
4lDO2 b4f717bac6 Implement setresugid. 2025-04-19 12:50:44 +02:00
4lDO2 0c5b47e677 Phase out static mut for global allocator. 2025-04-19 12:50:44 +02:00
4lDO2 a2861753de Implement setsid. 2025-04-19 12:50:44 +02:00
4lDO2 ae63c54988 Implement getsid. 2025-04-19 12:50:44 +02:00
4lDO2 a0fc7febfc Make send_signal code compile. 2025-04-19 12:50:44 +02:00
4lDO2 fbbb27b0e5 Tmp disable kill and wrap Process in Rc. 2025-04-19 12:50:44 +02:00
4lDO2 a7df1a1734 progress. 2025-04-19 12:50:44 +02:00
4lDO2 19cb1c0512 WIP: start implementing kill. 2025-04-19 12:50:44 +02:00
4lDO2 fd3a9f9a94 Add stub for kill and sigq. 2025-04-19 12:50:43 +02:00
4lDO2 443c49f6c5 Implement most of getpgid and setpgid. 2025-04-19 12:50:43 +02:00
4lDO2 0a1e1b2f9c Implement new-thread. 2025-04-19 12:50:43 +02:00
4lDO2 80ed3c47d1 Use inner loop to handle multiple reqs per event. 2025-04-19 12:50:43 +02:00
4lDO2 e5a97a68c9 Use log crate. 2025-04-19 12:50:43 +02:00
4lDO2 fdbc00b0fc Pass status in waitpid. 2025-04-19 12:50:43 +02:00
4lDO2 bdb665d897 Ensure new_awoken are handled before event queue wait. 2025-04-19 12:50:43 +02:00
4lDO2 ddc47a7e43 Fix incorrect waitpid request pid. 2025-04-19 12:50:43 +02:00
4lDO2 7e8b8d7183 Make it compile. 2025-04-19 12:50:43 +02:00
4lDO2 016c60c11f Fix most errors. 2025-04-19 12:50:42 +02:00
4lDO2 cbe00a9be8 Impl waitpid further, still does not compile. 2025-04-19 12:50:42 +02:00
4lDO2 82d59302c8 Impl basic state machine for proc exit. 2025-04-19 12:50:42 +02:00
4lDO2 edb8d80d43 Add lookup event id => (thread, pid). 2025-04-19 12:50:42 +02:00
4lDO2 547b50e4b0 Successfully await thread death in exit impl. 2025-04-19 12:50:42 +02:00
4lDO2 910c714b46 Rename procmngr => procmgr. 2025-04-19 12:50:42 +02:00
4lDO2 5fba53023e Add event queue. 2025-04-19 12:50:42 +02:00
4lDO2 2293828906 WIP: waitpid handler. 2025-04-19 12:50:42 +02:00
4lDO2 84b4d1f274 Implement basic state machines, add setrens. 2025-04-19 12:50:42 +02:00
4lDO2 a839c8f259 Update redox-scheme. 2025-04-19 12:50:40 +02:00
4lDO2 063430f7ac Sync kernel ctxt attrs in fork. 2025-04-19 12:49:35 +02:00
4lDO2 737d87cf9d Reach init fork. 2025-04-19 12:49:35 +02:00
4lDO2 3dbd606086 Reach init with proc manager. 2025-04-19 12:49:35 +02:00
4lDO2 b4a7992074 Support reading metadata from process. 2025-04-19 12:49:35 +02:00
4lDO2 9f0ddc83f4 WIP: write skeleton for fork, new-thread 2025-04-19 12:49:35 +02:00
4lDO2 eecd046709 TODO: start writing proc manager 2025-04-19 12:49:35 +02:00
4lDO2 72978e963e Patch redox-rt, syscall. 2025-04-19 12:49:26 +02:00
Jeremy Soller a4a575f445 Merge branch 'pty_fixes' into 'main'
Use libredox for kill and reduce unsafe

See merge request redox-os/base!10
2025-04-18 12:35:23 +00:00
4lDO2 514741898c pty scheme fixes 2025-04-18 10:07:00 +02:00
4lDO2 cd4b7ef228 Update deps. 2025-04-17 16:13:17 +02:00
4lDO2 6ff8c9fd9a Handle level of indirection with procmgr thread fds. 2025-04-13 21:22:45 +02:00
4lDO2 96ca98c9b6 Replace virttophys by fd-based interface. 2025-04-13 21:22:45 +02:00
4lDO2 657bf13d7c Use library call for iopl. 2025-04-13 21:22:45 +02:00
Jeremy Soller 4663044e84 Merge branch 'arm64_fixes' into 'master'
Arm64 fixes

See merge request redox-os/drivers!265
2025-04-12 12:56:49 +00:00
bjorn3 1d43e39b0e pcid: Handle #address-cells on interrupt parent 2025-04-12 14:55:17 +02:00
bjorn3 7625dcd0ce pcid: Avoid legacy scheme path format 2025-04-12 14:54:50 +02:00
Jeremy Soller 11c22d29e1 Merge branch 'acpid_graceful_exit' into 'master'
acpid: Gracefully exit on non-ACPI systems

See merge request redox-os/drivers!264
2025-04-12 12:16:43 +00:00
bjorn3 328f96bd8f acpid: Gracefully exit on non-ACPI systems 2025-04-12 14:13:57 +02:00
Jeremy Soller cf978300a6 Merge branch 'update_redox_rt' into 'master'
Update redox-rt to fix arm64

See merge request redox-os/bootstrap!17
2025-04-12 12:10:08 +00:00
bjorn3 9bcc884820 Update redox-rt to fix arm64 2025-04-12 14:08:55 +02:00
Jeremy Soller 88b97cd6b1 Merge branch 'netstack_cancellation' into 'main'
Implement cancellation for netstack.

See merge request redox-os/base!9
2025-04-10 19:24:37 +00:00
4lDO2 50b4e524b1 Implement cancellation for netstack. 2025-04-10 21:00:26 +02:00
Jeremy Soller d925c7cc78 Merge branch 'readiness_based' into 'main'
Implement cancellation, reduce boilerplate, and update redox-scheme

See merge request redox-os/base!8
2025-04-07 18:42:28 +00:00
4lDO2 a750766d67 Implement cancellation, using ReadinessBased. 2025-04-07 16:41:34 +02:00
Jeremy Soller 6c261e8606 Merge branch 'log_runtime_add_sink' into 'master'
graphics/fbbootlogd: Tell logd to use us as log sink

See merge request redox-os/drivers!263
2025-04-06 19:23:44 +00:00
Jeremy Soller d3a73a990a Merge branch 'log_runtime_add_sink' into 'main'
logd: Add api to add new sink sources at runtime

See merge request redox-os/base!7
2025-04-06 19:23:29 +00:00
bjorn3 fb99ff5fa5 log: Add fixme about backfilling 2025-04-06 20:15:37 +02:00
bjorn3 d318679112 graphics/fbbootlogd: Tell logd to use us as log sink 2025-04-06 20:11:47 +02:00
Jeremy Soller 34b1e9d70a Merge branch 'late_disable_graphic_debug' into 'master'
graphics/vesad: Disable kernel graphical debug as late as possible

See merge request redox-os/drivers!262
2025-04-06 17:54:07 +00:00
bjorn3 034d76ffd5 logd: Add api to add new sink sources at runtime
This will allow logd to be started before fbbootlogd.
2025-04-06 19:42:02 +02:00
bjorn3 d20dd30ccf Move logd to redox-scheme 0.5 2025-04-06 19:10:49 +02:00
bjorn3 65c23ed77d graphics/vesad: Disable kernel graphical debug as late as possible 2025-04-06 17:12:10 +02:00
Jeremy Soller 03d48797be Merge branch 'fix_warnings' into 'main'
Fix a bunch of warnings

See merge request redox-os/base!6
2025-04-06 14:35:28 +00:00
bjorn3 ef7154ee72 Fix a bunch of warnings 2025-04-06 16:19:49 +02:00
Jeremy Soller 3bf5930b3c Merge branch 'redox-scheme' into 'main'
Migrate dnsd to redox-scheme

See merge request redox-os/base!5
2025-04-06 13:29:40 +00:00
4lDO2 dda88e3a3b Migrate dnsd to redox-scheme. 2025-04-05 18:47:01 +02:00
Jeremy Soller e22c5b099b Merge branch 'virtio_gpu_cursor_changes' into 'master'
Handle vt switching for cursors without requiring a cursor update

See merge request redox-os/drivers!261
2025-04-04 19:25:36 +00:00
bjorn3 f1b5ba52ed Rustfmt 2025-04-04 20:41:31 +02:00
bjorn3 215b8185c2 Handle vt switching for cursors without requiring a cursor update
This requires storing the cursor state on the driver-graphics side to be
be able to restore the correct state for the target vt.
2025-04-04 20:37:43 +02:00
bjorn3 abab5c9a3c Avoid passing unused fields to VIRTIO_GPU_CMD_MOVE_CURSOR 2025-04-04 20:25:57 +02:00
bjorn3 03cf0955d2 Move cursor resource writing to driver-graphics 2025-04-04 20:04:25 +02:00
Jeremy Soller 5559bb1fe1 Merge branch 'master' into 'master'
adding support for gpu cursor

See merge request redox-os/drivers!260
2025-04-03 21:21:33 +00:00
Dimitar Gjorgievski de4cc6ed4a adding support for gpu cursor 2025-04-03 21:21:32 +00:00
Jeremy Soller ea6e864a5c Merge branch 'misc_changes' into 'main'
Couple of improvements

See merge request redox-os/base!4
2025-03-31 20:27:08 +00:00
bjorn3 72d04da8a9 init: Improve command spawning
The stdout and stderr of the spawned processes are not captured by init,
so attempting to write captured input is useless. Also show the exit
code in case the child process returned an non-zero exit code.
2025-03-31 20:11:32 +02:00
Jeremy Soller a813d93001 Reduce some logging 2025-03-31 08:11:44 -06:00
bjorn3 8286249ff7 Remove unreachable dup impls
Dup calls with an empty path never reach scheme implementations
2025-03-30 17:51:07 +02:00
bjorn3 83c8234808 Fix building audiod 2025-03-30 17:38:49 +02:00
bjorn3 efd4ce9677 Integrate audiod in the root workspace 2025-03-30 17:17:10 +02:00
bjorn3 0c84b07315 Add 'audiod/' from commit 'f3489c48758bcad5f986df0799c18e9322d2a222'
git-subtree-dir: audiod
git-subtree-mainline: 3004381623
git-subtree-split: f3489c4875
2025-03-30 17:15:47 +02:00
4lDO2 3ba8c99915 Fix rustfmt CI and make bcm2835-sdhcid compile. 2025-03-30 16:45:55 +02:00
Jacob Lorentzon 1e6bb89dce Merge branch 'rtcd' into 'master'
Add a userspace RTC driver for x86 PCs

See merge request redox-os/drivers!76
2025-03-30 14:38:16 +00:00
4lDO2 af1dd1e78e Add a userspace RTC driver for x86 PCs.
The reason behind this is that an RTC driver should ideally consult ACPI
tables before assuming any I/O ports exist, which userspace can do much
better.
2025-03-30 16:37:04 +02:00
Jeremy Soller 1da621d0a2 Merge branch 'nvme-executor' into 'master'
Integrate nvmed executor with reactor, moving towards thread-per-core

See merge request redox-os/drivers!155
2025-03-29 14:03:50 +00:00
4lDO2 a180c5893f Make ahcid compile. 2025-03-29 10:19:05 +01:00
4lDO2 6353fc73b4 Make ided and lived compile. 2025-03-29 10:19:05 +01:00
4lDO2 49333114e4 rustfmt. 2025-03-29 10:19:05 +01:00
4lDO2 4beb420953 Update dependencies. 2025-03-29 10:19:05 +01:00
4lDO2 6b0d4da2a2 Remove 'async' Cargo feature from nvmed. 2025-03-29 10:19:05 +01:00
4lDO2 ab549721e9 Use async executor for nvmed. 2025-03-29 10:19:05 +01:00
4lDO2 fd28f5123c Add a hw-based async framework for block drivers. 2025-03-29 10:19:02 +01:00
Jeremy Soller cd4cc3e519 Only fetch language IDs if required 2025-03-28 21:18:38 -06:00
Jeremy Soller f58625b035 usbhubd/xhcid: fix port status for USB 3 hubs 2025-03-28 20:45:01 -06:00
Jeremy Soller cbbcbc9ec3 usbhubd/xhcid: fix reading descriptor on USB 3 hubs 2025-03-28 18:27:29 -06:00
Jeremy Soller ba0ca4ce05 Also fix packet size on USB 1 2025-03-28 18:02:18 -06:00
Jeremy Soller 8dcd85b546 Fix packet size for USB 3.0 2025-03-28 17:48:47 -06:00
Jeremy Soller 53a629ebd4 Merge branch 'fix-scheme' into 'master'
Use redox-scheme 0.2.3 and cargo update

See merge request redox-os/bootstrap!16
2025-03-26 22:50:13 +00:00
Ron Williams 416b6e486f Use redox-scheme 0.2.3 and cargo update 2025-03-26 14:53:14 -07:00
Jeremy Soller 59edc11bee xhcid: prepare for getting protocol speed from hubs 2025-03-22 20:00:07 -06:00
Jeremy Soller 145d6b355a Fix reading hub descriptor on real hardware 2025-03-21 16:32:06 -06:00
Jeremy Soller a5f87735d2 xhcid: ignore alternate settings 2025-03-21 16:31:44 -06:00
Jeremy Soller 7c9801379d xhcid: use lang id when reading string descriptors 2025-03-21 15:41:53 -06:00
Jeremy Soller 5afc5c9de4 xhcid: adjust logging 2025-03-21 14:45:06 -06:00
Jeremy Soller f0d39b872d xhcid: fix usage of portsc rwc bits 2025-03-21 13:58:56 -06:00
Jeremy Soller 58bd24da8c Support addressing of hub devices 2025-03-21 10:15:36 -06:00
Jeremy Soller 2c349f7eb0 Cleanup to allow enumeration requests on any port id 2025-03-20 21:32:50 -06:00
Jeremy Soller e3a13a0ce7 xhcid and friends: use newtype PortId to ensure route string can be passed where needed 2025-03-20 21:27:17 -06:00
Jeremy Soller 68760cf5af Improve USB hub driver 2025-03-20 13:24:45 -06:00
Jeremy Soller 2299bb0b27 xhcid: fix panic when no ssc is available 2025-03-20 13:24:16 -06:00
Jeremy Soller 980414e7e7 usbhidd: fix configuration request 2025-03-20 11:51:58 -06:00
Jeremy Soller bbac3ff4f4 Merge branch 'fix_damage' into 'master'
graphics/console-draw: Fix damage calculation

See merge request redox-os/drivers!259
2025-03-15 21:42:00 +00:00
Jeremy Soller 0d21e3617d Merge branch 'less_verbose_boot' into 'master'
Reduce verbosity of debug logs during booting

See merge request redox-os/drivers!258
2025-03-15 21:41:35 +00:00
bjorn3 7e6534ff35 graphics/console-draw: Fix damage calculation 2025-03-15 22:09:14 +01:00
bjorn3 fb24979c51 Reduce verbosity of debug logs during booting
These logs are only useful when actively working on the respective driver.
2025-03-15 21:09:12 +01:00
Jeremy Soller 0481ab9ebe Merge branch 'single_damage_area' into 'master'
graphics: Only allow passing a single damage area at a time

See merge request redox-os/drivers!257
2025-03-15 19:17:52 +00:00
bjorn3 f48ae933ff graphics: Only allow passing a single damage area at a time
Currently only fbbootlogd and fbcond make use of support for multiple
damage areas and they are not all that performance critical anyway.
Orbital always passes a single damage area per write call. Out of all
graphics drivers we have and are likely to get only vesad could
potentially benefit from fine-grained damage areas. This commit doesn't
significantly impact performance of fbcond.
2025-03-15 18:49:59 +01:00
Jeremy Soller 1b6d847d2f Merge branch 'fbbootlogd_improvements' into 'master'
Bunch of fbbootlogd and fbcond changes

See merge request redox-os/drivers!256
2025-03-15 16:48:11 +00:00
Jeremy Soller 3004381623 Merge branch 'nonblocking_log' into 'main'
logd: Don't block receiving log messages on writing previous ones

See merge request redox-os/base!3
2025-03-15 16:47:50 +00:00
bjorn3 ffbfecbdb0 graphics/fbcond: Make it robust against initial graphics driver being broken 2025-03-15 17:30:39 +01:00
bjorn3 87d71bc708 graphics/fbbootlogd: Merge Display into FbbbootlogScheme 2025-03-15 17:27:14 +01:00
bjorn3 54113f8fde graphics/fbbootlogd: Make it robust against initial graphics driver being broken 2025-03-15 17:21:23 +01:00
bjorn3 9290cffa70 graphics/fbbootlogd: Extract handle_handoff method 2025-03-15 17:18:28 +01:00
bjorn3 b9d043f6e2 inputd: Add ConsumerHandle::read_events 2025-03-15 17:09:45 +01:00
bjorn3 56808dbfb1 graphics/fbbootlogd: Remove input events background thread 2025-03-15 16:53:58 +01:00
bjorn3 943cbe3707 graphics/fbbootlogd: Remove workaround that prevents blocking on the graphics driver
Instead logd will no longer block on fbbootlogd to prevent the deadlock
that this worked around.
2025-03-15 16:53:44 +01:00
bjorn3 400371eaf9 logd: Don't block receiving log messages on writing previous ones
This avoid a deadlock when the process logging things is directly or
indirectly involved in receiving them too. Currently there is a
workaround for a part of this problem in fbbootlogd, but doing it
directly in logd is a lot simpler and catches more cases.
2025-03-15 16:23:51 +01:00
Jeremy Soller 1d3a1a432b Merge branch 'update_redox_scheme' into 'master'
Update to redox-scheme 0.4

See merge request redox-os/drivers!255
2025-03-14 21:22:52 +00:00
bjorn3 5d76acfd74 Update to redox-scheme 0.4 2025-03-14 22:11:30 +01:00
Jeremy Soller 3f9904e370 Merge branch 'remove_pcspkrd' into 'master'
Remove pcspkrd

See merge request redox-os/drivers!254
2025-03-13 19:11:48 +00:00
Jeremy Soller 7d927bd708 Merge branch 'fix_damage_clipping' into 'master'
graphics/graphics-ipc: Fix Damage::clip

Closes #51

See merge request redox-os/drivers!253
2025-03-13 18:21:01 +00:00
bjorn3 d5692c2855 Remove pcspkrd
The PC speaker device is not a general purpose audio device, but only
capable of playing beeps. While pcspkrd does currently get built, it
never actually gets started at startup. There is also no program
anywhere inside Redox OS capable of playing any sound through pcspkrd.
And finally basically the thing it is used for on modern systems is to
emit a beep when pressing backspace in a VT while there is no input
buffered. I personally find that beep rather annoying and have disabled
the Linux counterpart to pcspkrd on my system because of this.
2025-03-13 19:19:41 +01:00
bjorn3 7bb1693e86 graphics/graphics-ipc: Fix Damage::clip 2025-03-13 19:04:28 +01:00
Jeremy Soller f3489c4875 Merge branch 'remove_legacy_path_usage' into 'master'
Avoid usage of legacy scheme path format

See merge request redox-os/audiod!3
2025-03-13 17:50:57 +00:00
bjorn3 d1b6802e50 Avoid usage of legacy scheme path format 2025-03-13 18:45:22 +01:00
Jeremy Soller f04725f9b1 Merge branch 'remove_legacy_path_usage' into 'master'
inputd: Avoid usage of legacy scheme path format

See merge request redox-os/drivers!252
2025-03-13 16:26:45 +00:00
Jeremy Soller eed287f31b Merge branch 'bgad_scheme' into 'master'
Move bgad and xhcid to redox-scheme

See merge request redox-os/drivers!251
2025-03-13 16:26:23 +00:00
bjorn3 c627024cd6 inputd: Avoid usage of legacy scheme path format 2025-03-13 17:22:20 +01:00
bjorn3 374e5fbfab xhcid: Use redox-scheme 2025-03-13 17:00:54 +01:00
bjorn3 f2d3d16455 graphics/bgad: Use redox-scheme 2025-03-13 17:00:54 +01:00
bjorn3 09ef96ae80 graphics/drivers-graphics: Fix some comments and remove no longer necessary feature 2025-03-13 17:00:54 +01:00
Jeremy Soller 451480a3e0 xhcid: do not panic if unable to find configuration descriptor 2025-03-13 08:41:23 -06:00
bjorn3 1c4fdcfc1a Integrate netstack in the root workspace 2025-03-10 20:57:58 +01:00
bjorn3 96bf7b02a2 Add 'netstack/' from commit 'ad9d652062ebe90682e96cb4a80d09760f48a457'
git-subtree-dir: netstack
git-subtree-mainline: 9fae54dc2b
git-subtree-split: ad9d652062
2025-03-10 20:55:36 +01:00
Jeremy Soller ad9d652062 Merge branch 'update_smoltcp' into 'master'
Update smoltcp and use CUBIC congestion control

See merge request redox-os/netstack!55
2025-03-10 12:37:48 +00:00
Jeremy Soller d7b41e0bd4 Merge branch 'remove_gitmodules' into 'master'
Remove .gitmodules

See merge request redox-os/netstack!54
2025-03-10 12:37:32 +00:00
bjorn3 d7c128684d Use CUBIC as TCP congestion controller
Support for TCP congestion control has been introduced in smoltcp 0.12.
Smoltcp supports Reno and CUBIC. Of the two CUBIC has higher throughput.
Enabling the socket-tcp-cubic feature is enough to default to CUBIC.

With this change pkg install libgcc is about 35% faster than previously
without congestion control. (5.5MiB/s vs 4MiB/s previously)
2025-03-09 20:13:16 +01:00
bjorn3 b92be2e7d9 Update to smoltcp 0.12 2025-03-09 20:13:16 +01:00
bjorn3 c56cf43d22 Update to smoltcp 0.11 2025-03-09 20:13:16 +01:00
bjorn3 44e3cb0f81 Remove .gitmodules
Forgot to remove this in the last MR.
2025-03-09 19:15:51 +01:00
Jeremy Soller cbf43ede3d Merge branch 'improvements' into 'master'
Couple of improvements

See merge request redox-os/netstack!53
2025-03-09 18:01:58 +00:00
Jeremy Soller f91f3926cf Merge branch 'fix_usb_harddrive' into 'master'
Bunch of improvements to usb storage

See merge request redox-os/drivers!250
2025-03-09 18:00:42 +00:00
bjorn3 f4243538b3 Remove dependency on byteorder 2025-03-09 18:29:12 +01:00
bjorn3 5d2742813b Remove no longer necessary extern crate 2025-03-09 18:24:44 +01:00
bjorn3 26cf9bc961 Fix a couple of warnings 2025-03-09 18:23:32 +01:00
bjorn3 576136d01c Rustfmt 2025-03-09 17:47:42 +01:00
bjorn3 023459391c Remove unused dependency patch 2025-03-09 17:46:33 +01:00
bjorn3 da0b284646 Remove unused smoltcp submodule 2025-03-09 17:46:15 +01:00
bjorn3 674b8c6724 xhcid: Fix a bunch of things to make usb storage work
configuration_value is not an index into config_descs, so scan for a
config_desc with the right configuration_value instead. And fix get_desc
getting confused by companion descriptors.
2025-03-09 17:04:25 +01:00
bjorn3 258ea4e6a5 storage/usbscsid: Use the unified disk scheme implementation 2025-03-09 17:04:25 +01:00
bjorn3 9800c57133 storage/driver-block: Fix couple of error condition checks 2025-03-09 17:04:25 +01:00
Jeremy Soller 5c374ab4e2 Merge branch 'unify_disk_scheme_handling' into 'master'
Mostly unify disk scheme implementations

See merge request redox-os/drivers!249
2025-03-08 22:45:40 +00:00
bjorn3 269fd9abc0 storage/lived: Use the unified disk scheme implementation 2025-03-08 22:52:36 +01:00
bjorn3 865ca86666 storage: Mostly unify disk scheme implementations
lived and usbscsid still keep their old scheme implementations.
2025-03-08 13:06:31 +01:00
bjorn3 c68a50faf2 storage: Move irq methods out of the scheme structs 2025-03-08 12:38:14 +01:00
Jeremy Soller 4a0b0bdf14 Merge branch 'storage_cleanup' into 'master'
Deduplicate a fair bit of code between block device drivers

See merge request redox-os/drivers!248
2025-03-08 01:36:49 +00:00
bjorn3 60a141b51c storage: Move most partition handling into DiskWrapper 2025-03-07 22:49:22 +01:00
bjorn3 b1dcda4cf7 storage/nvmed: Use DiskWrapper 2025-03-07 22:35:01 +01:00
bjorn3 371e8c0326 storage/virtio-blkd: Use DiskWrapper 2025-03-07 22:22:21 +01:00
bjorn3 9d27fad3d5 storage/driver-block: Make DiskWrapper generic over the disk type
This allows it to contain non-'static disks.
2025-03-07 22:22:21 +01:00
bjorn3 d0a7aed2fd storage/virtio-blk: Introduce VirtioDisk type 2025-03-07 22:22:20 +01:00
bjorn3 dfe23b0683 storage/driver-block: Make Disk::block_length infallible
It should be read when creating the struct implementing Disk and every
disk needs to have some block length.
2025-03-07 21:35:49 +01:00
bjorn3 f01a8c8d3e storage: Use DiskWrapper::pt in nvmed and virtio-blkd 2025-03-07 20:58:01 +01:00
bjorn3 ebdfc89e7a storage/nvmed: Pass NvmeNamespace by value and remove the separate nsid arguments 2025-03-07 20:46:33 +01:00
bjorn3 aacf09cef4 storage/driver-block: Remove id method from Disk trait 2025-03-07 20:42:41 +01:00
bjorn3 03329430b4 storage/driver-block: Handle block_read read buffer internally 2025-03-07 20:34:33 +01:00
Jeremy Soller 2fc0008db0 Merge branch 'partitionlib_improvements' into 'master'
Vendor and cleanup partitionlib

See merge request redox-os/drivers!247
2025-03-07 01:51:31 +00:00
Jeremy Soller b4d82c82bf Merge branch 'graphics_driver_api_refactor' into 'master'
A bunch of improvements to the graphics subsystem

See merge request redox-os/drivers!246
2025-03-07 01:50:35 +00:00
bjorn3 9257cbbfa2 storage/partitionlib: Couple of cleanups 2025-03-06 22:48:10 +01:00
bjorn3 398103e710 storage/partitionlib: Rustfmt 2025-03-06 22:18:21 +01:00
bjorn3 f6c3be42e7 storage: Vendor partitionlib to make it easier to change 2025-03-06 22:18:08 +01:00
bjorn3 be5b865058 graphics: Rename resource to framebuffer
This matches the Linux DRM name.
2025-03-06 21:41:26 +01:00
bjorn3 92295f2ea4 graphics/graphics-ipc: Use u32 fields in Damage
The fields should never be negative and this saves a couple of casts.
2025-03-06 20:49:21 +01:00
bjorn3 ee3382aed0 graphics/virtio-gpud: Add helper to submit a fenced request
This is necessary for implementing hardware cursor support.
2025-03-06 20:49:20 +01:00
bjorn3 fc92f0b0ce graphics: Rename the legacy graphics API to the v1 graphics API
It is quite likely that the next graphics API won't be the last one and
as such would become a legacy API too. Consistently using version
numbers makes it easier to refer to the exact version you mean.
2025-03-06 20:49:20 +01:00
bjorn3 972e19e900 graphics: Always pass damage to graphics drivers
This way the drivers don't have to special case switching between VTs.
2025-03-06 20:49:17 +01:00
bjorn3 88cfa76e2c graphics: Merge set_scanout and flush_resource into update_plane
The old api was pretty virtio-gpu specific. The new api is closed to how
atomic mode setting on Linux works.
2025-03-06 20:48:41 +01:00
Jeremy Soller 9fae54dc2b Merge branch 'ramfs_sys_call' into 'main'
Use new redesigned redox-scheme in ramfs.

See merge request redox-os/base!2
2025-03-03 23:34:47 +00:00
4lDO2 897fabcbcd Use new redesigned redox-scheme in ramfs. 2025-03-04 00:33:08 +01:00
Jeremy Soller b17933f382 Merge branch 'fmt_all' into 'master'
Format all packages in fmt.sh

See merge request redox-os/drivers!245
2025-03-03 17:44:21 +00:00
Jeremy Soller 2b014e1330 Merge branch 'vt_to_go' into 'master'
Implicitly create a new VT for each consumer

See merge request redox-os/drivers!244
2025-03-03 17:42:10 +00:00
bjorn3 f26fdd7592 Format all packages in fmt.sh 2025-03-02 22:00:36 +01:00
bjorn3 e9d8d7ceaf Implicitly create a new VT for each consumer
Instead of requiring the graphics driver to create a fixed set of VTs in
advance. This fixes the graphical interface when there is a graphics
driver but no boot framebuffer. Previously in that case vesad would exit
before it creates any VT and thus no consumer could show anything as
their VT was missing. In the future creating new VTs on the fly could
also allow a display manager to use a separate VT for each user session.
2025-03-02 20:28:34 +01:00
Jeremy Soller 2e82009412 Merge branch 'centralize_error_handling' into 'master'
Make all pcid_interface methods abort the process on errors

See merge request redox-os/drivers!242
2025-03-02 18:45:17 +00:00
Jeremy Soller f9bbabf431 Merge branch 'inputd_improvements' into 'master'
A whole bunch of inputd improvements

See merge request redox-os/drivers!243
2025-03-02 18:44:47 +00:00
bjorn3 39dd9118c0 graphics/fbcond: Handle missing graphics driver at startup 2025-03-02 19:19:08 +01:00
bjorn3 67e9f29804 inputd: switch_vt is infallible 2025-03-02 18:57:10 +01:00
bjorn3 085a6e32c6 inputd: Unify early and non-early handle opening 2025-03-02 17:37:14 +01:00
bjorn3 f8972400ee inputd: Move handoff logic to fn open 2025-03-02 17:36:41 +01:00
bjorn3 ec442b87a3 inputd: Use a single global display rather than have a per-vt display selection 2025-03-02 17:24:37 +01:00
bjorn3 cd193f2aed inputd: Unconditionally perform handoff for all vts together
In preparation for having a single set of graphics drivers for all vts.
2025-03-02 17:24:18 +01:00
bjorn3 a0a8401e8d inputd: Inline a couple of functions 2025-03-02 16:33:39 +01:00
bjorn3 de0239d3ed inputd: Automatically switch to first vt once created 2025-03-02 16:33:39 +01:00
bjorn3 9779d1884e inputd: Remove the active vt check before post_fevent
No input is added to pending anyway when the vt for the consumer isn't
the active vt anyway.
2025-03-02 16:33:38 +01:00
bjorn3 e7fe3183b0 Make all pcid_interface methods abort the process on errors
Effectively the only way to recover from errors in the communication
with pcid is by restarting the driver from scratch possibly after
restarting pcid. As such moving the aborts from individual drivers to
pcid_interface simplifies drivers while at the same time allowing nicer
error messages.
2025-03-02 12:36:35 +01:00
Jeremy Soller e5af02928e Merge branch 'graphics_improvements' into 'master'
Various graphics subsystem improvements

See merge request redox-os/drivers!241
2025-03-01 20:41:40 +00:00
bjorn3 fe31bd0578 inputd: Remove deactivate event
It is no longer useful now that virtio-gpud permanently takes over
control of the display when it starts.
2025-03-01 20:00:29 +01:00
bjorn3 4f2268bbfe graphics/vesad: Exit gracefully when there is no boot framebuffer 2025-03-01 19:54:33 +01:00
bjorn3 2a71d48a76 inputd: Don't crash when receiving input while there is no active vt 2025-03-01 19:24:30 +01:00
bjorn3 d26ee5a58d graphics/fbbootlogd: Handle non-existent graphics adapter
This ensures a serial console shows up with all non-graphics related
daemons started when there is no framebuffer passed by the bootloader.
2025-03-01 19:23:56 +01:00
bjorn3 68af18aead graphics/vesad: Make some fields and methods private 2025-03-01 18:23:31 +01:00
bjorn3 91f814a42c graphics/vesad: Simplify sync loop
LLVM should optimize it to pretty much the same code, but using a
regular for loop makes it's behavior clearer.
2025-03-01 18:22:18 +01:00
bjorn3 0c42f431bd graphics/vesad: Merge screen.rs into scheme.rs 2025-03-01 18:09:23 +01:00
Jeremy Soller 1c6e9a045d Merge branch 'pcid-scheme2' into 'master'
Introduce a pci scheme and move driver spawning to pcid-spawner

See merge request redox-os/drivers!240
2025-03-01 16:38:49 +00:00
bjorn3 7dbce70d95 Get rid of the State struct and the Arc wrapper around Pcie 2025-03-01 17:19:06 +01:00
bjorn3 8f1549e284 Introduce a pci scheme and move driver spawning to pcid-spawner
This allows a single PCI daemon to run on the whole system, prevents
multiple drivers from claiming the same PCI device and makes it possible
for userspace to enumerate all available PCI devices. In the future this
will enable an lspci tool, possibly PCIe hot plugging and more.

Co-Authored-By: 4lDO2 <4lDO2@protonmail.com>
2025-03-01 17:18:15 +01:00
Jeremy Soller 64bb3c0dc2 Merge branch 'pcid-scheme-preparations' into 'master'
Various preparations for creating a pci scheme

See merge request redox-os/drivers!239
2025-02-27 19:21:51 +00:00
bjorn3 cffa5308a1 Use pico-args instead of structopt for pcid
It is much lighter weight.

Co-Authored-By: 4lDO2 <4lDO2@protonmail.com>
2025-02-27 20:07:12 +01:00
bjorn3 cd5604a054 Move config from pcid to pcid_interface
This will allow serializing/deserializing to be shared across programs.
For pcid-spawner will need to parse the config files and if we want to
embed config files into the driver executables at some point it may also
be useful.
2025-02-27 20:04:26 +01:00
bjorn3 5b45f06cf3 Extract enable_function out of handle_parsed_header
This is the only part that actually modifies the PCI configuration. In
the future we will want to delay enabling a PCI device until it is
actually going to be used while still reading metadata about the PCI
device before that point.
2025-02-27 20:02:29 +01:00
Jeremy Soller c9b440e0af Merge branch 'simplify_fbbootlogd' into 'master'
Simplify fbbootlogd

See merge request redox-os/drivers!238
2025-02-22 15:41:26 +00:00
bjorn3 31450e5770 graphics/fbbootlogd: Get rid of fevent and tracking handles
Fbbootlogd doesn't do non-blocking operations, so fevent isn't needed.
And the kernel shouldn't pass closed handles to us and even if it does
due to a bug, it is harmless to silently ignore the fact that the handle
was closed.
2025-02-22 16:33:22 +01:00
bjorn3 4b61e7bc86 graphics/fbbootlogd: Inline TextScreen into FbbootlogScheme 2025-02-22 16:33:22 +01:00
Jeremy Soller d83d050c0d Merge branch 'more_repr_packed_fixes' into 'master'
Replace a whole bunch more repr(packed) with repr(C, packed)

See merge request redox-os/drivers!237
2025-02-22 15:27:00 +00:00
Jeremy Soller 30633ca5bb Merge branch 'fix_standalone_driver_network' into 'master'
Fix standalone compilation of driver-network

See merge request redox-os/drivers!236
2025-02-22 15:26:51 +00:00
bjorn3 581d9eea33 Replace a whole bunch more repr(packed) with repr(C, packed) 2025-02-22 16:19:25 +01:00
bjorn3 23497b1148 Fix standalone compilation of driver-network
driver-network does conversions from syscall::Error to std::io::Error
which needs the std feature enabled. Without this change rust-analyzer
would report errors when trying to compile driver-network without any
other crate in the same build to enable the std feature.
2025-02-22 16:13:24 +01:00
Jeremy Soller 93969cd51f Merge branch 'less_direct_physmap' into 'master'
Replace a couple direct uses of physmap with map_bar

See merge request redox-os/drivers!235
2025-02-22 15:09:47 +00:00
bjorn3 23c20b0fa2 Replace a couple direct uses of physmap with map_bar 2025-02-22 16:07:10 +01:00
Jeremy Soller 471b9ebf4f Merge branch 'no_scan_single_function_device' into 'master'
Don't scan through all 8 functions of a single function PCI device

Closes #32

See merge request redox-os/drivers!232
2025-02-22 14:25:54 +00:00
Jacob Lorentzon 6edcba7b25 Merge branch 'less_features' into 'master'
Remove unnecessary feature gates

See merge request redox-os/drivers!234
2025-02-22 13:40:26 +00:00
bjorn3 e973f89139 Remove unnecessary feature gates
Some of these have been stabilized while others were likely no longer
used at all.
2025-02-22 14:38:33 +01:00
Jacob Lorentzon f560929b1b Merge branch 'pcid_correct_mcfg_repr' into 'master'
Make Mcfg repr(C, packed) rather than repr(packed)

See merge request redox-os/drivers!233
2025-02-22 13:33:32 +00:00
bjorn3 6828b744fd Make Mcfg repr(C, packed) rather than repr(packed)
repr(packed) officially still allows reordering the fields.
2025-02-22 14:05:33 +01:00
bjorn3 1cae6512fa Don't scan through all 8 functions of a single function PCI device 2025-02-22 13:57:15 +01:00
bjorn3 15bb765a78 Remove redundant license files 2025-02-21 20:13:23 +01:00
bjorn3 be7109ea02 Add ptyd to the cargo workspace 2025-02-21 20:12:28 +01:00
bjorn3 1b1c6abc62 Add 'ptyd/' from commit '4ba5c4ead35a7e8458af89e565c46c275f304ef4'
git-subtree-dir: ptyd
git-subtree-mainline: b33f98968c
git-subtree-split: 4ba5c4ead3
2025-02-21 20:11:54 +01:00
bjorn3 b33f98968c Add ipcd to the cargo workspace 2025-02-21 20:08:02 +01:00
bjorn3 b0586e9ead Add 'ipcd/' from commit 'e6f672bd48f9ac65a194f804bd0ed64c307f7b67'
git-subtree-dir: ipcd
git-subtree-mainline: 999da13e76
git-subtree-split: e6f672bd48
2025-02-21 20:07:22 +01:00
Jeremy Soller 999da13e76 Merge branch 'on_close' into 'main'
Switch to one-way close message for ramfs.

See merge request redox-os/base!1
2025-02-21 17:51:57 +00:00
4lDO2 c101162b64 Switch to one-way close message for ramfs. 2025-02-21 18:45:13 +01:00
Jeremy Soller 7012dffdf1 Merge branch 'ps2-timeout' into 'master'
ps2d: Use sleep rather than busy-waits for timeouts

See merge request redox-os/drivers!231
2025-02-18 22:19:31 +00:00
bjorn3 8824229b9e Move a couple of files to the top level 2025-02-18 21:35:28 +01:00
bjorn3 0c22306ea4 Add all packages to a workspace 2025-02-18 21:33:33 +01:00
bjorn3 f3c502a336 Add 'zerod/' from commit 'dde32fba345b3dfc770cb37c60c74647529046c8'
git-subtree-dir: zerod
git-subtree-mainline: f25ddc236b
git-subtree-split: dde32fba34
2025-02-18 21:32:19 +01:00
bjorn3 f25ddc236b Add 'randd/' from commit '80e27cb3d923e3a2c91b59122376e18233111a99'
git-subtree-dir: randd
git-subtree-mainline: 2179992ac3
git-subtree-split: 80e27cb3d9
2025-02-18 21:32:14 +01:00
bjorn3 2179992ac3 Add 'ramfs/' from commit '306433d0a553bbea81c7ef92a233d215dff1cf62'
git-subtree-dir: ramfs
git-subtree-mainline: daa4622b38
git-subtree-split: 306433d0a5
2025-02-18 21:32:04 +01:00
bjorn3 daa4622b38 Add 'logd/' from commit 'db36d01782a6b9cc7ec995f884f8c1259d79903e'
git-subtree-dir: logd
git-subtree-mainline: 38c917a56b
git-subtree-split: db36d01782
2025-02-18 21:31:45 +01:00
bjorn3 38c917a56b Add 'init/' from commit '0e7a0d3ab46817915180adbbb775c76d67fee31c'
git-subtree-dir: init
git-subtree-mainline: 57f2dca267
git-subtree-split: 0e7a0d3ab4
2025-02-18 21:31:28 +01:00
toadster172 4898261594 ps2: Use sleep functions for read and write waits 2025-02-17 17:42:51 -06:00
Jeremy Soller 7efb54c6b0 Merge branch 'ihdad-fix' into 'master'
ihdad: Fix initialization procedure

See merge request redox-os/drivers!230
2025-02-08 15:32:39 +00:00
Alice Shelton 7f12a14505 ihdad: Follow spec more closely for state changes 2025-02-08 01:47:52 -06:00
Jeremy Soller 7e798dfe91 Merge branch 'jespersm-master-patch-43825' into 'master'
Fix link to "a-note-about-drivers"

See merge request redox-os/drivers!229
2025-02-06 16:07:33 +00:00
Jesper Møller aa3887d4e7 Fix link to "a-note-about-drivers" 2025-02-04 20:54:40 +00:00
Jeremy Soller 4ba5c4ead3 Merge branch 'scheme-update' into 'master'
Update for latest redox-scheme

See merge request redox-os/ptyd!13
2025-01-13 22:23:18 +00:00
Ron Williams 7a3c03dedd Update for latest redox-scheme 2025-01-13 22:23:18 +00:00
Jeremy Soller 3f67a82d1f Update rust-toolchain 2025-01-13 14:33:28 -07:00
bjorn3 57f2dca267 Initial commit 2025-01-11 14:25:16 +01:00
Ribbon 9ffd72a590 Add README.md 2025-01-09 12:21:02 +00:00
Ribbon 9521cffd6d Add README.md 2025-01-09 12:20:40 +00:00
Ribbon dde32fba34 Add README.md 2025-01-09 12:19:04 +00:00
Ribbon db36d01782 Add README.md 2025-01-09 12:18:48 +00:00
Ribbon 0e7a0d3ab4 Document how to contribute and do development in the README 2025-01-09 12:12:09 +00:00
Ribbon 306433d0a5 Document how to contribute and do development in the README 2025-01-09 12:06:21 +00:00
Ribbon e6f672bd48 Document how to contribute and do development in the README 2025-01-09 12:05:13 +00:00
Ribbon 80e27cb3d9 Add README.md 2025-01-09 12:03:02 +00:00
Ribbon 9c7c874cbc Document how to contribute and do developpment in the README 2025-01-09 11:58:27 +00:00
Ribbon b26aa9b32b Document how to contribute and do development in the README 2025-01-09 11:54:44 +00:00
Jeremy Soller e4ac216fe2 Merge branch 'pcid_cleanup' into 'master'
Remove some dependencies of pcid

See merge request redox-os/drivers!228
2024-12-30 11:46:53 +00:00
bjorn3 898f8dc72b pcid: Remove usage of paw 2024-12-30 11:41:34 +01:00
bjorn3 e6139319e8 pcid: Remove a couple of unused dependencies 2024-12-30 11:40:02 +01:00
Jeremy Soller 4c1c1df0ad Merge branch 'graphics_ipc_crate' into 'master'
graphics: Introduce graphics-ipc crate

See merge request redox-os/drivers!227
2024-12-28 22:45:56 +00:00
Jeremy Soller dcef51fc60 Merge branch 'optimize_damage_tracking' into 'master'
graphics/console-draw: Collapse consecutive damage entries

See merge request redox-os/drivers!226
2024-12-28 22:45:04 +00:00
bjorn3 5fc04c332d graphics: Move Damage from inputd to graphics-ipc 2024-12-28 16:26:18 +01:00
bjorn3 7b11acbc46 graphics: Introduce graphics-ipc crate
While for now this for now only includes helpers for the current limited
display interface which is relatively simple to implement manually, in
the future we will likely need a more complex interface with gpu drivers
that would be hard to get right without a common crate proving the
interface.
2024-12-28 16:21:58 +01:00
bjorn3 5bfce514be graphics/console-draw: Collapse consecutive damage entries 2024-12-28 15:18:55 +01:00
Jeremy Soller d7c98a877a Merge branch 'misc_graphics_cleanups' into 'master'
Various cleanups for the graphics subsystem

See merge request redox-os/drivers!225
2024-12-28 14:14:17 +00:00
bjorn3 5af43fcaa2 graphics/vesad: Merge OffscreenBuffer into GraphicScreen 2024-12-28 14:51:02 +01:00
bjorn3 b5eeaed9e1 graphics/virtio-gpud: Use resource size rather than display size in set_scanout
This ensures we use the right size if the display got resized but the
resource hasn't been resized yet.
2024-12-28 14:32:56 +01:00
bjorn3 0b8648ff5b graphics/virtio-gpud: Move some initialization code around 2024-12-28 14:16:56 +01:00
bjorn3 1ef298e576 graphics/virtio-gpud: Remove getters and setters for ResourceCreate2d 2024-12-28 14:04:10 +01:00
bjorn3 1d89ca7bd2 graphics/virtio-gpud: Remove unnecessary VolatileCell
The virtio queue abstraction already provides the necessary
synchronization to make everything data-race free without volatile
accesses.
2024-12-28 14:01:09 +01:00
bjorn3 9afe3b390b graphics/vesad: Remove all usage of unstable features 2024-12-27 15:57:43 +01:00
bjorn3 ed9ad1aaf1 graphics/vesad: Remove old resizing code
Graphics clients will need to handle resizing themself anyway for
handoff between graphics drivers and as such don't need the graphics
to modify the framebuffer during resize.
2024-12-27 15:57:18 +01:00
Jeremy Soller ee62075339 Merge branch 'unused_dup_impls' into 'master'
Remove all dup impls that only accept empty paths

See merge request redox-os/drivers!220
2024-12-27 14:14:23 +00:00
bjorn3 b1743d800c Remove all dup impls that only accept empty paths
Those dups are handled by the kernel already by creating a new reference
to the underlying file descriptor.
2024-12-27 15:13:42 +01:00
Jeremy Soller 91f76826c0 Merge branch 'fix_multiple_virtio_displays' into 'master'
graphics/virtio-gpud: Don't crash when multiple displays are attached

See merge request redox-os/drivers!224
2024-12-27 14:13:00 +00:00
bjorn3 d7becba023 graphics/virtio-gpud: Don't crash when multiple displays are attached 2024-12-27 15:11:15 +01:00
Jeremy Soller fed2e0fb40 Merge branch 'driver_graphics_crate' into 'master'
Add driver-graphics crate

See merge request redox-os/drivers!223
2024-12-27 14:03:27 +00:00
bjorn3 d2f1af9ca7 Add driver-graphics crate
This unifies the driver interface handling between graphics drivers and
makes it easier to change all graphics drivers in lockstep when adding
new features.
2024-12-27 12:47:43 +01:00
Jeremy Soller 365a018bb1 Merge branch 'virtio_gpud_refactor' into 'master'
Various virtio-gpud improvements

See merge request redox-os/drivers!222
2024-12-27 01:32:28 +00:00
bjorn3 b7f4af9bd2 graphics/virtio-gpud: Bring scheme impl closer in line with vesad 2024-12-26 22:19:35 +01:00
bjorn3 6f188cf7ef graphics/fbcond: Unmap old offscreen buffer on handoff and resize 2024-12-26 21:58:41 +01:00
bjorn3 bf6e16c8c9 graphics/console-draw: Slightly simplify TextScreen::write 2024-12-26 21:58:07 +01:00
bjorn3 3fbf0fecbb graphics/console-draw: Fix resizing to a smaller display
Without this commit ransid would generate move events with an
underflowed height which take forever to process.
2024-12-26 21:57:41 +01:00
bjorn3 1b6feeb7c7 graphics/virtio-gpud: Use VM window size as display size
Rather than hard coding 1920x1080. This doesn't yet handle resizing the
VM window at runtime though.
2024-12-26 20:59:08 +01:00
bjorn3 3ed3ff2edb graphics/fbcond: Handle framebuffer resize during handoff 2024-12-26 20:57:53 +01:00
bjorn3 09de72e9a8 common: Fix mmap overwriting unintended memory in Sgl
If unaligned_length is for example 8193, the initial reservation would
be rounded up to the next page resulting in 12288. However the physmap
would previously round up to the next power of two forming 16384,
potentially overwriting one page of data directly after the reservation.
In case of bigger allocations, more pages could be overwritten.
2024-12-26 20:50:44 +01:00
bjorn3 62f1a80c3e graphics/virtio-gpud: Move resources from Display to GpuScheme
Resources are global for the entire virtio-gpud device, not local to a
single display. In the future resource creation will become entirely
detached from specific displays.
2024-12-26 17:53:45 +01:00
bjorn3 2344206c21 graphics/virtio-gpud: Bundle resource id and resource mapping 2024-12-26 17:36:40 +01:00
Jeremy Soller 65d84afea6 Merge branch 'unused_imports' into 'master'
Fix a ton of unused import warnings

See merge request redox-os/drivers!219
2024-12-26 15:55:10 +00:00
Jeremy Soller 921c6b07f9 Merge branch 'driver_network_redox_scheme' into 'master'
Use redox-scheme in driver-network

See merge request redox-os/drivers!218
2024-12-26 15:54:44 +00:00
bjorn3 2c042f8c98 Fix a ton of unused import warnings 2024-12-26 16:05:04 +01:00
bjorn3 8eabb75524 Update redox-scheme to 0.3.0 2024-12-26 15:50:30 +01:00
bjorn3 20cd7b6dcd driver-network: Use handle flags and offset stored by the kernel 2024-12-26 15:50:10 +01:00
bjorn3 c4dbcbecf2 Use redox-scheme in driver-network 2024-12-26 15:50:09 +01:00
Jeremy Soller be6e942a08 Merge branch 'split_fbbootlogd' into 'master'
graphics: Introduce a separate daemon for the boot log

See merge request redox-os/drivers!217
2024-12-24 21:31:00 +00:00
bjorn3 12fc959737 graphics/fbcond: Move blocking operations back to the main thread
With fbbootlogd split out it is no longer essential to avoid blocking
operations on the main thread of fbcond. Moving them back to the main
thread simplifies things a fair bit.
2024-12-24 21:39:41 +01:00
bjorn3 4e2f1a730c graphics: Introduce a separate daemon for the boot log
The daemon responsible for the boot log must never ever block to avoid
deadlocks, but doing so while still accepting keyboard input is
non-trivial. This commit splits the boot log out from fbcond into a
separate daemon to make this a lot easier to implement. This will also
allow making fbcond blocking again, which will simplify some things.
2024-12-24 21:39:41 +01:00
Jeremy Soller 911f966e15 Merge branch 'input_improvements' into 'master'
Couple of graphics and input subsystem refactorings

See merge request redox-os/drivers!216
2024-12-24 19:37:59 +00:00
bjorn3 5a1648fdca graphics/fbcond: Migrate to redox-scheme 2024-12-24 16:56:11 +01:00
bjorn3 f4897c59b4 graphics/fbcond: Inline some helpers 2024-12-24 16:34:25 +01:00
bjorn3 aa35e573cf input: Introduce ProducerHandle type 2024-12-24 15:28:56 +01:00
bjorn3 e3eb5fbb5d input/ps2d: Use redox_event 2024-12-24 15:28:56 +01:00
bjorn3 0789069afc input: Move all input drivers to a subdirectory 2024-12-24 15:28:56 +01:00
Jeremy Soller 9cf225fdc1 Merge branch 'misc_changes' into 'master'
graphics: Couple of misc changes

See merge request redox-os/drivers!215
2024-12-24 14:17:43 +00:00
bjorn3 84eed1ad0e graphics: Introduce new ConsumerHandle type
This type has a method to open the current display.
2024-12-24 14:49:42 +01:00
bjorn3 a82fa31437 graphics/fbcond: Get display path in the background thread 2024-12-24 14:49:42 +01:00
bjorn3 a88f2c4b53 graphics/vesad: Remove support for reading resize events
Nobody actually listens for them from vesad itself anyway. Instead they
listen for them from inputd.
2024-12-24 14:49:42 +01:00
Jeremy Soller a09d0fb761 Merge branch 'fix_vesad_damage_clip' into 'master'
vesad: Fix damage clipping

See merge request redox-os/drivers!214
2024-12-23 20:33:50 +00:00
bjorn3 db9ee0a495 vesad: Fix damage clipping
oops
2024-12-23 21:29:57 +01:00
Jeremy Soller 4c1658bbfe Merge branch 'graphics_handover' into 'master'
graphics: Implement handoff from vesad to virtio-gpud

See merge request redox-os/drivers!213
2024-12-23 19:10:21 +00:00
bjorn3 05a6058131 Rustfmt 2024-12-23 19:05:00 +01:00
bjorn3 0019eecadd virtio-gpud: Don't process flush requests for background VT's
This ensures that the foreground VT doesn't lockup if a background VT
spams us with flush requests. In the future we may want to add a
scheduler or collapse redundant flush requests.
2024-12-23 19:02:24 +01:00
bjorn3 025086acd1 virtio-gpud: Add offset method to XferToHost2d
This will hopefully avoid confusion if someone in the future changes the
XferToHost2d in flush to pass a smaller GpuRect. Without adjusting
offset this would cause glitches.
2024-12-23 19:02:24 +01:00
bjorn3 f6cc7d25df graphics: Unify damage clipping 2024-12-23 19:02:24 +01:00
bjorn3 f2156d4654 graphics: Optimize the damage buffer api
It is now possible to write multiple damage locations in a single write
call. Vesad also no longer processes damage for background vt's. The
entire framebuffer will be redrawn once the vt switches to the
foreground anyway. And finally fsync now consistently redraws the entire
screen rather than having different behavior between vesad and
virtio-gpud.
2024-12-23 19:02:24 +01:00
bjorn3 4c4ab2de44 graphics: Implement handoff from vesad to virtio-gpud
With this virtio-gpud no longer has to support getting deactivated at
any time to hand back control to vesad. This makes it much easier to add
many new features that a proper graphics driver is supposed to support.

Be aware that virtio-gpud waits for the vsync on every flush request.
Fbcond and orbital are not really happy about this right now and when
something changes multiple times within a single frame, flush requests
queue up, causing the ui to hang until all flush requests are finished.
It is still possible to switch to another VT though which won't hang.
2024-12-23 18:59:18 +01:00
Jeremy Soller 8df2350641 Merge branch 'virtio_gpud_multiple_vts' into 'master'
virtio-gpud: Handle multiple VT's

See merge request redox-os/drivers!212
2024-12-23 17:02:29 +00:00
bjorn3 b9189b91cf virtio-gpud: Couple minor improvements 2024-12-23 13:40:09 +01:00
bjorn3 b0f682c95d virtio-gpud: Handle multiple VT's
The code will become simpler once handoff is implemented such that
virtio-gpud no longer needs to support reset and reinitialization of the
virtio gpu device.
2024-12-23 13:40:09 +01:00
bjorn3 31deddd0d5 virtio-gpud: Claim a new VT
Before these changes virtio-gpud effectively didn't do anything and
vesad's framebuffer was kept instead.
2024-12-23 12:50:41 +01:00
Jeremy Soller f954cd4ab7 Merge branch 'fbcond_nonblocking' into 'master'
fbcond: Make sure we never block on the graphics driver

See merge request redox-os/drivers!211
2024-12-22 20:13:22 +00:00
bjorn3 c97652a508 fbcond: Make sure we never block on the graphics driver
To prevent deadlocks if the graphics driver in turn tries to write to
fbcond for log messages.
2024-12-22 19:56:04 +01:00
bjorn3 5f7ee8f646 Use inputd's Damage everywhere instead of separate SyncRect types 2024-12-22 19:48:27 +01:00
bjorn3 15cee6bb48 fbcond: Resize ransid console on every write
This is necessary to correctly handle async changes to the framebuffer
size in the future.
2024-12-22 18:37:13 +01:00
bjorn3 99a00abeca fbcond: Split a couple of helper functions out of open_vt 2024-12-22 18:08:32 +01:00
Jeremy Soller 8b601fb155 Merge branch 'inputd_pull_vt_events' into 'master'
inputd: Major refactorings to the inputd interface

See merge request redox-os/drivers!210
2024-12-22 16:56:49 +00:00
Jeremy Soller 78256bad96 Merge branch 'migrate_gpu_drivers_to_redox_scheme' into 'master'
Migrate gpu drivers to redox-scheme

See merge request redox-os/drivers!209
2024-12-22 16:56:01 +00:00
bjorn3 8e92e2c743 inputd: Let graphics drivers pull vt activation events from inputd
Previously inputd would directly push vt activation events to the
graphics driver, which required being quite lazy to prevent deadlocks as
well as the graphics driver having a location where events can be pushed
to. By having graphics drivers pull the vt activation events instead,
the effective control flow becomes simpler and it becomes easier to
correctly handle multiple graphics drivers on the system. For example it
becomes possible for multiple graphics drivers to present displays for a
single VT as well as making it easier to provide a handoff from the
early framebuffer to a real graphics driver.
2024-12-22 17:18:24 +01:00
bjorn3 273cbda872 inputd: Split ControlHandle and DisplayHandle
ControlHandle is used to switch the active vt, while DisplayHandle is
used by display drivers to register new vt's. There are entirely
unrelated tasks and the fact that they had been merged together has been
confusing me for a while.

Also changed activating a VT to no longer create a new vt when none
existed previously. The target graphics driver may not be able to handle
the new VT. inputd -A already didn't allow activating non-existent VT's
as it first tried to open a consumer handle for the target VT.
2024-12-22 16:46:02 +01:00
bjorn3 436a16b069 virtio-gpud: Migrate to redox-scheme 2024-12-22 16:44:27 +01:00
bjorn3 7565720f34 vesad: Migrate to redox-scheme 2024-12-22 16:43:17 +01:00
Jeremy Soller d6b1e5d435 Merge branch 'fix-33-debug-building' into 'master'
fix: MAX_DURATION overflows on init

Closes #33

See merge request redox-os/netstack!52
2024-12-22 02:26:30 +00:00
Jeremy Soller 64ede1f3d5 Merge branch 'inputd_redox_scheme' into 'master'
Various inputd improvements

See merge request redox-os/drivers!208
2024-12-22 02:26:13 +00:00
bjorn3 3c00151d49 inputd: Remove the vt handle mutex 2024-12-21 16:15:19 +01:00
bjorn3 cf84e71220 inputd: Use std's concurrency primitives instead of spin 2024-12-21 16:00:34 +01:00
bjorn3 08f619bc22 inputd: Remove usage of Arc for Vt
Storing the vt index instead of a direct reference to the vt is just as
easy.
2024-12-21 15:58:07 +01:00
bjorn3 6a1cb33105 inputd: Misc changes 2024-12-21 15:52:36 +01:00
bjorn3 f4193c6886 inputd: Avoid panic when client tried to perform invalid operation 2024-12-21 15:43:23 +01:00
bjorn3 0b2111b029 Port inputd to redox-scheme 2024-12-21 14:53:12 +01:00
Josh Megnauth b53fb068f5 fix: MAX_DURATION overflows on init
Closes: #33

`Duration` is stored as microseconds internally.

The original code caused an overflow by...

```rust
Duration::from_millis(u64::MAX);
```

...which caused `u64::MAX` to be multiplied by 1000 and overflow.
2024-12-21 02:41:57 -05:00
Jeremy Soller 1d2f3b4836 Merge branch 'irq' into 'master'
Fix Raspberry 3

See merge request redox-os/drivers!207
2024-12-18 18:20:41 +00:00
Andrey Turkin 63b1d2cf8a bcm2835-sdhcid: remap mmio range as instructed by DTB 2024-12-18 21:16:33 +03:00
Andrey Turkin e5e753a426 Sync up with changes to kernel's phandle irq scheme 2024-12-18 21:16:30 +03:00
Andrey Turkin 2f9e28e23e Rerun cargo fmt to bring CI back to norm 2024-12-18 21:16:17 +03:00
Jeremy Soller 25f69e9906 Merge branch 'steffengy-master-patch-92205' into 'master'
Respond only to ARP requests addressed to device via either broadcast or unicast

See merge request redox-os/netstack!51
2024-12-03 21:40:51 +00:00
Steffen Butzer 49abe218ab Respond only to ARP requests addressed to device via either broadcast or unicast
Previous behavior would reply to other IPs that only match the subnet with our (IP, MAC) pair
but not respond to unicast requests addressed with an unknown (all zeroes) MAC or broadcast requests.
2024-11-26 19:02:21 +00:00
Jeremy Soller 5cf8bfda72 xhcid: remove transfer states on dead rings 2024-11-11 14:27:32 -07:00
Jeremy Soller 842fc73a34 Track all drivers launched for a port 2024-11-11 12:51:22 -07:00
Jeremy Soller 191c7973a9 Fix deadlock in xhcid detach_device 2024-11-11 12:10:01 -07:00
Jeremy Soller 6044ca0471 Merge branch 'fix_deadlock_in_usb_driver' into 'master'
Fixed the deadlock by only addressing devices in response to attach requests....

See merge request redox-os/drivers!199
2024-11-05 17:35:57 +00:00
Timothy Finnegan 4dedbac4e5 Fixed the deadlock by only addressing devices in response to attach requests.... 2024-11-05 17:35:57 +00:00
Jeremy Soller 3f33cb96e7 usbhidd: update rehid 2024-11-04 20:19:18 -07:00
Jeremy Soller 8a36c994e1 Add hwd 2024-11-04 20:19:08 -07:00
Jeremy Soller 6ff633863e Allow usbhidd to run on multiple interfaces 2024-11-04 16:15:53 -07:00
Jeremy Soller 2975f93f30 acpid: fix compilation on riscv64gc 2024-10-31 10:53:05 -06:00
Jeremy Soller e765d9c8e1 acpid: only build dmar for x86_64 2024-10-30 20:43:46 -06:00
Jeremy Soller 71b70482d3 acpid: Only acquire I/O port rights on x86 2024-10-30 14:01:20 -06:00
Jeremy Soller 42970953fc Fix acpid compilation on non-x86 2024-10-30 13:52:19 -06:00
Jeremy Soller 382b298453 acpid: provide buffer contents from amlserde 2024-10-29 18:34:27 -06:00
Jeremy Soller 621456ed0e Merge branch 'riscv' into 'master'
Remap PCI IRQs as instructed in FDT

See merge request redox-os/drivers!206
2024-10-22 18:39:13 +00:00
Andrey Turkin 8152de14a9 Remap PCI IRQs as instructed in FDT 2024-10-22 20:33:35 +03:00
Jeremy Soller 67f4ca3d73 Update redox-scheme 2024-10-18 07:32:38 -06:00
Jeremy Soller ea8ac9ad5f Merge branch 'stage' into 'master'
Initial RISC-V support

See merge request redox-os/drivers!205
2024-10-18 01:46:52 +00:00
Andrey Turkin 18b688a49c Partial risc-v support 2024-10-17 20:07:17 +03:00
Andrey Turkin 09b5033fbd Wholesale cargo fmt to get CI back to green 2024-10-17 20:07:05 +03:00
Jeremy Soller faf62b7a78 Merge branch 'deps' into 'master'
Bump dependencies

See merge request redox-os/ipcd!9
2024-10-17 13:03:28 +00:00
Jeremy Soller fab7a65ee3 Merge branch 'deps' into 'master'
Bump dependencies

See merge request redox-os/randd!14
2024-10-17 13:00:12 +00:00
Jeremy Soller 10e38e1571 Merge branch 'deps' into 'master'
Bump dependencies

See merge request redox-os/ramfs!10
2024-10-17 12:59:52 +00:00
Jeremy Soller d4535e51fe Merge branch 'deps' into 'master'
Bump dependencies

See merge request redox-os/netstack!50
2024-10-17 12:58:25 +00:00
Andrey Turkin bbd282f480 Bump dependencies 2024-10-17 09:07:44 +03:00
Andrey Turkin 2988e1e097 Bump dependencies 2024-10-17 08:48:16 +03:00
Andrey Turkin 662615b32d Bump dependencies 2024-10-17 08:45:24 +03:00
Andrey Turkin 2a3fb788df Bump dependencies 2024-10-17 08:11:02 +03:00
Jeremy Soller 3891c09081 Merge branch 'riscv' into 'master'
RISC-V target

See merge request redox-os/bootstrap!15
2024-10-16 17:13:06 +00:00
Andrey Turkin 508f566fea RISC-V target 2024-10-16 19:35:44 +03:00
Ribbon 17b2f5eab1 Add a description section and a template on the "COMMUNITY-HW.md" document 2024-10-10 14:30:33 +00:00
Ribbon c1d1ab6031 Merge branch 'community-hw' into 'master'
Move the community hardware tracking issue to the "COMMUNITY-HW.md" document

See merge request redox-os/drivers!204
2024-10-10 14:12:02 +00:00
Ribbon c5c87169ef Move the community hardware tracking issue to the "COMMUNITY-HW.md" document 2024-10-10 14:12:02 +00:00
Jeremy Soller 790539f962 Fix compilation with latest redox-scheme 2024-10-09 11:51:05 -06:00
Jeremy Soller 4b5a784237 Update dependencies 2024-10-09 11:49:01 -06:00
Jeremy Soller fb06d3782f Fix build on aarch64 2024-10-06 09:58:37 -06:00
Jacob Lorentzon e9d755a281 Merge branch 'deps' into 'master'
Bump dependencies

See merge request redox-os/init!14
2024-10-05 16:35:11 +00:00
Andrey Turkin b465daf518 Bump dependencies 2024-10-05 19:21:58 +03:00
Jacob Lorentzon d355a74e99 Merge branch 'master' into 'master'
Bump dependencies

See merge request redox-os/zerod!6
2024-10-05 16:11:42 +00:00
Andrey Turkin d68f0d40a3 Bump dependencies 2024-10-05 19:09:23 +03:00
Jacob Lorentzon ff730a41b2 Merge branch 'riscv' into 'master'
Bump dependencies

See merge request redox-os/logd!5
2024-10-05 16:07:21 +00:00
Andrey Turkin 50842448dc Bump dependencies 2024-10-05 18:24:31 +03:00
Jeremy Soller 12a3258619 Merge branch 'kek/acpid-scheme' into 'master'
acpid: serialize symbols with RON, migrate to redox_scheme, import syscall::io

See merge request redox-os/drivers!201
2024-09-30 16:51:32 +00:00
Kamil Koczurek e49fae6533 chore: fmt.sh 2024-09-30 13:22:34 +02:00
Kamil Koczurek 56bfd63173 acpid: update to redox_scheme
* Change symbol serialization to RON
2024-09-30 13:22:24 +02:00
Kamil Koczurek d2c82add9d Move Io/Pio/Mmio from redox_syscall to common
* Fix Mmio repr from transparent to packed.
* Rename Mmio::from to Mmio::new.
* Remove dead imports around affected code.
* Minor formatting.
2024-09-30 13:01:36 +02:00
Jeremy Soller ea5ccbc84d Merge branch 'ivan/mmc_update_scheme' into 'master'
migrate bcm2835-sdhcid to v2 scheme protocol

See merge request redox-os/drivers!202
2024-09-29 12:51:07 +00:00
Ivan Tan 897cf31893 migrate bcm2835-sdhcid to v2 scheme protocol 2024-09-29 09:36:36 +00:00
Jeremy Soller aa6cc8f7a5 Merge branch 'kek/bump-redox-rt' into 'master'
Implement initfs symlinks; bump redox-rt

See merge request redox-os/bootstrap!14
2024-09-23 17:12:31 +00:00
Jeremy Soller 82a69478aa Merge branch 'kek/default-scheme' into 'master'
Use set_default_scheme to control resolution of absolute paths

See merge request redox-os/init!13
2024-09-23 17:12:12 +00:00
Kamil Koczurek e0c153a5ed Switch to newest redox-rt 2024-09-23 17:02:42 +02:00
Jeremy Soller c805dbb704 Merge branch 'add_assertion_to_pci_driver' into 'master'
Add Non-Null Check to common driver library to prevent a kernel crash due to an unitialized PCI BAR

See merge request redox-os/drivers!200
2024-09-21 02:25:38 +00:00
Timothy Finnegan 806e8b42b7 Added an assertion to map_bar that causes the calling driver to panic rather than crash the kernel 2024-09-20 18:42:03 -07:00
Timothy Finnegan 306bb7d698 Added an assertion to map_bar that causes the calling driver to panic rather than crash the kernel 2024-09-20 18:39:25 -07:00
Kamil Koczurek 23fa812de1 Use set_default_scheme to control resolution of absolute paths 2024-09-20 21:03:04 +02:00
Jeremy Soller d0802237d7 Merge branch 'kek/symlinks' into 'master'
Add symlink support

See merge request redox-os/redox-initfs!3
2024-09-17 17:23:11 +00:00
Kamil Koczurek 873062c1c2 Document missing support for non-utf8 paths 2024-09-14 22:41:58 +02:00
Kamil Koczurek 7005f5ee65 Specify pathdiff version 2024-09-14 12:29:55 +02:00
Kamil Koczurek f0dec135b9 Add symlink support
* Implement symlinks
  * Initfs only has links with absolute paths.
  * Relative links are assumed to be relative to link location.
  * Absolute paths must point into the archived location. E.g. if we
    archive /home/foo/data and wish the resultant link to point to
    /scheme/rand, then the absolute link must be
    /home/foo/data/scheme/rand.
* Move archive_common to a crate within the workspace -- Rust doesn't
  seem to accept #[path(..)] attributes with `..` segments anymore so
  tests wouldn't build on my machine.
* Improve the test to assert complete filesystem structure.
* Bump to edition 2021
* cargo fmt & clippy
2024-09-14 12:17:44 +02:00
Jeremy Soller f61461e526 Merge branch 'getdents' into 'master'
Make scheme fully stateless.

See merge request redox-os/ramfs!9
2024-09-13 12:47:24 +00:00
4lDO2 e553969a71 Implement fpath. 2024-09-13 14:45:13 +02:00
4lDO2 8ab2ebb6f0 Make scheme fully stateless.
Stateless in this case means the inode number is sufficient for describing an open file handle.
2024-09-13 14:45:12 +02:00
Jeremy Soller 8bc7703d0f Merge branch 'getdents' into 'master'
Implement getdents

See merge request redox-os/bootstrap!13
2024-09-13 12:42:49 +00:00
4lDO2 0fe6bbcee2 Implement getdents 2024-09-12 10:30:13 +02:00
Jeremy Soller 83b16768dd Merge branch 'document_xhic_daemon' into 'master'
Added some documentation to the XHCI daemon, clarified the scheme interface with a refactor

See merge request redox-os/drivers!198
2024-09-10 00:43:42 +00:00
Timothy Finnegan 39f43a51a1 Added some documentation to the XHCI daemon, clarified the scheme interface with a refactor 2024-09-10 00:43:42 +00:00
4lDO2 65cf406b7d Future-proof: repr(packed) => repr(C, packed). 2024-09-08 21:09:22 +02:00
Jeremy Soller 897866d948 xhcid: switch back to polling and leave TODO 2024-09-06 20:09:04 -06:00
4lDO2 db2322c95c V2 scheme. 2024-09-07 02:01:53 +02:00
4lDO2 1c88eea6c4 Rustfmt, use v2 scheme. 2024-09-07 01:02:03 +02:00
4lDO2 e0f930ad72 Update dependencies, rustfmt, use v2 scheme. 2024-09-07 00:51:02 +02:00
4lDO2 286bd4a7d6 Implement fsize+ftruncate, update, and rustfmt. 2024-09-06 15:48:39 +02:00
Jeremy Soller b29d2c7c9e xhcid: switch back to interrupts 2024-09-04 15:00:35 -06:00
Jeremy Soller 640e548972 Use 0.0.0.0 as default IP to fix DHCP on real system 2024-09-04 14:55:48 -06:00
Jeremy Soller 50b1ad7e28 Merge branch 'create_rustdocs_for_drivers' into 'master'
Created docs for drivers/common

See merge request redox-os/drivers!197
2024-09-01 12:56:14 +00:00
Jeremy Soller a803c123cc Merge branch 'pr_templates_in_drivers_repo' into 'master'
Copied the merge request templates from the core repo to the drivers repo such...

See merge request redox-os/drivers!196
2024-09-01 12:51:22 +00:00
Jeremy Soller cdc02104ea Merge branch 'update_gitignore_to_add_local_editor_config_directories' into 'master'
Update gitignore to add local editor config directories

See merge request redox-os/drivers!195
2024-09-01 12:50:51 +00:00
Timothy Finnegan 1ce1949416 Ran rustfmt to re-format my changes 2024-08-31 16:19:58 -07:00
Timothy Finnegan f2decff457 Added link wrappers around the wikipedia link in SGL 2024-08-31 16:17:13 -07:00
Timothy Finnegan e9e7e2934e Added documentation for the dma, logger, and sgl modules 2024-08-31 16:16:35 -07:00
Timothy Finnegan d7852b4836 Created docs for common/src/lib.rs 2024-08-31 14:48:35 -07:00
Timothy Finnegan 32ba2f1f19 Copied the merge request templates from the core repo to the drivers repo such that PRs have those templates available to them 2024-08-31 12:17:36 -07:00
Timothy Finnegan 24c01b1760 Added comments describing additions to the gitignore 2024-08-31 12:11:05 -07:00
Timothy Finnegan ffb1f7dcd0 Added various C/C++ and Rust editor directories to the gitignore 2024-08-31 12:09:25 -07:00
Jeremy Soller f404d64f13 Merge branch 'no_seek' into 'master'
Replace seek() with fsize().

See merge request redox-os/ramfs!8
2024-08-30 21:35:38 +00:00
4lDO2 8faf127894 Replace seek() with fsize(). 2024-08-30 21:22:00 +02:00
Jeremy Soller 2980e15280 Merge branch 'no_legacy_scheme' into 'master'
Update redox_event

See merge request redox-os/ipcd!8
2024-08-19 16:47:50 +00:00
Jeremy Soller 7c5c6faf89 Merge branch 'no_legacy_scheme' into 'master'
Remove all usages of the legacy scheme syntax

See merge request redox-os/ramfs!7
2024-08-19 16:47:41 +00:00
bjorn3 fa97ec8a3b Update redox_event
This remove all usages of the legacy scheme syntax
2024-08-19 18:45:08 +02:00
bjorn3 6f076cd905 Remove all usages of the legacy scheme syntax 2024-08-19 18:36:45 +02:00
Jeremy Soller ab26604894 Merge branch 'no_legacy_scheme' into 'master'
Remove all usages of the legacy scheme syntax

See merge request redox-os/ptyd!12
2024-08-18 22:17:27 +00:00
Jeremy Soller c09063f4f4 Merge branch 'update_redox_log' into 'master'
Update redox-log

See merge request redox-os/drivers!194
2024-08-18 22:14:46 +00:00
bjorn3 e2361f8ef1 Remove all usages of the legacy scheme syntax 2024-08-18 21:51:31 +02:00
bjorn3 0afc2f9875 Update redox-log
This removes a couple of uses of the legacy scheme syntax
2024-08-18 21:20:49 +02:00
Jeremy Soller 37a2234afd Merge branch 'common_logging_setup' into 'master'
Deduplicate setup_logging between all drivers

See merge request redox-os/drivers!193
2024-07-24 22:05:22 +00:00
bjorn3 7935ed0248 Deduplicate setup_logging between all drivers
This will make it easier to change the way logging is done for all
drivers. This also fixes the log category for a couple of drivers as
well as makes failing to set the logger a fatal error. Only when a
logger is already set is it impossible to set another logger.
2024-07-24 22:00:40 +02:00
Jeremy Soller 11c5024917 Merge branch 'userspace_disable_graphical_debug' into 'master'
Tell the kernel to disable graphical_debug right before the first framebuffer write by userspace

See merge request redox-os/drivers!192
2024-07-24 19:11:42 +00:00
bjorn3 66c1d0fd88 Tell the kernel to disable graphical_debug right before the first framebuffer write by userspace
Also remove the framebuffer clear in FrameBuffer::new as the entire
framebuffer will be overwritten anyway almost immediately after.
2024-07-24 21:06:29 +02:00
Jeremy Soller c440291e82 Merge branch 'ps2d_redox_log' into 'master'
Use redox-log in ps2d

See merge request redox-os/drivers!190
2024-07-23 19:30:46 +00:00
bjorn3 73c50db678 Use redox-log in ps2d 2024-07-22 12:46:33 +02:00
Jeremy Soller a8e16dbe6c Fix ps2d compilation on i686 2024-07-21 20:56:10 -06:00
Jeremy Soller 46ed176d0a Merge branch 'remove_broken_assertion' into 'master'
Remove an incorrect assertion preventing access to PCI extended capabilities

See merge request redox-os/drivers!191
2024-07-21 19:38:32 +00:00
bjorn3 10f6c16141 Remove an incorrect assertion preventing access to PCI extended capabilities 2024-07-21 21:26:05 +02:00
Jeremy Soller 0dff4eaf5f Merge branch 'rustfmt_more_things' into 'master'
Rustfmt a couple more crates

See merge request redox-os/drivers!189
2024-07-21 12:59:28 +00:00
bjorn3 7eceaaa2bd Rustfmt driver-network and driver-block 2024-07-21 13:56:20 +02:00
bjorn3 4d0008a32b Rustfmt the common crate 2024-07-21 13:56:20 +02:00
Jeremy Soller ca3bf0f0e6 Merge branch 'daemonize_pcid_correctly' into 'master'
Handle daemonization of pcid in a better way

See merge request redox-os/drivers!188
2024-07-20 22:13:49 +00:00
Jeremy Soller f5aaf7f0b8 Merge branch 'remove_display_env' into 'master'
Don't set the DISPLAY env var

See merge request redox-os/init!12
2024-07-20 21:50:57 +00:00
bjorn3 050febc94f Don't set the DISPLAY env var
This is the only case where init sets an env var without the user
instructing it to do so, making it hard to trace back where the env var
originated from. It also only sets it for processes spawned after the
first run.d command for whatever reason. And finally not setting DISPLAY
avoids hard coding knowledge about unrelated system components.
2024-07-20 16:45:41 +02:00
bjorn3 15d2078a13 Handle daemonization of pcid in a better way
Currently pcid exits the main thread once it is done spawning drivers
and expects all background threads handling driver communication to stay
around. This only works as exitting the main thread on redox os
currently doesn't cause the whole process to die. This will have to be
fixed at some point for compatibility with programs that expect that
exitting the main thread kills all other threads in the process, at
which point pcid would break without the changes in this commit.
2024-07-20 15:11:34 +02:00
Jeremy Soller 289f3147ec Merge branch 'various_graphics_cleanups' into 'master'
A variety of cleanups, soundness fixes and other changes to the graphics subsystem

See merge request redox-os/drivers!187
2024-07-19 23:22:01 +00:00
Jeremy Soller cbe102a0d3 Merge branch 'rustfmt_graphics' into 'master'
Run rustfmt on the entire graphics subsystem

See merge request redox-os/drivers!186
2024-07-19 23:21:15 +00:00
bjorn3 2e341fa742 Directly pass FrameBuffer to redraw and sync
This avoids creating an intermediate &'static mut [u32] of questionable
soundness and simplifies the code a bit.
2024-07-19 22:18:34 +02:00
bjorn3 53c02b5322 Move the framebuffer resizing code into a FrameBuffer method 2024-07-19 22:12:48 +02:00
bjorn3 857773393d Ensure fields of SyncRect are not reordered
Without repr(C), repr(packed) technically allows reordering fields.
2024-07-19 21:56:56 +02:00
bjorn3 ef29520cf5 Avoid ptr2int2ptr casts in GraphicScreen::sync
Also use pointer arithmetic on *mut u32 over manual multiplication by 4.
The ptr2int2ptr casts pessimize optimizations.
2024-07-19 21:55:21 +02:00
bjorn3 b33ea2b53a Fix a FIXME in display_fd_unmap
The len method on raw pointers has been stabilized.
2024-07-19 21:50:15 +02:00
bjorn3 1a41bcab14 Enforce formatting in CI 2024-07-19 21:47:47 +02:00
bjorn3 8a91bae0a6 Remove unnecessary unsafe block 2024-07-19 21:25:52 +02:00
bjorn3 747898dfb2 Run rustfmt on the entire graphics subsystem 2024-07-19 21:24:48 +02:00
Jeremy Soller 25a98ba914 Merge branch 'remove_inputd_g' into 'master'
Remove inputd -G

See merge request redox-os/drivers!185
2024-07-19 19:19:38 +00:00
bjorn3 ebb2243538 Remove all traces of VtMode
It isn't used anywhere anymore.
2024-07-19 21:18:09 +02:00
bjorn3 5f1fdec858 Remove inputd -G
Ever since fbcond got moved out of vesad it has been doing the exact
same as inputd -A.
2024-07-19 21:11:02 +02:00
Jeremy Soller 7ddb8e15eb Merge branch 'fix_ps2d_vmmouse_ub' into 'master'
Fix UB in the ps2d vmmouse implementation

See merge request redox-os/drivers!184
2024-07-16 23:30:27 +00:00
bjorn3 1f25a69feb Fix UB in the ps2d vmmouse implementation
The vm call will clobber edi, which is the register in which we saved
the ebx value. Also make sure to preserve the entire rbx value, rather
than just the lower half in ebx.
2024-07-16 15:43:50 +02:00
Jeremy Soller cfabb8945a Merge branch 'fix_inputd' into 'master'
Update deps and fix inputd.

See merge request redox-os/drivers!183
2024-07-16 12:44:41 +00:00
4lDO2 d9e5c6644d Update deps and fix inputd.
Scheme names are not allowed to contain slashes, so it should look for a
`.` in e.g. `display.vesa:/path/to/...`.
2024-07-16 14:17:19 +02:00
Jeremy Soller 94ac220267 Merge branch 'redox-rt' into 'master'
Switch to redox-rt.

See merge request redox-os/bootstrap!11
2024-07-15 15:43:34 +00:00
Jacob Lorentzon c695af7674 Switch to redox-rt. 2024-07-15 15:43:34 +00:00
Jeremy Soller 1710f56e71 Merge branch 'fix_things' into 'master'
Fix fbcon

See merge request redox-os/drivers!182
2024-07-12 12:36:19 +00:00
Jeremy Soller 0d96fe361a Merge branch 'fix_things' into 'master'
Fix things I broke

See merge request redox-os/netstack!49
2024-07-12 12:35:57 +00:00
bjorn3 2fc3923d46 Fix fbcon 2024-07-12 12:05:31 +02:00
bjorn3 6274b07674 Fix things I broke 2024-07-12 11:58:12 +02:00
Jeremy Soller 130dd5c1ad Merge branch 'no_legacy_path' into 'master'
Use the new scheme format in most places

See merge request redox-os/drivers!181
2024-07-11 23:32:35 +00:00
Jeremy Soller 51da6bfc88 Merge branch 'no_legacy_path' into 'master'
Use the new scheme format

See merge request redox-os/netstack!48
2024-07-11 23:31:23 +00:00
Jeremy Soller 9fe6d600f8 Merge branch 'no_legacy_path' into 'master'
Use the new scheme format

See merge request redox-os/ptyd!11
2024-07-11 23:30:53 +00:00
Jeremy Soller 40adaa51e2 Merge branch 'no_legacy_path' into 'master'
Use the new scheme format

See merge request redox-os/bootstrap!12
2024-07-11 23:30:35 +00:00
bjorn3 fd8dabd1bc Use the new scheme format in most places
The graphics subsystem still uses the old format as orbital manually
parses the fpath result.
2024-07-11 21:14:45 +02:00
bjorn3 bafdb3b66a Use the new scheme format 2024-07-11 21:08:12 +02:00
bjorn3 3d03d9969e Use the new scheme format 2024-07-11 21:04:08 +02:00
bjorn3 88338f36f2 Use the new scheme format 2024-07-11 21:02:40 +02:00
Jeremy Soller 21b2e90d50 Merge branch 'bug_fixes' into 'master'
bug fixes

See merge request redox-os/drivers!180
2024-07-09 18:44:41 +00:00
ramla-i 93d5ceb465 bug fixes 2024-07-09 12:55:48 -04:00
Jeremy Soller e7781dcced Fix compilation on aarch64 2024-06-24 11:43:17 -06:00
Jeremy Soller 8d65e05a28 Merge branch 'move_drivers' into 'master'
Move all drivers to /usr/lib/drivers

See merge request redox-os/drivers!179
2024-06-22 16:55:02 +00:00
Jeremy Soller ab0b156159 ps2d: reduce timeouts 2024-06-17 12:42:23 -06:00
bjorn3 4ffed8096d Move all drivers to /usr/lib/drivers
This makes them harder to accidentally run them from the shell, which
would not work. In the future this may also allow embedding the driver
config in the driver executable itself without having to look at all
non-driver executables too.
2024-06-16 17:02:14 +02:00
Jeremy Soller a9bb925f25 Merge branch 'pcid_cleanup9' into 'master'
Don't include source files in two different crates for pcid

See merge request redox-os/drivers!178
2024-06-16 13:32:36 +00:00
bjorn3 07aaf6ea94 pcid: Don't include source files in two different crates
This confuses rust-analyzer.
2024-06-16 15:29:09 +02:00
bjorn3 6d15fbba75 pcid: Move msi from pci to driver_interface 2024-06-16 15:23:32 +02:00
bjorn3 ba6224bc27 pcid: Move VendorSpecificCapability form pci to driver_interface 2024-06-16 15:21:51 +02:00
bjorn3 5c9bbb5c96 pcid: Move PciBar from pci to driver_interface 2024-06-16 15:20:52 +02:00
bjorn3 52d1c0fb4f pcid: Move FullDeviceId from pci to driver_interface 2024-06-16 15:19:14 +02:00
Jeremy Soller 434c3aed7a Merge branch 'pcid_cleanup8' into 'master'
Get rid of PciHeader

See merge request redox-os/drivers!177
2024-06-16 13:05:12 +00:00
bjorn3 16819bc693 pcid: Get rid of PciHeader
It is a reminant of when pci_types wasn't used yet and doesn't simplify
things a lot anymore.
2024-06-16 13:42:45 +02:00
bjorn3 a34266b029 pcid: Remove all PciEndpointHeader methods 2024-06-16 13:33:55 +02:00
bjorn3 6c2fdae08c pcid: Remove all tests of PciHeader 2024-06-16 13:32:11 +02:00
bjorn3 de4d79e69e pcid: Inline PciEndpointHeader::bars 2024-06-16 13:23:27 +02:00
Jeremy Soller 2be445d6d7 Merge branch 'xhcid_slower_polling' into 'master'
Sleep for 2ms on every poll loop in xhcid

See merge request redox-os/drivers!176
2024-06-16 11:21:32 +00:00
bjorn3 160acff5a8 pcid: Move the code in PciHeader::display to other places 2024-06-16 13:20:16 +02:00
Jeremy Soller d3496f4bd4 Merge branch 'virtio_remove_legacy_transport' into 'master'
Remove virtio legacy transport support

See merge request redox-os/drivers!175
2024-06-16 11:19:14 +00:00
Jeremy Soller 073b837a5e Merge branch 'lived' into 'master'
Make lived stateless.

See merge request redox-os/drivers!174
2024-06-16 11:17:51 +00:00
bjorn3 1179d01e76 pcid: Add pretty string for the NVME device type 2024-06-16 13:12:52 +02:00
bjorn3 ae2240ef0f pcid: Remove some PciHeader methods 2024-06-16 13:12:29 +02:00
bjorn3 56000cbd9c pcid: Remove subsystem id from PciEndpointHeader 2024-06-16 13:03:58 +02:00
bjorn3 0d926fb3f7 xhcid: Sleep for 2ms on every poll loop
This significantly reduces cpu usage. On my laptop before this change a
single core would be fully loaded while running at 3-4GHz. With this
change it would only be loaded for about 50% while running at 1-2GHz.
This improves battery lifetime while also preventing the fan from
spinning up to a distracting level.

This shouldn't noticably affect latency given that most keyboards and
mice don't support polling at 500Hz anyway.
2024-06-16 12:04:05 +02:00
bjorn3 fc9331b16a virtio: Remove legacy transport support
Transitional virtio devices (which have both legacy and virtio 1.0
support) have been the default since QEMU 2.7.0, which was released
8 years ago. Basically every non-commercial Linux distro with an older
QEMU has been EOL already.

The legacy transport is also one of the few places where port I/O is
necessary, which is non-trivial to sandbox even once we have IOMMU
support. As it isn't possible to distinguish legacy and modern virtio
devices for pcid, this would mean that all virtio drivers have to be
started as privileged even if it turns out the modern transport is
supported by the VMM.
2024-06-16 11:49:11 +02:00
4lDO2 dd10d77350 Make lived stateless. 2024-06-16 11:27:24 +02:00
Jeremy Soller e1a2e21735 Merge branch 'x86_virtio_modern_transport' into 'master'
Support the modern virtio transport on x86

See merge request redox-os/drivers!173
2024-06-15 21:37:44 +00:00
bjorn3 359f4482dd virtio: Merge the x86 and x86_64 platform specific code 2024-06-15 21:59:10 +02:00
bjorn3 b6a75d0a16 virtio: Support the modern transport on x86 2024-06-15 21:59:10 +02:00
Jeremy Soller be02d70c60 Merge branch 'rustfmt_pcid' into 'master'
Rustfmt pcid

See merge request redox-os/drivers!172
2024-06-15 19:41:09 +00:00
bjorn3 2144eaa62c Rustfmt pcid 2024-06-15 21:38:43 +02:00
Jeremy Soller cd498c1826 Merge branch 'pcid_int_rework' into 'master'
Add PciFunctionHandle::map_bar method

See merge request redox-os/drivers!171
2024-06-15 13:51:20 +00:00
bjorn3 23ac696491 pcid: Add PciFunctionHandle::map_bar method
This will enable the pcid driver interface to safely map the MSI-X table
in the future without having to worry about a BAR being mapped twice.
2024-06-15 15:47:48 +02:00
bjorn3 a3b957c2e5 pcid: Fetch config in PciFunctionHandle::connect_default() 2024-06-15 15:16:09 +02:00
bjorn3 fdb9ea816b pcid: Rename PcidServerHandle to PciFunctionHandle 2024-06-15 15:05:59 +02:00
bjorn3 3299a070f2 pcid: Also return bar size from physmap_mem and use it in two more drivers 2024-06-15 14:01:06 +02:00
Jeremy Soller aaa3b89a1d Merge branch 'pcid_cleanup7' into 'master'
Use pci_types for parsing capabilties

See merge request redox-os/drivers!170
2024-06-15 11:55:03 +00:00
bjorn3 4bd978da7a pcid: Use pci_types for parsing capabilties 2024-06-15 13:45:57 +02:00
bjorn3 2ab2fe7b5e Update to pci_types 0.10.0 2024-06-15 13:41:51 +02:00
Jeremy Soller ac5f839ded Merge branch 'ided' into 'master'
Switch ided to v2 scheme protocol.

See merge request redox-os/drivers!169
2024-06-15 11:29:47 +00:00
4lDO2 ccbc1d6d69 Switch ided to v2 scheme protocol. 2024-06-15 12:14:18 +02:00
Jeremy Soller cec242c73d Merge branch 'schemev2plus' into 'master'
Use new positioned IO interface in disk drivers

See merge request redox-os/drivers!168
2024-06-14 12:31:50 +00:00
4lDO2 05ec7464ea Update syscall. 2024-06-14 14:22:01 +02:00
Jeremy Soller c39ee5a8b4 Merge branch 'schemev2plus' into 'master'
Use new scheme interface for initfs scheme

See merge request redox-os/bootstrap!10
2024-06-14 12:18:17 +00:00
4lDO2 77f7903b66 Update dependencies. 2024-06-14 14:13:10 +02:00
4lDO2 2b146f8778 Properly pass POSITIONED new fd flag. 2024-06-14 13:51:13 +02:00
4lDO2 0058d7c948 Positioned IO. 2024-06-14 13:51:13 +02:00
4lDO2 a366841777 Switch remaining storage daemons to schemev2. 2024-06-14 13:51:13 +02:00
4lDO2 9dee2c12ae Migrate nvmed to schemev2. 2024-06-14 13:51:13 +02:00
4lDO2 0ccf87f357 Use schemev2 for ahcid. 2024-06-14 13:51:08 +02:00
Jeremy Soller 4f86767f03 Merge branch 'initfs_hex_pci_id' into 'master'
Use hex pci id's in initfs.toml

See merge request redox-os/drivers!166
2024-06-14 11:23:30 +00:00
Jeremy Soller 0e5977b868 Merge branch 'pcid_cleanup6' into 'master'
pcid: Replace get_capabilities with get_vendor_capabilities

See merge request redox-os/drivers!167
2024-06-14 11:23:00 +00:00
Jeremy Soller 9d3361d4dd Merge branch 'virtio' into 'master'
Fix vga=virtio by using a scatter-gather list for the framebuffer.

See merge request redox-os/drivers!165
2024-06-14 11:21:46 +00:00
bjorn3 386a63df42 pcid: Replace get_capabilities with get_vendor_capabilities
While this stops returning raw MSI/MSI-X capabilities from
get_capabilities, the same info can be obtained using
fetch_all_features and feature_info.
2024-06-14 11:12:06 +02:00
bjorn3 019779daee Use hex pci id's in initfs.toml
This is consistent with the pcid configs for non-initfs drivers.
2024-06-14 11:06:49 +02:00
4lDO2 7b2f4dda90 Use scatter-gather list for virtio framebuffer.
The current frame allocator limits requests to powers of two, between 4
KiB and 4 MiB. As such, a 8-bit color 1920x1080 framebuffer needs at
least two allocations.
2024-06-14 08:26:19 +02:00
Jeremy Soller 8f98e28e97 Merge branch 'fix_virtio_blkd_empty_disk' into 'master'
virtio-blkd: Do not crash when the disk is empty

See merge request redox-os/drivers!164
2024-06-13 22:44:59 +00:00
Jeremy Soller b26b1e7b7f Merge branch 'pcid_cleanup5' into 'master'
Remove PciFunc

See merge request redox-os/drivers!163
2024-06-13 22:40:43 +00:00
bjorn3 47ce36741e virtio-blkd: Avoid crash on ls /scheme 2024-06-13 21:47:22 +02:00
bjorn3 32bcf25f99 virtio-blkd: Do not crash when the disk is empty 2024-06-13 21:33:11 +02:00
bjorn3 d2084e58cb pcid: Remove PciFunc 2024-06-13 15:06:49 +02:00
bjorn3 d3dc2e0f80 pcid: Remove all PciFunc methods 2024-06-13 14:52:02 +02:00
4lDO2 54f4a76238 Use positioned IO scheme interface. 2024-06-12 17:44:47 +02:00
Jeremy Soller b13b7c8e7c ided: detect when controller is DMA capable 2024-06-12 07:57:54 -06:00
Jeremy Soller 75a9a3b48a Merge branch 'minor_changes' into 'master'
Couple of minor changes

See merge request redox-os/drivers!162
2024-06-11 19:17:15 +00:00
bjorn3 f6a709ee5a pcid: Simplify PciFunc::read_range
This also avoids UB caused by creating a slice of uninitialized u8.
2024-06-11 21:05:25 +02:00
bjorn3 dc33cba4c0 Fix typo 2024-06-11 21:05:09 +02:00
Jeremy Soller 8e67869b96 Merge branch 'pcid_cleanup4' into 'master'
Store decoded MSI info instead of full capability in PciFeatureInfo

See merge request redox-os/drivers!161
2024-06-11 18:09:54 +00:00
4lDO2 74fd559f6e Update redox_scheme. 2024-06-11 18:37:32 +02:00
bjorn3 8e02a87474 pcid: Reduce visibility of MsiCapability and MsixCapability methods 2024-06-11 16:57:58 +02:00
bjorn3 4f583b1cfb Store decoded MSI info instead of full capability in PciFeatureInfo 2024-06-11 16:48:43 +02:00
Jeremy Soller 7a67110109 Merge branch 'pcid_cleanup3' into 'master'
Simplify and refactor handling of MSI/MSI-X

See merge request redox-os/drivers!160
2024-06-10 20:27:54 +00:00
bjorn3 df66633111 pcid: Store decoded MsixInfo instead of full capability in PciFeatureInfo 2024-06-10 21:00:07 +02:00
4lDO2 d9bc645185 Switch to v2 scheme format. 2024-06-10 19:59:01 +02:00
bjorn3 7c112c34dd pcid: Remove some unused methods on MsixCapability 2024-06-10 19:44:12 +02:00
bjorn3 15c9ad1ba6 pcid: Ensure MSI and MSI-X are not enabled at the same time 2024-06-10 19:44:12 +02:00
bjorn3 588bbfe6a3 pcid: Stop returning feature enable status from fetch_all_features
For the same reason the feature_status method was removed.
2024-06-10 19:44:12 +02:00
bjorn3 e14e56349f pcid: Remove method to get the current feature status
Devices should never change the feature status behind the back of the
driver, so storing the current status after setting it is fine. Drivers
should reset all state when they start to recover from a crashed driver,
so they shouldn't need to get the current feature status at startup
either.
2024-06-10 19:44:12 +02:00
bjorn3 123eef9635 pcid: Move capability offset into the Capability enum
This makes it easier to move to using pci_types for parsing PCI
capabilities.
2024-06-10 19:44:12 +02:00
Jeremy Soller 1fba5f7505 Merge branch 'pcid_cleanup2' into 'master'
Split up pcid's main.rs and remove parsing for unused capabilities

See merge request redox-os/drivers!159
2024-06-10 17:43:35 +00:00
bjorn3 027d952c39 pcid: Remove parsing of unused capabilities
This will make it easier to switch to pci_types for capability parsing
in the future.
2024-06-09 20:38:46 +02:00
bjorn3 8f9bbecd0c pcid: Rustfmt main.rs 2024-06-09 20:38:46 +02:00
bjorn3 fd3cf79884 pcid: Move spawning and interacting with subdrivers out of main.rs 2024-06-09 20:38:46 +02:00
Jeremy Soller 59120be16a Merge branch 'pcid_cleanup' into 'master'
More pcid cleanups

See merge request redox-os/drivers!158
2024-06-09 18:10:48 +00:00
bjorn3 eb2e670cd6 pcid: Explain why PciBar is used instead of pcid_types::Bar 2024-06-09 18:53:19 +02:00
bjorn3 b04915673d pcid: Remove ConfigReader and ConfigWriter traits
Only PciFunc implements this trait.
2024-06-09 18:51:55 +02:00
bjorn3 d70cf080bb pcid: Remove with_pci_func_raw 2024-06-09 18:46:35 +02:00
bjorn3 9aed7d560e pcid: Merge CapabilityOffsetsIter into CapabilitiesIter 2024-06-09 18:21:50 +02:00
bjorn3 9d37d15827 pcid: Avoid duplicate read of vendor and device id 2024-06-09 18:14:52 +02:00
bjorn3 1593884938 pcid: Use capability_pointer method instead of a raw read 2024-06-09 18:14:49 +02:00
bjorn3 7f5a340c83 pcid: Remove cap_pointer from PciHeader::PciToPci
It is never used.
2024-06-09 18:14:46 +02:00
bjorn3 ba6b91d561 pcid: Move print_pci_function to a PciHeader method 2024-06-09 16:46:59 +02:00
Jeremy Soller 9bd0a8a0e5 Merge branch 'pci_types_update_interrupt' into 'master'
Use pci_types for setting the interrupt line

See merge request redox-os/drivers!157
2024-06-09 13:10:35 +00:00
bjorn3 4b384066f2 Use pci_types for setting the interrupt line 2024-06-09 15:05:47 +02:00
Jeremy Soller 43f5641285 Merge branch 'update_pci_types' into 'master'
Several pcid cleanups

See merge request redox-os/drivers!156
2024-06-09 12:11:50 +00:00
bjorn3 7ddae5fa03 pcid: Add fixme 2024-06-09 14:03:32 +02:00
bjorn3 3737a70cc1 pcid: Reduce visibility of server handle send/recv 2024-06-09 14:03:16 +02:00
bjorn3 6825d9b2ba pcid: Remove support for connecting to non-default server 2024-06-09 14:03:16 +02:00
bjorn3 785f53c70c pcid: Stop explicitly passing PciAddress to several functions
The PciHeader/PciEndpointHeader argument already contains the
PciAddress.
2024-06-09 14:03:13 +02:00
bjorn3 38a729bc76 Handle some stabilized rustc features 2024-06-09 14:03:13 +02:00
bjorn3 020a3ef631 pcid: Update to pci_types 0.9.0 2024-06-09 14:03:10 +02:00
Jeremy Soller ccfe5ece20 Update feature required for aarch64 yield 2024-05-11 14:16:08 -06:00
Jeremy Soller 67df958d11 Update to new nightly 2024-05-11 14:11:58 -06:00
Jeremy Soller 8caf28793e Implement USB HID scroll 2024-05-01 13:29:21 -06:00
Jeremy Soller fd973a1d7d xhcid: allow configuring multiple interfaces 2024-04-17 09:24:28 -06:00
Jeremy Soller 9ec71c6ba4 xhcid/usbhidd: build out USB HUB driver 2024-04-17 08:51:02 -06:00
Jeremy Soller 68d838650a Init usbhubd 2024-04-16 21:44:37 -06:00
Jeremy Soller f3dc1e0c7e xhcid: add hub descriptor and do not return error if driver not found 2024-04-16 21:26:47 -06:00
Jeremy Soller c0a4448c0b xhcid/usbhidd: remove extra set idle code, just use device request 2024-04-16 21:26:14 -06:00
Jeremy Soller 42f612bfda xhcid/usbhidd: WIP spawning drivers on all interfaces 2024-04-16 13:07:17 -06:00
Jeremy Soller 12c28e90fd usbhidd: do not log vendor defined events 2024-04-16 11:21:51 -06:00
Jeremy Soller 13ebe960dd xhcid: always use polling 2024-04-16 11:13:50 -06:00
Jeremy Soller 9069c64b87 xhcid: fixes for setting config and interface when CIC is false 2024-04-16 11:09:57 -06:00
Jeremy Soller 18eab7c0dc xhcid: always set CIE to match CIC 2024-04-16 11:09:38 -06:00
Jeremy Soller 667a8e42f9 xhcid: fix set_interface request type 2024-04-16 11:09:26 -06:00
Jeremy Soller 784575032f usbhidd: fix configuration request 2024-04-16 11:09:11 -06:00
Jeremy Soller a2c024c03e Add HID protocol and idle configuration to USB stack 2024-04-16 10:20:25 -06:00
Jeremy Soller ec4f2f594c xhcid: document arguments to trb.normal 2024-04-16 09:47:34 -06:00
Jeremy Soller 29b1c1aa0d xhcid: fix isoch and interrupt endpoint types being swapped 2024-04-16 09:13:44 -06:00
Jeremy Soller c85baf220e xhcid: add number to trb completion codes 2024-04-16 08:56:16 -06:00
Jeremy Soller bd09256991 usbhidd: find endpoint number 2024-04-16 08:55:55 -06:00
Jeremy Soller a3be1d88d4 usbhidd: dynamically locate config, interface, and alternate setting 2024-04-16 08:11:05 -06:00
Jeremy Soller 61e2ee224a xhcid: improve endpoint parsing 2024-04-16 08:10:32 -06:00
Jeremy Soller 806be9bdc6 xhcid: associate stalls on setup stage with transfers 2024-04-15 15:02:05 -06:00
Jeremy Soller 64fcd0a323 xhcid: ensure max packet size is set correctly before reading descriptors 2024-04-15 12:54:05 -06:00
Jeremy Soller 12bc7273bf xhcid: add more debugging 2024-04-12 11:25:15 -06:00
Jeremy Soller e070abc7cb Fix network device logging paths 2024-04-12 10:37:42 -06:00
Jeremy Soller c99cd3a843 usbhidd: use rehid ReportHandler 2024-04-12 09:27:36 -06:00
Jeremy Soller 571bd9cf3e usbhidd: move code to rehid 2024-04-11 09:36:20 -06:00
Jeremy Soller 32b7cc3b77 ps2d: fix typo 2024-04-10 10:38:05 -06:00
Jeremy Soller 1b5ea82c02 Merge branch 'readme-cleanup' into 'master'
Improve and cleanup the README

See merge request redox-os/drivers!154
2024-04-04 13:10:06 +00:00
Ribbon 331b75f9bc Improve and cleanup the README 2024-04-03 21:45:26 +00:00
Jeremy Soller 23b20fa5b1 Merge branch 'latest_eq' into 'master'
Use latest event queue interface everywhere.

See merge request redox-os/drivers!151
2024-04-01 13:24:31 +00:00
4lDO2 e97ba74789 Reimplement all event_queue.trigger behavior. 2024-03-31 14:30:07 +02:00
4lDO2 4c35e88997 Use latest event queue interface everywhere. 2024-03-31 14:30:04 +02:00
Jeremy Soller e1fdadb62d Merge branch 'bcm2835_sdhcid' into 'master'
bcm2835-sdhcid: update redox_syscall version

See merge request redox-os/drivers!153
2024-03-30 14:44:31 +00:00
Ivan Tan acaa8e490c bcm2835-sdhcid: update redox_syscall version 2024-03-30 22:29:25 +08:00
Jeremy Soller 5612346e68 ps2d: implement vmmouse for i686 2024-03-29 10:10:13 -06:00
Jeremy Soller 9ac5184964 Fix i686 build 2024-03-25 14:20:44 -06:00
Jeremy Soller 64f48c6a57 Merge branch 'ahcid_align' into 'master'
Fix 257 page allocation in ahcid to 256.

See merge request redox-os/drivers!152
2024-03-24 17:37:01 +00:00
4lDO2 ee725b7a08 Fix 257 page allocation in ahcid. 2024-03-24 14:09:12 +01:00
Jeremy Soller 32410bde7c Merge branch 'fixes' into 'master'
Fix non-append writes and cancellation.

See merge request redox-os/ramfs!6
2024-03-23 13:54:27 +00:00
4lDO2 53dcb4af72 Fix non-append writes and cancellation. 2024-03-23 14:48:42 +01:00
4lDO2 b69453c97a Update dependencies, handle cancellation. 2024-03-22 22:11:38 +01:00
Jeremy Soller eb32ad7975 Merge branch 'libredox2' into 'master'
Switch remaining clock_gettimes to libredox.

See merge request redox-os/netstack!47
2024-03-22 18:31:40 +00:00
4lDO2 1981fa86bd Switch remaining clock_gettimes to libredox. 2024-03-20 16:39:57 +01:00
Jeremy Soller ff7015a55a virtio-core: fix compilation on i686 2024-03-19 16:19:47 -06:00
Jeremy Soller 11a8038b4a Merge branch 'libredox' into 'master'
Switch to libredox where applicable (fixed)

See merge request redox-os/drivers!150
2024-03-18 22:09:25 +00:00
Jacob Lorentzon ff956fd3bb Switch to libredox where applicable (fixed) 2024-03-18 22:09:25 +00:00
Jeremy Soller 98078650f8 Revert "Switch to libredox where applicable."
This reverts commit 2e7dbf1cc1.
2024-03-18 15:00:52 -06:00
Jeremy Soller ae3129e582 Merge branch 'libredox' into 'master'
Switch to libredox where applicable.

See merge request redox-os/drivers!149
2024-03-18 20:37:19 +00:00
Jeremy Soller fb2d80003a Merge branch 'libredox' into 'master'
Switch to libredox and redox-event.

See merge request redox-os/netstack!46
2024-03-18 20:36:56 +00:00
4lDO2 2e7dbf1cc1 Switch to libredox where applicable. 2024-03-18 19:23:05 +01:00
4lDO2 8e2d02232f Switch to libredox and redox-event. 2024-03-18 17:10:07 +01:00
Jeremy Soller 7ae84a543b Merge branch 'nvmed_race' into 'master'
Fix potential race in nvmed

See merge request redox-os/drivers!148
2024-03-17 21:31:39 +00:00
bjorn3 5286f45311 Fix potential race in nvmed
Previously it was possible to submit commands before the event queue is
created by the irq handler thread.
2024-03-17 21:03:23 +01:00
Jeremy Soller 9edc328fd1 Merge branch 'signals' into 'master'
Signals

See merge request redox-os/bootstrap!5
2024-03-17 17:01:43 +00:00
Jacob Lorentzon cc7ee6ce49 Signals 2024-03-17 17:01:43 +00:00
Jeremy Soller 65f706530a Merge branch 'arm64_pcie' into 'master'
Search for PCI ECAM in the device tree on ARM

See merge request redox-os/drivers!147
2024-03-17 16:33:03 +00:00
bjorn3 15c8ab2331 Search for PCI ECAM in the device tree on ARM 2024-03-17 17:15:34 +01:00
Jeremy Soller bdfc78950b Merge branch 'cancellation' into 'master'
Handle but don't implement scheme cancellation.

See merge request redox-os/randd!13
2024-03-16 13:07:12 +00:00
Jeremy Soller ccd2944781 Merge branch 'cancellation' into 'master'
Implement scheme call cancellation.

See merge request redox-os/ptyd!10
2024-03-16 13:06:57 +00:00
Jeremy Soller 0d2b3e5f98 Merge branch 'cancellation' into 'master'
Implement scheme cancellation.

See merge request redox-os/ipcd!7
2024-03-16 13:06:36 +00:00
Jeremy Soller aa4b53bd5c Merge branch 'fix_aarch64' into 'master'
Fix building for AArch64

See merge request redox-os/bootstrap!9
2024-03-16 13:04:44 +00:00
4lDO2 28ba35baa7 Implement scheme call cancellation. 2024-03-16 10:02:41 +01:00
4lDO2 55cfb330d2 Implement scheme cancellation. 2024-03-16 10:01:28 +01:00
4lDO2 a22fc45c0d Handle but don't implement scheme cancellation. 2024-03-16 09:56:50 +01:00
bjorn3 02fd768c9f Fix building for AArch64 2024-03-15 12:03:04 +01:00
Jeremy Soller 797d4040b2 Merge branch 'merge_bootstrap_into_initfs' into 'master'
Support embedding bootstrap blob into the initfs

See merge request redox-os/bootstrap!8
2024-03-13 14:50:27 +00:00
bjorn3 70700df944 Update redox-initfs and use the initfs_size header field instead of INITFS_LENGTH 2024-03-12 21:49:53 +01:00
Jeremy Soller 7dd9b2e84d Merge branch 'merge_bootstrap_into_initfs' into 'master'
Allow embedding bootstrap code into the initfs blob

See merge request redox-os/redox-initfs!2
2024-03-12 20:38:56 +00:00
bjorn3 12ed3151f3 Add size to the initfs header 2024-03-12 14:13:49 +01:00
bjorn3 7978d794f7 Encode bootstrap code entrypoint in the initfs header 2024-03-11 12:16:33 +01:00
Jeremy Soller f8fbeed1bf Merge branch 'misc_changes' into 'master'
Couple of improvements

See merge request redox-os/redox-initfs!1
2024-03-10 19:30:34 +00:00
bjorn3 b50d6fad52 Support embedding bootstrap blob into the initfs 2024-03-10 19:31:33 +01:00
bjorn3 ada6cfc973 Allow embedding bootstrap code into the initfs blob
This may in the future allow booting using non-redox specific bootloaders.
2024-03-10 19:28:09 +01:00
bjorn3 b9e856a4ab Remove unused cargo feature 2024-03-10 17:27:26 +01:00
bjorn3 30568c5ee0 Unconditionally use no_std
And use `extern crate std;` when libstd is necessary.
2024-03-10 17:26:35 +01:00
bjorn3 56642539bc Update clap to v4 2024-03-10 17:25:23 +01:00
Jeremy Soller a372d36557 Merge branch 'misc_changes' into 'master'
Various improvements

See merge request redox-os/bootstrap!7
2024-03-10 15:14:37 +00:00
Jeremy Soller 416c906eb9 Merge branch 'less_unstable_features' into 'master'
Remove a couple of unstable feature uses

See merge request redox-os/bootstrap!6
2024-03-10 15:13:45 +00:00
Jeremy Soller 7ed2193a00 Merge branch 'unify_storage_drivers' into 'master'
Reduce code duplication between disk drivers

See merge request redox-os/drivers!146
2024-03-10 15:12:56 +00:00
bjorn3 626a5af3a4 Use HashMap instead of BTreeMap
This reduces the file size from 87KiB to 79KiB.
2024-03-10 14:39:29 +01:00
bjorn3 ba7eea3043 Compile with fat LTO
This reduces the file size from 119KiB to 87KiB.
2024-03-10 14:08:25 +01:00
bjorn3 8e11205784 Rename entrypoint to _start
This matches the default.
2024-03-10 13:59:44 +01:00
bjorn3 0111bcfd48 Remove unused __end global 2024-03-10 13:57:30 +01:00
bjorn3 57c1bf94b6 Use default alloc error handler in liballoc 2024-03-10 13:46:43 +01:00
bjorn3 c15c6e1dd2 Use the Display impl of PanicInfo 2024-03-10 13:41:53 +01:00
bjorn3 89e0a71d10 Remove unnecessary definition of eh_personality
All crates are compiled with panic=abort and no extern "C-unwind" is
used, so the personality function is referenced by rustc.
2024-03-10 13:40:47 +01:00
bjorn3 2860c0bdfb Remove usage of naked functions 2024-03-10 13:39:11 +01:00
bjorn3 20bc47f228 Move DiskWrapper into a new driver-block crate
Also merge block-io-wrapper into this crate.
2024-03-06 21:09:38 +01:00
bjorn3 3e42637066 Fix a panic message 2024-03-06 21:09:38 +01:00
bjorn3 9bb1222933 Fix UB lint in virtio-core
error: casting references to a bigger memory layout than the backing allocation is undefined behavior, even if the reference is unused
   --> virtio-core/src/probe.rs:126:21
    |
86  |         let capability = unsafe { &*(capability.data.as_ptr() as *const PciCapability) };
    |                                    --------------------------------------------------- backing allocation comes from here
...
126 |                     (&*(capability as *const PciCapability as *const PciCapabilityNotify))
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: casting from `transport_pci::PciCapability` (13 bytes) to `transport_pci::PciCapabilityNotify` (17 bytes)
    = note: `#[deny(invalid_reference_casting)]` on by default
2024-03-06 21:06:26 +01:00
Jeremy Soller 25dcb8adc1 Merge branch 'driver-categories3' into 'master'
Move all storage, audio and graphics related drives to the relative subdirectories

See merge request redox-os/drivers!145
2024-03-01 00:24:52 +00:00
bjorn3 887412daf5 Move all graphics related drivers to graphics/ 2024-02-29 15:41:05 +01:00
bjorn3 0e98dc4a05 Move all audio drivers to audio/ 2024-02-29 15:41:05 +01:00
bjorn3 c75b560def Move all storage drivers to storage/ 2024-02-29 15:41:05 +01:00
Jeremy Soller c79ed01d7a Merge branch 'driver-category-net' into 'master'
Move all network drivers to net/

See merge request redox-os/drivers!144
2024-02-29 13:38:00 +00:00
bjorn3 e36b0a8e94 Move all network drivers to net/ 2024-02-28 21:31:26 +01:00
Jeremy Soller fece794c9f Merge branch 'named_network_adapters' into 'master'
Don't set the mac address network config from drivers

See merge request redox-os/drivers!143
2024-02-28 13:01:39 +00:00
Jeremy Soller 7e86cc9f9f Merge branch 'named_network_adapters' into 'master'
Allow network adapters to be named

See merge request redox-os/netstack!45
2024-02-28 13:01:09 +00:00
Jeremy Soller 123991da13 Merge branch 'remove_mac_getcfg' into 'master'
Always use the mac handle of the network scheme instead of the mac config

See merge request redox-os/netstack!44
2024-02-28 12:59:11 +00:00
Jeremy Soller 2f7b0ae7bb Merge branch 'remove_mac_setcfg' into 'master'
Don't set the mac address network config from drivers

See merge request redox-os/drivers!142
2024-02-28 12:58:45 +00:00
bjorn3 c4bc69a4d0 Give each network adapter a unique scheme name
This will be necessary in the future to support multiple network
adapters in a single system.
2024-02-28 11:49:48 +01:00
bjorn3 f9b3170f0e Allow network adapters to be named
This will be necessary in the future to support multiple network
adapters in a single system.
2024-02-28 10:44:18 +01:00
bjorn3 674f5b6d77 Always use the mac handle of the network scheme instead of the mac config 2024-02-28 09:39:19 +01:00
bjorn3 d33d7a91e5 Don't set the mac address network config from drivers
The mac handle of the network scheme is now supported by all network
drivers.
2024-02-28 09:36:42 +01:00
Jeremy Soller ad9305bf9d Merge branch 'unify_network_drivers' into 'master'
Unify the scheme handling of all network drivers

See merge request redox-os/drivers!141
2024-02-28 02:27:05 +00:00
bjorn3 9262d034bd Port virtio-netd to driver-network 2024-02-27 14:07:17 +01:00
bjorn3 de6beb8992 Implement network:mac in all remaining network drivers 2024-02-26 20:48:02 +01:00
bjorn3 3751c915fe Unify the scheme handling of all network drivers
This deduplicates a fair bit of non-trivial logic and makes it easier to
keep all network drivers in sync when the interface changes.
2024-02-26 20:43:41 +01:00
Jeremy Soller 7b3e809573 Merge branch 'optimize_pcid_grants' into 'master'
Only do one memory:physical map per MCFG entry.

See merge request redox-os/drivers!139
2024-02-20 22:27:14 +00:00
Jacob Lorentzon e7a6bb6c81 Only do one memory:physical map per MCFG entry. 2024-02-20 22:27:14 +00:00
Jeremy Soller a2e9e28195 Fix build for 32-bit x86 2024-02-16 21:17:02 -07:00
Jeremy Soller c52e17dd46 Even more fixes for 32-bit x86 2024-02-16 21:00:13 -07:00
Jeremy Soller 2c672a0568 More fixes for 32-bit x86 2024-02-16 20:58:54 -07:00
Jeremy Soller 2a4e292e1d virtio-core: mark CommonCfg as packed 2024-02-16 20:52:55 -07:00
Jeremy Soller de2fae8183 Do not compile MSI-X function for x86 32-bit 2024-02-16 20:52:37 -07:00
Jeremy Soller 40e2189e22 ahcid: spin for all requests 2024-02-15 16:00:52 -07:00
Jeremy Soller 74a64bf2bb Merge branch 'fix-aarch64-build' into 'master'
ihdad, rtl8139d, rtl8168d, virtio-core, xhcid: Fix aarch64 build

See merge request redox-os/drivers!140
2024-02-10 17:21:04 +00:00
Enver Balalic 7439262994 ihdad, rtl8139d, rtl8168d, virtio-core, xhcid: Fix aarch64 build 2024-02-10 19:03:36 +01:00
Jeremy Soller c432f0fddf Merge branch 'pci_interrupts_rework2' into 'master'
Various improvements to the MSI-X support

See merge request redox-os/drivers!138
2024-01-26 17:27:17 +00:00
bjorn3 67d3015e2e Add helper for allocating a single MSI/MSI-X interrupt vector
It doesn't actually configure the device to emit it though, but does
make this easier to do.
2024-01-25 14:43:44 +01:00
bjorn3 9b809312c2 Ignore MSI-X PBA in all drivers
It isn't used in any driver and even on Linux no driver seems to use it
at all. The only times it seems to be useful are if you were to mask an
interrupt and want to check if the interrupt fired without unmasking or
if you want to make the device itself trigger an interrupt.
2024-01-24 14:28:40 +01:00
bjorn3 ecdcefba69 Clarify message_address argument names 2024-01-24 14:28:40 +01:00
bjorn3 f43aa8574c Simplify MSI-X table pointer computation 2024-01-24 14:28:40 +01:00
bjorn3 7dbf22331b Share msix config validation code 2024-01-24 14:28:40 +01:00
Jeremy Soller 5f845538ea Merge branch 'pci_interrupts_rework' into 'master'
Couple of interrupt handling cleanups and some other changes

See merge request redox-os/drivers!137
2024-01-24 13:21:24 +00:00
Jeremy Soller 21add3ed09 Merge branch 'pci_use_pci_types2' into 'master'
Use the pci_types crate for writing the command register and reading the status register

See merge request redox-os/drivers!136
2024-01-24 13:19:46 +00:00
bjorn3 354c351b19 Unify device info printing between drivers 2024-01-23 13:01:40 +01:00
bjorn3 77b97bb2ed Introduce PciBar::physmap_mem helper 2024-01-23 12:02:40 +01:00
bjorn3 4302a35a7e Remove a couple of unused functions from MsixCapability
The set and write methods were useless as no rpc call is exposed by
pcid to actually write the new values. As for the rest, there were
no uses and they can be emulated using the other methods.
2024-01-22 20:44:17 +01:00
bjorn3 c13161c4a5 Fix nvmed 2024-01-22 19:57:24 +01:00
bjorn3 ad23ad5d93 Introduce irq_handle helper for legacy interrupts 2024-01-22 19:35:18 +01:00
bjorn3 bd6716efe4 Make legacy_interrupt_line an Option
Drivers don't need to know the exact legacy_interrupt_pin in use.
Just if legacy interrupts are enabled and if so which
legacy_interrupt_line is used.
2024-01-22 19:35:06 +01:00
bjorn3 e972047567 Use EndpointHeader methods for the command and status registers 2024-01-22 18:12:37 +01:00
bjorn3 623d12f276 Only try to load drivers for endpoint functions
For bridge functions we don't have any existing drivers and we
currently panic if we would try to load a driver for them.
2024-01-22 18:03:46 +01:00
bjorn3 545596f296 Don't try to fetch BARs unless there is a matching driver
Fetching BARs will temporarily invalidate them, which could cause
crashes if a driver happens to access it at the same time. As we
don't yet use a single pcid instance, we don't know which devices
have a driver attached or not. As such approximate this as the set
of devices for which the current pcid instance would load a driver.
2024-01-22 17:54:38 +01:00
Jeremy Soller f624ed92f7 Merge branch 'pci_use_pci_types' into 'master'
Start using the pci_types crate

See merge request redox-os/drivers!135
2024-01-22 16:12:54 +00:00
bjorn3 18529f6cee Remove PciClass in favor of pci_types::DeviceType 2024-01-22 16:57:53 +01:00
bjorn3 fb0dcb384b Use pci_types in a couple more places in PciHeader::from_reader 2024-01-22 16:48:52 +01:00
bjorn3 d2431d4140 Make all parsing in PciHeader::from_reader use pci_types 2024-01-22 16:32:18 +01:00
Jeremy Soller fda74cb359 Merge branch 'pci_cleanup2' into 'master'
Couple more pci cleanups

See merge request redox-os/drivers!134
2024-01-22 15:06:46 +00:00
bjorn3 a5d0c7c354 Use pci_types for reading BARs
This simplifies a lot of code and adds support for 64bit BARs.
2024-01-22 15:54:18 +01:00
bjorn3 d1b6009e3d Start converting PciHeader::from_reader to pci_types 2024-01-22 15:25:08 +01:00
bjorn3 0b611dca04 Start using the pci_types crate 2024-01-22 11:25:43 +01:00
bjorn3 d56881de88 Use CfgAccess instead of ConfigReader in PciHeader::from_reader
This will enable getting BAR sizes directly inside this function in the future.
2024-01-22 11:00:17 +01:00
bjorn3 cc015eab13 Move PciHeader out of the pcid_interface crate 2024-01-21 21:25:50 +01:00
bjorn3 5192816de7 Introduce expect_port and expect_mem helpers 2024-01-21 21:12:24 +01:00
bjorn3 be0e6b9dd7 Pass self instead of &self to PciFeature methods
PciFeature is Copy, so passing it behind a reference is not necessary.
2024-01-21 20:46:00 +01:00
bjorn3 d0e90f5ded Remove fetch_header from pcid_interface
Most things are already stored in SubdriverArguments and the couple of
things that aren't may change over time and thus should be read again
each time they are accessed, while fetch_header would receive a fixed
copy from pcid.
2024-01-21 19:35:39 +01:00
bjorn3 e5772c132b Remove a lot of fields from PciHeader which are unlikely to be used
Some of these are removed with PCIe while many others only need to be
used by the firmware to initialize the PCI bridges. If we ever need
them anyway, we can always add them back, but for now it improves
readability.
2024-01-21 19:12:35 +01:00
bjorn3 1890293e86 Introduce a FullDeviceId type and pass it in pcid_interface 2024-01-21 15:18:56 +01:00
bjorn3 92914e808c Reduce code indentation one level 2024-01-21 14:03:33 +01:00
bjorn3 b9c4c61dcc Move driver matching to config.rs 2024-01-21 13:02:47 +01:00
bjorn3 92428c535b Only enable redox scheme logger when compiling for redox
This allows running pcid tests on the host.
2024-01-21 11:35:06 +01:00
Jeremy Soller e2976d0f52 Merge branch 'pci_force_pcid_interface' into 'master'
Migrate all PCI drivers to pcid_interface

See merge request redox-os/drivers!133
2024-01-20 23:08:12 +00:00
Jeremy Soller a4acf55ad8 Merge branch 'pci_cleanup' into 'master'
Couple more pcid cleanups

See merge request redox-os/drivers!132
2024-01-20 23:07:34 +00:00
bjorn3 dc13752d74 Force usage of pcid_interface 2024-01-20 19:42:06 +01:00
bjorn3 3b4d0e858f Migrate vboxd to pcid_interface (untested) 2024-01-20 19:26:46 +01:00
bjorn3 878a02f29f Migrate ixgbed to pcid_interface (untested) 2024-01-20 19:13:27 +01:00
bjorn3 075e28339f Migrate e1000d to pcid_interface 2024-01-20 19:04:15 +01:00
bjorn3 d950e33184 Migrate ac97d to pcid_interface 2024-01-20 18:58:09 +01:00
bjorn3 f9f3407f36 Migrate ahacid to pcid_interface 2024-01-20 18:51:29 +01:00
bjorn3 558f11b3eb Migrate bgad to pcid_interface 2024-01-20 18:34:40 +01:00
bjorn3 de7677604e Use hex instead of decimal in all config.toml
This matches the way basically everyone prints PCI ids
2024-01-20 17:59:38 +01:00
bjorn3 382047b14e Rename the pcie module to cfg_access 2024-01-20 16:04:18 +01:00
bjorn3 d832717bf9 Remove a bit of dead code 2024-01-20 14:42:29 +01:00
bjorn3 20eb92ae02 Assert PCI config space accesses are aligned 2024-01-20 14:36:37 +01:00
bjorn3 cb7dc2abd2 Only set iopl for helper threads when actually necessary 2024-01-20 14:17:51 +01:00
bjorn3 3cbfbf6442 Move the IO port based fallback for PCI out of the pci module
The pci module is included in the pcid_interface library, which never
needs it.
2024-01-20 14:07:31 +01:00
bjorn3 4f20b90fc3 Remove PciBus and PciDev types
They weren't used in a load bearing way. If we want to keep persistent
state about buses and devices in the future they would probably get a
different shape.
2024-01-20 13:38:45 +01:00
Jeremy Soller 46b83bac04 Merge branch 'pci_perf' into 'master'
Improve performance of PCIe MMIO config space accesses

See merge request redox-os/drivers!131
2024-01-19 22:25:15 +00:00
bjorn3 cf7fbacdaf Stop leaking Mcfg again
We don't need it after Pcie::new anymore
2024-01-19 19:53:39 +01:00
bjorn3 529b4935ee Physmap all buses upfront
This avoids a costly Mutex lock and BTreeMap lookup for each config
space access.
2024-01-19 19:50:11 +01:00
bjorn3 23d963361a Fix a couple of warnings 2024-01-19 19:14:22 +01:00
bjorn3 cb9edcb7d6 Reduce log verbosity of Capability::parse_vendor by combining some logs 2024-01-19 19:11:05 +01:00
bjorn3 8d87b701ba Remove Mcfgs type
This wrapper was only useful back when we accepted multiple MCFG tables.
2024-01-19 19:10:35 +01:00
bjorn3 ae7e2dac9f Only parse a single MCFG ACPI table
There should only be one and Linux only parses the first one too.
2024-01-19 18:41:28 +01:00
bjorn3 07c029ec21 Add a fixme for using ACPI 2024-01-19 18:10:57 +01:00
Jeremy Soller b014145232 Merge branch 'pci_types' into 'master'
A bunch of pci improvements

See merge request redox-os/drivers!130
2024-01-19 16:18:00 +00:00
bjorn3 101f062b56 Remove a couple of error conditions in Mcfgs::fetch()
* Every directory entry has to have a filename, so use unwrap
* Handle non-UTF-8 ACPI table filenames by using as_encoded_bytes
2024-01-19 14:58:09 +01:00
bjorn3 240e59e2bf Handle pci buses without a device at the first slot 2024-01-19 14:45:48 +01:00
bjorn3 c611988768 Fix MCFG parsing for PCIe 2024-01-19 13:19:53 +01:00
bjorn3 b317484d67 Simplify Mcfgs::fetch 2024-01-19 13:00:23 +01:00
bjorn3 15249127a5 Fix a couple of warnings 2024-01-19 12:47:42 +01:00
bjorn3 d010d03eef Fix pcid tests 2024-01-19 12:40:55 +01:00
bjorn3 2b5ed69a06 Use PciAddress in a couple more places 2024-01-19 12:40:54 +01:00
bjorn3 42b2f52d41 Directly store a PciAddress inside PciFunc instead of a PciDev + num 2024-01-19 12:29:22 +01:00
bjorn3 e5491a9e9a Inline several layers of read and write methods 2024-01-19 12:21:22 +01:00
bjorn3 336903b90a Introduce SharedPciHeader to deduplicate fields between the General and PciToPci variants 2024-01-19 12:14:02 +01:00
bjorn3 a7c5391c6c Introduce PciAddress type copied from the pci_types crate 2024-01-19 12:14:00 +01:00
Jeremy Soller ec04d52c7e Add unset builtin and update config path 2024-01-18 15:09:15 -07:00
Jeremy Soller f33e8b54af Update path for initfs 2024-01-18 15:05:38 -07:00
bjorn3 07d5d730d2 Remove nolock CfgAccess methods
They are only called by the corresponding locked methods.
2024-01-18 22:14:04 +01:00
Jeremy Soller bf441b01f1 Merge branch 'virtio_cleanup' into 'master'
Couple of virtio cleanups

See merge request redox-os/drivers!129
2024-01-18 20:04:44 +00:00
bjorn3 fbcf01b413 Add a couple of FIXME 2024-01-18 19:03:10 +01:00
bjorn3 3f2f32de59 Add back VIRTIO_NET_F_MAC to virtio-netd 2024-01-18 18:48:25 +01:00
bjorn3 b06f0534aa Remove interrupt status register probing
It isn't used when MSI-X is used and we always use MSI-X interrupts.
2024-01-18 18:45:32 +01:00
bjorn3 fcc55507ea Move the notify_multiplier field into a separate PciCapabilityNotify type
It only exists for VIRTIO_PCI_CAP_NOTIFY_CFG and could conflict with
fields of other capability types.
2024-01-18 18:07:05 +01:00
bjorn3 380a416258 Reorganize virtio headers and add a couple of new fields
Also add a decent amount of comments from the virtio spec.
2024-01-18 17:17:39 +01:00
bjorn3 bd8b218174 Don't return Result from spawn_irq_thread
It never returns an error.
2024-01-18 15:29:06 +01:00
Jeremy Soller ca8d73fb32 Merge branch 'graphics_rework' into 'master'
Move text console handling from vesad to a new fbcond daemon

See merge request redox-os/drivers!128
2024-01-15 02:00:50 +00:00
bjorn3 ed69a8ef6d Open scheme in non-blocking mode and ensure events aren't lost 2024-01-14 21:20:42 +01:00
bjorn3 4f6f4d7267 Prevent a potential deadlock when writing to multiple text consoles 2024-01-14 19:29:02 +01:00
bjorn3 fe4f0880af Couple of minor cleanups
Among other things this removes the seek implementation as it doesn't
seem to be used and didn't do anything anyway.
2024-01-14 19:10:47 +01:00
bjorn3 f64a6e4c6f Remove text mode support from vesad
This is now handled by fbcond
2024-01-14 18:22:52 +01:00
bjorn3 bc1a068a4f Introduce fbcond to replace text console handling inside vesad
This will in the future allow switching between graphical mode and text
mode virtual terminals while keeping alternative graphics drivers like
virtio-gpud enabled at all times rather than having to reset back to VGA
mode every time.
2024-01-14 18:14:40 +01:00
Jeremy Soller ad2c9b4b43 Merge branch 'startup-race' into 'master'
fix race conditions on startup

See merge request redox-os/ptyd!9
2024-01-14 14:37:15 +00:00
Ron Williams ff5666be61 fix race conditions on startup 2024-01-14 05:20:04 -08:00
bjorn3 b3b1fb1726 Remove VtMode::Text
It isn't used anywhere.
2024-01-13 19:36:08 +01:00
bjorn3 5c591cf475 Merge Display into GraphicScreen 2024-01-13 19:32:24 +01:00
bjorn3 24d1f95de3 Minor change 2024-01-13 19:25:49 +01:00
bjorn3 5f6edc7adc Fix warnings 2024-01-13 19:20:37 +01:00
bjorn3 5375d9e97d Remove some GraphicScreen direct fields accesses from TextScreen 2024-01-13 19:17:25 +01:00
bjorn3 6be07a3015 Use GraphicScreen inside TextScreen
In preparation for moving TextScreen to a separate daemon.
2024-01-13 17:30:52 +01:00
bjorn3 1a698dec98 Move text rendering to vesad::screen::text 2024-01-13 16:24:34 +01:00
bjorn3 ee2a36b889 Remove rusttype support from vesad
It is never enabled and would add a fair amount of complexity to a
system service which has effective root access despite sandboxing due to
being able to read and write display contents and input device events.
2024-01-13 16:11:36 +01:00
Jeremy Soller 87dc1d3e48 Merge branch 'fix_usbhidd' into 'master'
Fix usbhidd

See merge request redox-os/drivers!127
2024-01-12 18:44:08 +00:00
bjorn3 1ac2fdc572 Write events in usbhidd to input:producer
Writing to display.vesa:input seems to get ignored by orbital.
2024-01-12 19:35:35 +01:00
bjorn3 6561685af8 Fix MouseEvent for usbhidd 2024-01-12 19:35:35 +01:00
Jeremy Soller ce86aca558 Merge branch 'fix_absolute_mouse_events' into 'master'
Switch to absolute mouse events by default when running in a VM

See merge request redox-os/drivers!126
2024-01-12 17:58:50 +00:00
bjorn3 7a21573ebd Switch to absolute mouse events by default when running in a VM
This will transparently release the mouse grab of the VM when leaving
the screen edge, making it much easier to quickly switch between the VM
and other apps running on the host.
2024-01-12 18:33:29 +01:00
bjorn3 c2fd9125a7 Fix absolute mouse events with vmmouse
It is no longer possible to query the display size from inputd, so defer
conversion to display pixel coordinates to orbital instead. This also
avoids a lot of work every mouse event to query the display size as
orbital saves this information already.
2024-01-12 18:31:08 +01:00
bjorn3 bc7469f7cd Switch vmmouse global_asm block back to inline asm
There seems to be a bug somewhere in the global_asm block which causes a
SIGSEGV when making unrelated code changes to ps2d. Using an inline asm
block is easier to follow and less error prone around following the
calling convention.
2024-01-12 18:28:17 +01:00
Jeremy Soller 9422366782 ps2d: fix build on non-x86_64 2024-01-11 09:29:12 -07:00
Jeremy Soller 7892980eb4 Merge branch 'fix_vmmouse' into 'master'
Fix and re-enable vmmouse support

Closes #39

See merge request redox-os/drivers!125
2024-01-10 19:46:33 +00:00
bjorn3 7d4dd990e0 Try to enable vmmouse by default
This doesn't enable absolute mouse events yet as orbitral doesn't handle
them correctly.
2024-01-10 20:23:04 +01:00
bjorn3 f970a9c571 Check for vmware backdoor support before trying to enable vmmouse 2024-01-10 20:22:14 +01:00
bjorn3 8088cb8b20 Fix missing ret in global_asm block
This caused ps2d to get stuck in a crash loop when it's vmmouse support
is enabled.
2024-01-10 20:21:39 +01:00
Jeremy Soller 4534d74efd Merge branch 'search_dir_overrides' into 'master'
Allow specifying multiple search dirs for run.d

See merge request redox-os/init!11
2024-01-08 16:01:35 +00:00
Jeremy Soller 6d785b2964 Merge branch 'fetch_mac' into 'master'
Add support for fetching the mac address from the e1000d driver

See merge request redox-os/drivers!123
2024-01-08 15:59:45 +00:00
Jeremy Soller 9f2cfbd54d Merge branch 'fix_dnsd' into 'master'
Allow dnsd to create udp sockets

See merge request redox-os/netstack!43
2024-01-08 15:58:53 +00:00
bjorn3 e12a74854c Allow dnsd to create udp sockets
This is essential for the functioning of dnsd.
2024-01-08 14:10:49 +01:00
bjorn3 89ee1b4d66 Allow specifying multiple search dirs for run.d
The entries in the search dirs will be merged with the entry in the last
search dir taking priority in case multiple entries have the same name.
This allows putting system init configs in /usr/lib/init.d while the
user can overwrite it by placing a file with the same name in
/etc/init.d
2024-01-08 13:54:16 +01:00
bjorn3 9d5c8207db Try fetching the mac address directly from the network driver 2024-01-07 15:38:15 +01:00
bjorn3 6dd86d366a Add support for fetching the mac address from the e1000d driver 2024-01-07 15:36:49 +01:00
Jeremy Soller 2af6508c3e Merge branch 'libredox' into 'master'
Migrate to libredox and redox-scheme.

See merge request redox-os/ptyd!8
2024-01-06 16:05:37 +00:00
Jeremy Soller be6696a81b Merge branch 'libredox' into 'master'
Migrate to libredox and redox-scheme

See merge request redox-os/ipcd!6
2024-01-03 16:27:52 +00:00
4lDO2 f76ecc35c4 Migrate to libredox and redox-scheme. 2023-12-25 19:18:25 +01:00
4lDO2 92d45336ff Fix tests. 2023-12-25 11:37:02 +01:00
4lDO2 771fffbfd6 Migrate to libredox and redox-scheme. 2023-12-20 19:12:51 +01:00
Jeremy Soller 4b1bf16e01 Merge branch 'remove_physfree' into 'master'
Remove physfree

See merge request redox-os/drivers!122
2023-12-16 18:00:57 +00:00
4lDO2 04f60cf7be Fix ihdad. 2023-12-16 13:12:17 +01:00
4lDO2 8d11fb34de Fix impl Display for MemoryType. 2023-12-16 12:25:02 +01:00
4lDO2 2e1e007836 Fix inputd path parsing. 2023-12-12 12:03:03 +01:00
4lDO2 ea73da92bf Replace all physalloc usages with Dma. 2023-12-12 12:03:03 +01:00
4lDO2 0d99333c3f Remove PhysBox. 2023-12-12 12:03:03 +01:00
Jeremy Soller f7c2426ff6 Fix signal handling 2023-12-11 16:21:23 -07:00
Jeremy Soller b48a8c830e Fix build on 32-bit systems 2023-12-11 10:11:21 -07:00
Jeremy Soller ea4c2f71e0 Merge branch 'ivan/bcm2835-sdhcid' into 'master'
add bcm2835-sdhci driver

See merge request redox-os/drivers!121
2023-12-11 16:09:03 +00:00
Ivan Tan 3871c99e6e add bcm2835-sdhci driver 2023-12-09 12:16:06 +08:00
Jeremy Soller 2901cc4888 Merge branch 'redox-scheme' into 'master'
Migrate to libredox and redox-scheme.

See merge request redox-os/logd!4
2023-12-07 18:58:44 +00:00
Jeremy Soller 92b4cf542e Merge branch 'redox-scheme' into 'master'
Migrate to libredox and redox-scheme.

See merge request redox-os/randd!12
2023-12-07 15:31:54 +00:00
Jeremy Soller 91888c65a0 Merge branch 'redox-scheme' into 'master'
Merge with nulld, and migrate to redox-scheme.

See merge request redox-os/zerod!5
2023-12-07 15:31:14 +00:00
Jeremy Soller 568557a235 Merge branch 'redox-scheme' into 'master'
Migrate to libredox and redox-scheme.

See merge request redox-os/audiod!2
2023-12-07 15:30:44 +00:00
Jeremy Soller 47a02b14d6 Merge branch 'redox-scheme' into 'master'
Migrate to libredox and redox-scheme.

See merge request redox-os/ramfs!5
2023-12-07 15:27:53 +00:00
4lDO2 dabcfa2158 Migrate to libredox and redox-scheme. 2023-11-16 14:22:24 +01:00
4lDO2 31eaa8fe78 Merge with nulld, and migrate to redox-scheme. 2023-11-16 14:11:13 +01:00
4lDO2 a6596f8edb Migrate to libredox and redox-scheme. 2023-11-16 14:02:19 +01:00
4lDO2 b63bb7c012 Migrate to libredox and redox-scheme. 2023-11-16 13:49:44 +01:00
4lDO2 83a73ca48e Migrate to libredox and redox-scheme. 2023-11-15 21:32:12 +01:00
Jeremy Soller 21e0b06c16 Merge branch 'no_slash_in_schemes' into 'master'
Phase out / in scheme names.

See merge request redox-os/drivers!117
2023-11-15 17:30:03 +00:00
Jeremy Soller e399f4a93a Merge branch 'improve-readme' into 'master'
Improve the README

See merge request redox-os/drivers!120
2023-11-15 17:20:37 +00:00
Ribbon ce5409f9bf Improve the README 2023-11-15 17:20:37 +00:00
4lDO2 a6fee75f15 Phase out / in scheme names. 2023-11-09 14:39:57 +01:00
Jeremy Soller 82fe14960f Fix build on x86 2023-11-08 09:54:27 -07:00
Jeremy Soller aacac7e3e0 Merge branch 'improve-readme' into 'master'
Improve the README

See merge request redox-os/drivers!118
2023-11-08 16:34:46 +00:00
Ribbon 02dcf9c180 Improve the README 2023-11-07 15:12:50 +00:00
Jeremy Soller 95665d33c3 Merge branch 'libredox' into 'master'
Switch to libredox

See merge request redox-os/init!10
2023-11-04 19:19:12 +00:00
4lDO2 3e14cb4017 Switch to libredox 2023-11-04 20:02:42 +01:00
Jeremy Soller 30068b1bfa Merge branch 'master' into 'master'
virtio-core: move things around so aarch64 builds

See merge request redox-os/drivers!116
2023-10-19 15:01:01 +00:00
Enver Balalic ad9295715f virtio-core: move things around so aarch64 builds 2023-10-19 15:01:01 +00:00
4lDO2 39baa59693 Update dependencies. 2023-10-14 17:08:10 +02:00
Jeremy Soller a992d901cf Merge branch 'remove_debug_log' into 'master'
Remove debug log

See merge request redox-os/netstack!41
2023-09-11 17:58:29 +00:00
Gartox 2dcc57863c Remove debug log 2023-09-11 19:54:07 +02:00
Jeremy Soller f228483f1f ahcid, nvmed: support MMIO on 32-bit systems 2023-09-09 12:15:07 -06:00
Jeremy Soller 676b1cda67 xhcid: support MMIO on 32-bit systems 2023-09-09 12:05:42 -06:00
Jeremy Soller 15e523c8eb alxd,ihdad,rtl8168d: support MMIO on 32-bit systems 2023-09-09 11:19:17 -06:00
Jeremy Soller a271e455a6 Update redox_syscall 2023-09-08 11:16:15 -06:00
Jeremy Soller 051532e516 Do not use git redox_syscall 2023-09-08 09:20:41 -06:00
Jeremy Soller 9193d4361a Update redox_event 2023-09-07 20:54:53 -06:00
Jeremy Soller 61e9512468 Update redox_syscall to 0.4 2023-09-07 20:49:37 -06:00
Jeremy Soller ebd229ae6c Update for new rust 2023-09-07 20:04:57 -06:00
Jeremy Soller a318dfb63b Merge branch 'update_smoltcp' into 'master'
Migrating to smoltcp 0.10 and add support for multiple interfaces

See merge request redox-os/netstack!39
2023-09-08 01:58:46 +00:00
Jeremy Soller 52b6912a5f Merge branch 'live_daemon' into 'master'
Add a livedisk daemon.

See merge request redox-os/drivers!115
2023-09-08 01:57:16 +00:00
Gartox 07431ef9df Fix warnings 2023-09-07 22:15:00 +02:00
Gartox 2645eeadb4 Change netcfg to adapt to the new router 2023-09-07 22:03:13 +02:00
4lDO2 0d589a3189 Add a livedisk daemon. 2023-09-07 15:02:13 +02:00
Gartox f1f170835e Remove debug print 2023-09-04 12:27:00 +02:00
Gartox c03a446b7a Change log level 2023-09-04 12:24:29 +02:00
Gartox 78a035f0ea Fix TCP accept and accept packet from null mac address 2023-09-04 12:22:55 +02:00
Gartox c89d82100c Add can_recv to LinkDevice
This allow polling faster when there is
still packets to be received
2023-09-04 11:55:54 +02:00
Gartox 270419f82c Fix ping latency 2023-09-04 11:37:43 +02:00
Gartox 0b2b4e41c3 Add support for multiple interfaces
- Smoltcp now talk to a IP device that does the routing
- Add RouteTable
- Add trait LinkDevice representing devices (eth0, loopback...)
- Remove old device
2023-09-04 10:11:02 +02:00
Jeremy Soller fbf2109692 Merge branch 'fstat' into 'master'
Implement missing fstat.

See merge request redox-os/zerod!3
2023-09-02 17:58:30 +00:00
4lDO2 ad28f1ae31 Merge branch 'fix_dependencies' into 'master'
Fix netutils deps

See merge request redox-os/netstack!40
2023-09-01 15:47:15 +00:00
Gartox d47cdbf1fe Fix TCP listening endpoint, fpath formatting, port release while listening:
Now TCPListenEndpoint is stored in the SchemeFile because the
TcpSocket::endpoint() only store endpoints for connected sockets,
not listening ones
2023-09-01 11:18:58 +02:00
Gartox 035bcf1d69 Migrating to smoltcp 0.10 2023-09-01 11:18:56 +02:00
Gartox 2f1443b925 Fix netutils deps 2023-09-01 11:09:54 +02:00
Jeremy Soller 6934d7aad6 Merge branch 'pcid_replace_pipe2' into 'master'
Replace SYS_PIPE2 with libc::pipe in pcid.

See merge request redox-os/drivers!114
2023-08-31 20:15:04 +00:00
4lDO2 9fe01a2cf1 Update dependencies. 2023-08-31 21:20:23 +02:00
4lDO2 ba661f9719 Replace SYS_PIPE2 with libc::pipe in pcid. 2023-08-31 21:20:23 +02:00
4lDO2 dec8ed1a50 Update dependencies. 2023-08-31 21:11:41 +02:00
4lDO2 787de5c371 Update dependencies. 2023-08-31 21:05:34 +02:00
4lDO2 39598fc702 Update dependencies. 2023-08-31 21:04:04 +02:00
4lDO2 ce5de147f3 Update dependencies. 2023-08-31 20:54:40 +02:00
4lDO2 bdbcb0a0e8 Update dependencies. 2023-08-31 20:51:50 +02:00
4lDO2 5ce5de2db5 Update dependencies. 2023-08-31 20:51:14 +02:00
4lDO2 33aae840b7 Update dependencies. 2023-08-31 20:49:50 +02:00
Jeremy Soller f9415ac75e Merge branch 'core' into 'master'
inputd: fix panic when no devices are available

See merge request redox-os/drivers!113
2023-08-31 13:26:04 +00:00
Anhad Singh 74241e0273 inputd: fix panic when no devices are available
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-08-31 16:14:14 +10:00
Jeremy Soller 0017aaec0d Merge branch 'fix_warnings' into 'master'
Fix warnings and bump Rust edition to 2021

See merge request redox-os/netstack!38
2023-08-27 13:23:46 +00:00
Gartox c0a108ca11 Fix warnings and bump Rust edition to 2021 2023-08-27 15:04:44 +02:00
Jeremy Soller 5bbe5220a8 Merge branch 'rw_van_230824' into 'master'
general clean-up, plus fix to ensure an event after read if data is still pending

See merge request redox-os/ptyd!7
2023-08-27 12:49:21 +00:00
Ron Williams fb827b5b47 general clean-up, plus fix to ensure an event after read if data is still pending 2023-08-26 19:49:42 -07:00
Jeremy Soller 9d7e19cc0d Merge branch 'core' into 'master'
virtio-core: add support for legacy transport

See merge request redox-os/drivers!112
2023-08-23 12:26:44 +00:00
Anhad Singh 9980fe6bb9 virtio-blkd: remove repr(C) from the device config struct
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-08-23 15:09:51 +10:00
Anhad Singh 6a5e9d2613 virtio-core: add support for legacy transport
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-08-23 15:03:46 +10:00
Jeremy Soller ac9e4abcd0 virtio-core: Fix compilation on non-x86_64 2023-08-21 09:21:35 -06:00
Jeremy Soller 736e0564c2 Merge branch 'code-blocks' into 'master'
Add code blocks on the TODOs of the README

See merge request redox-os/drivers!111
2023-08-12 13:45:37 +00:00
Ribbon 2ba83c0401 Add code blocks on the TODOs of the README 2023-08-12 09:10:23 +00:00
4lDO2 84951891a7 Fix dependencies. 2023-08-07 17:44:07 +02:00
Jeremy Soller c787931b33 Merge branch 'better_fmap' into 'master'
Better fmap

See merge request redox-os/ipcd!5
2023-08-07 15:37:40 +00:00
Jeremy Soller be53af120e Merge branch 'on_demand_paging' into 'master'
Ensure stack does not remain as RWX!

See merge request redox-os/bootstrap!4
2023-08-07 15:37:33 +00:00
Jeremy Soller 9beb4115d0 Merge branch 'better_fmap' into 'master'
Better fmap

See merge request redox-os/drivers!108
2023-08-07 15:37:20 +00:00
Jeremy Soller 7105951cc7 Merge branch 'rw_van_230728' into 'master'
block-io-wrapper: simplify block calculations

See merge request redox-os/drivers!107
2023-08-04 13:55:54 +00:00
Ron Williams 901c238e0d block-io-wrapper: simplify by using saturating_add 2023-08-04 03:50:45 -07:00
Jeremy Soller e8fe91e301 Merge branch 'inputd-panic-open' into 'master'
inputd: Don't panic on open with invalid path

See merge request redox-os/drivers!110
2023-08-04 02:32:34 +00:00
Ian Douglas Scott d56767216f inputd: Don't panic on open with invalid path 2023-08-03 19:05:33 -07:00
Jeremy Soller a711d66733 Merge branch 'master' into 'master'
init: set the `DISPLAY` environment variable to the VT#

See merge request redox-os/init!9
2023-08-03 12:50:30 +00:00
4lDO2 625ae7f9e4 Use syscall git dependency. 2023-08-03 12:46:14 +02:00
4lDO2 fc1dc21b13 Use updated mmap_prep decl. 2023-08-03 10:50:48 +02:00
4lDO2 ca6ea9b81a Use scheme trait for mmap_prep. 2023-08-03 10:50:48 +02:00
4lDO2 d90edb0808 Implement improved mmap in vesad. 2023-08-03 10:50:48 +02:00
Jeremy Soller 2cd96b8dff Merge branch 'netutils-branch' into 'master'
Use default branch of `netutils` instead of removed branch

See merge request redox-os/drivers!109
2023-08-03 01:59:40 +00:00
Ian Douglas Scott bd2a66d817 Use default branch of netutils instead of removed branch 2023-08-02 18:41:26 -07:00
Anhad Singh d038cfea2c init: set the DISPLAY environment variable to the VT#
Signed-off-by: Anhad Singh <andypythonappdeveloper@gmail.com>
2023-08-03 11:34:51 +10:00
Jeremy Soller 8db2c6372e Fix duplicate import 2023-08-02 09:32:25 -06:00
Jeremy Soller d9b719904d Update Cargo.lock 2023-08-02 09:32:12 -06:00
Jeremy Soller fbecf99dc8 Merge branch 'core' into 'master'
virtio-gpu: handling GPU resets

See merge request redox-os/drivers!101
2023-08-02 15:09:19 +00:00
4lDO2 866c7d73a7 Update syscall. 2023-08-02 15:31:22 +02:00
4lDO2 0d8a24d50a Use updated syscall crate. 2023-08-02 14:18:58 +02:00
4lDO2 c3e2f0eca2 Ensure stack does not remain as RWX! 2023-08-01 16:23:30 +02:00
Ron Williams 4846d21ff9 block-io-wrapper: allow up to MAX offset + len 2023-07-28 01:50:39 -07:00
Ron Williams d23b3046a4 block-io-wrapper: simplify block calculations 2023-07-28 00:57:36 -07:00
Jeremy Soller 9cd701c4db Merge branch 'rw_van_230727' into 'master'
pcid: replace add that should allow wrapping with explicit wrapping_add

See merge request redox-os/drivers!106
2023-07-27 13:03:36 +00:00
Ron Williams 156be64a9d pcid: replace add that should allow wrapping with explicit wrapping_add 2023-07-27 01:22:56 -07:00
Jeremy Soller 313ccef163 Merge branch 'quote-book-section' into 'master'
Quote the "A Note about Drivers" section

See merge request redox-os/drivers!105
2023-07-26 20:11:37 +00:00
Anhad Singh 71a6eb1bb2 inputd: add -A command to activate a VT
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-07-25 19:20:04 +10:00
Anhad Singh ed995306bd inputd: minor clippy fixes
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-07-25 16:36:46 +10:00
Anhad Singh 820b8370ae virtio-gpu: remove the +1 workaround
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-07-25 16:34:25 +10:00
Ribbon 2a09f96277 Quote the "A Note about Drivers" section 2023-07-24 19:13:42 +00:00
Jeremy Soller a102958bcd Merge branch 'rw_van_230723' into 'master'
acpid: fix physmap size bug

See merge request redox-os/drivers!104
2023-07-24 12:27:39 +00:00
Ron Williams 8c0d255ccd acpid: improved bug fix 2023-07-24 01:15:28 -07:00
Ron Williams 0f6d2b8c81 acpid: fix physmap size bug 2023-07-23 22:48:13 -07:00
Anhad Singh 440d6381f9 inputd: rework display events
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-07-22 18:34:20 +10:00
Jeremy Soller d07b13ae63 Merge branch 'patch1' into 'master'
virtio-netd: fix broken build

See merge request redox-os/drivers!103
2023-07-20 12:55:14 +00:00
Anhad Singh 443b7c9b8a virtio-netd: fix broken build
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-07-20 20:08:30 +10:00
Anhad Singh a153c8bc1c inputd: correctly pass on resize events
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-07-20 19:20:56 +10:00
Anhad Singh e457f03935 virtio-gpu: handling GPU resets
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-07-20 17:34:59 +10:00
Jeremy Soller a5a76f674a Merge branch 'remove_physmap' into 'master'
Remove physmap

See merge request redox-os/drivers!102
2023-07-19 11:29:52 +00:00
4lDO2 fc7665eb77 Update Cargo.lock 2023-07-18 14:00:44 +02:00
4lDO2 0277284874 Switch to common::Dma for each non-initfs driver. 2023-07-18 13:59:44 +02:00
4lDO2 44bbb302cf Switch to common::dma::Dma in ided. 2023-07-18 13:48:38 +02:00
4lDO2 e4374ac60d Switch to common::dma::Dma in virtio-*. 2023-07-18 13:47:15 +02:00
4lDO2 d9d8d06d33 Use common::Dma in nvmed. 2023-07-18 12:45:03 +02:00
4lDO2 433ea455cc Use common::Dma in ahcid. 2023-07-18 12:43:39 +02:00
4lDO2 089e8bac35 Move syscall::Dma to common. 2023-07-18 12:43:06 +02:00
4lDO2 2341e3cb16 Document memory:physical. 2023-07-18 12:24:11 +02:00
4lDO2 25b1f7bfea Update dependencies. 2023-07-18 11:08:03 +02:00
4lDO2 8555b8ab3d Remove physmap in non-initfs drivers too. 2023-07-18 11:01:17 +02:00
4lDO2 c63c266400 Remove physmap in virtio. 2023-07-18 11:01:16 +02:00
4lDO2 477b1c0ada Remove physmap in acpid. 2023-07-18 11:01:16 +02:00
4lDO2 a0d233030b Remove physmap in vesad. 2023-07-18 11:01:16 +02:00
4lDO2 e0a0e2a532 Remove physmap in pcid. 2023-07-18 11:01:16 +02:00
4lDO2 6e94a9e236 Remove physmap for disk drivers. 2023-07-18 11:01:16 +02:00
4lDO2 094e3ba548 Add a crate for driver helpers. 2023-07-18 11:01:08 +02:00
Jeremy Soller 5256a9af47 nvmed: enable async feature 2023-07-17 19:51:53 -06:00
Jeremy Soller 07c3297134 ahcid: Use interrupts 2023-07-17 19:33:25 -06:00
Jeremy Soller f8404a1ea0 Merge branch 'core' into 'master'
inputd: fix failure to switch VT after inital switch

See merge request redox-os/drivers!100
2023-07-17 13:48:48 +00:00
Ron Williams 301becb157 Merge branch 'add-kernel-functions' into 'master'
Add kernel functions and the example driver on README

See merge request redox-os/drivers!99
2023-07-17 06:08:09 +00:00
Anhad Singh 95a84c8cbf inputd: fix failure to switch VT after inital switch
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-07-15 16:29:48 +10:00
Ribbon 12420a1c8c Add kernel functions and the example driver on README 2023-07-13 13:55:35 +00:00
4lDO2 123247fd33 Implement missing fstat. 2023-07-12 16:33:17 +02:00
Jeremy Soller 7123438a4b Merge branch 'update-acpi-todo' into 'master'
Update acpid TODO

See merge request redox-os/drivers!98
2023-07-08 21:30:42 +00:00
Ribbon 8e0d4cd2ca Improve explanation 2023-07-08 20:55:14 +00:00
Ribbon 17869bfd77 Update acpid TODO 2023-07-08 20:47:25 +00:00
Jeremy Soller 706d40dfe6 Merge branch 'document-new-drivers' into 'master'
Document new drivers and explain what is missing on incomplete drivers

See merge request redox-os/drivers!97
2023-07-08 20:42:07 +00:00
Ribbon 2b86dc0bc9 Document new drivers and explain what is missing on incomplete drivers 2023-07-08 20:34:30 +00:00
Jeremy Soller 3320cd2eee Merge branch 'core' into 'master'
drivers: add `virtio-gpu`!

See merge request redox-os/drivers!96
2023-07-07 14:08:58 +00:00
Jeremy Soller b9ea46e20c Merge branch 'master' into 'master'
init: misc changes for GPU drivers

See merge request redox-os/init!7
2023-07-07 14:08:21 +00:00
Anhad Singh c5729befe5 inputd: do not reswitch if the same
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-07-07 17:03:14 +10:00
Anhad Singh 5c4e7b36fa make getty work
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-07-07 16:51:46 +10:00
Jeremy Soller bfe8536d58 Add rtl8139 driver 2023-07-06 10:32:16 -06:00
Anhad Singh 2cfd62d194 remove patches from virtio-gpu/
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-07-06 17:38:44 +10:00
Anhad Singh 6386fe126c init: misc changes for GPU drivers
Signed-off-by: Anhad Singh <andypythonappdeveloper@gmail.com>
2023-07-06 10:15:12 +10:00
Anhad Singh 7e83bd9adf virtio-gpud: indicate the reservation of 0 resource_id
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-07-05 17:50:51 +10:00
Anhad Singh 320fedbd76 virtio-gpud: get multiple displays to work
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-07-05 17:49:08 +10:00
Anhad Singh 30146fa81d virtio-gpu: update orbital patch
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-07-05 13:44:35 +10:00
Anhad Singh 07039e8321 drivers: run fmt.sh
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-07-05 11:14:06 +10:00
Anhad Singh 2f2720263f drivers: add inputd
Take out the input coalescing from `vesad` into `inputd`.

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-07-05 11:12:53 +10:00
4lDO2 113583cfca Enforce page alignment in shm:, better fmap. 2023-07-04 18:34:50 +02:00
Anhad Singh caa435eae3 virtio_gpud: able to get orbital running :^)
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-07-04 13:21:41 +10:00
Anhad Singh c0950d0686 virtio-gpu: start working on the scheme
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-07-04 13:17:58 +10:00
Jeremy Soller ef54af0e48 Merge branch 'fix_double_write' into 'master'
Fix scheme socket double write.

See merge request redox-os/randd!11
2023-07-03 17:50:03 +00:00
4lDO2 2e2c4b1888 Fix scheme socket double write. 2023-07-03 18:40:58 +02:00
Anhad Singh 7cc2f4eff7 virtio-gpu: start working on the scheme
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-07-03 17:12:59 +10:00
Jeremy Soller f91770ed64 Merge branch 'core' into 'master'
virtio: add `virtio-net` drivers

See merge request redox-os/drivers!95
2023-06-30 12:44:17 +00:00
Jeremy Soller 5a5eb25d91 Merge branch 'master' into 'master'
drivers: add `virtio-blk`

See merge request redox-os/drivers!94
2023-06-30 12:21:53 +00:00
Jeremy Soller 6bebf36be9 Merge branch 'pipe_scheme' into 'master'
Replace pipe2 with pipe scheme and fix warnings

See merge request redox-os/bootstrap!2
2023-06-30 12:20:35 +00:00
Anhad Singh 4bbda21f0b drivers: start building virtio-gpu
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-29 16:37:59 +10:00
Anhad Singh a720cf6f44 virtio-core::probe: make sure the addr is aligned
sys_physmap() requires the address to be page aligned. This fixes the
panic inside the `virtio-gpu` driver.

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-29 16:36:02 +10:00
Anhad Singh c898e2e01f virtio-core: make send async
This allows for us to do cool stuff such as
`join!(queue.send(read_command), queue.send(write_command),
queue.send(read_command_2))`

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-29 14:21:34 +10:00
Anhad Singh 92fd7fc553 virtio-core::ChainBuilder: automagically add the NEXT flag
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-28 15:06:23 +10:00
Anhad Singh 97e77e21b6 virtio-net: scheme :^)
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-28 12:58:51 +10:00
4lDO2 d7fd637ca3 Fix warnings. 2023-06-27 16:40:31 +02:00
4lDO2 c6c46803d2 Replace pipe2 with pipe scheme. 2023-06-27 16:37:59 +02:00
Anhad Singh 6968a548d9 virtiod: rename to virtio-blkd
* Rename to `virtio-blkd`
* Start working on `virtio-netd`

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-27 10:26:04 +10:00
Anhad Singh eee780fa0f virtiod: split into virtio-core and virtiod
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-27 09:51:16 +10:00
Anhad Singh ea1c855cdc virtiod: make use of the int_roundings feature
* Removes the need to define `round_up` and `div_round_up`

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-26 09:55:48 +10:00
Anhad Singh 65c4317564 virtiod: refactoring
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-23 16:18:14 +10:00
Anhad Singh c176903905 virtio-blk: read and scheme
* Minor code cleanup
* Able to read/write from the disk
* Recycle the descriptors (this is currently done inefficiently, will be
  fixed in a follow up commit)
* Add the disk scheme for virtio-blk with working functionality for seek(),
  read() and open()
* After all of this work, we are successfully able to boot redox from
  virtio-blk!! :)

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-23 12:41:07 +10:00
Jeremy Soller ede1bfc2be Merge branch 'libc_sigaction' into 'master'
Use libc for sigaction.

See merge request redox-os/audiod!1
2023-06-21 19:27:29 +00:00
4lDO2 53f66d11ff Use libc for sigaction. 2023-06-20 16:24:42 +02:00
Anhad Singh 576302a618 virtio-blk: get device config
* Get the device config for virtio-blk
* Log out the # sectors and the block size

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-20 14:17:31 +10:00
Anhad Singh 8fb5e353ea virtio::transport: setup queue
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-20 14:14:22 +10:00
Anhad Singh 990a9c2716 virtio::transport: finalize features
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-20 10:14:10 +10:00
Anhad Singh 8a7fa569a7 virtiod: ensure the device has MSI-X support
According to the virtio sspecification v1.2, MSI-X support is REQUIRED
and is the only supported method anyways (i.e, legacy int and MSI wont
work).

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-20 10:00:08 +10:00
Anhad Singh 100ff9abd4 virtio: add check_device_feature and ack_driver_feature for
`StandardTransport`.

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-19 16:33:00 +10:00
Anhad Singh 12551d450f virtio: enable and allocate MSI-X vector
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-19 15:12:44 +10:00
Anhad Singh fe22264571 misc: include virtiod in the README
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-19 12:22:03 +10:00
Anhad Singh f750d4223d virtio: perform the device reset
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-19 12:19:57 +10:00
Anhad Singh 7e5a3196c2 pcid::server_handle: add get_capabilities
This commit adds the `get_capabilities` function to `PcidServerHandle`
which returns all of the `Capability`s (raw representation) of the PCI
device.

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-19 12:18:56 +10:00
Anhad Singh 1580cb8c83 virtio: stub!
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-19 12:02:35 +10:00
Jeremy Soller 5400dc1213 Merge branch 'remove_physunmap' into 'master'
Remove all usages of physunmap

See merge request redox-os/drivers!93
2023-06-11 14:12:01 +00:00
4lDO2 a5a3f3341f Remove all usages of physunmap. 2023-06-11 11:33:27 +02:00
Jeremy Soller 78d332c003 Merge branch 'stable-alloc' into 'master'
Use the free functions in std::alloc instead of Global as AllocRef

See merge request redox-os/drivers!77
2023-05-30 21:26:17 +00:00
Noa e673b4e3b1 Use the free functions in std::alloc instead of Global as AllocRef 2023-05-30 13:01:45 -05:00
Jeremy Soller b05402e92b ided: add timeouts to loops and better debugging 2023-05-11 20:31:02 -06:00
Jeremy Soller 78b41c1d72 Merge branch 'rw_van_230406' into 'master'
Add AmlHandler read/write of physaddr

See merge request redox-os/drivers!92
2023-04-14 14:19:19 +00:00
Ron Williams 9fb4a8be04 Add AmlHandler read/write of physaddr 2023-04-13 19:09:07 -07:00
Jeremy Soller 985d870fa2 Merge branch 'update-orbclient' into 'master'
Update orbclient

See merge request redox-os/drivers!91
2023-04-05 14:55:47 +00:00
Will Angenent d682fb7994 Update orbclient 2023-04-04 18:21:31 +01:00
Jeremy Soller dc665af7ce Merge branch 'rw_van_230328' into 'master'
acpi: Add aml serde with separate library for definitions

See merge request redox-os/drivers!90
2023-03-29 12:56:38 +00:00
Ron Williams 1baac63934 clean up aml symbols 2023-03-29 01:41:13 -07:00
Ron Williams 23be7ed63c Add serde with separate library for definitions 2023-03-27 20:58:59 -07:00
Jeremy Soller ef48f4aa9a Merge branch 'master' into 'master'
New section on README.

See merge request redox-os/drivers!89
2023-03-26 23:30:58 +00:00
Ribbon e1605444a8 New section on README. 2023-03-26 23:30:58 +00:00
Jeremy Soller 9af4c3bd18 Merge branch 'rw_van_230321' into 'master'
temporarily use forked library for AML

See merge request redox-os/drivers!88
2023-03-22 00:46:00 +00:00
Ron Williams 9333d9acea temporarily use forked library for AML 2023-03-21 17:14:50 -07:00
Jeremy Soller c26eb11cf1 Support read/write I/O on x86 2023-03-07 19:26:54 -07:00
Jeremy Soller 7d7a706cb3 Update aml to 0.16.3 2023-03-03 18:24:17 -07:00
Jeremy Soller 9ba1358077 Used patched aml 2023-03-02 17:56:19 -07:00
Jeremy Soller 40334044aa Revert "Make acpid a no-op on i686 until aml crate issue is fixed"
This reverts commit 6cd802b9b4.
2023-03-02 17:54:36 -07:00
Jeremy Soller 6cd802b9b4 Make acpid a no-op on i686 until aml crate issue is fixed 2023-03-02 12:01:24 -07:00
Jeremy Soller 79a9f447d2 xhci: workaround packet size and protocol speed issues on real hardware 2023-02-16 15:57:28 -07:00
Jeremy Soller afb12dc98b xhci: ensure doorbell is rung after irq reactor has state 2023-02-16 15:28:34 -07:00
Jeremy Soller f0ff668f0c xhcid: fix direction of status stage in scheme 2023-02-16 07:39:35 -07:00
Jeremy Soller 96246acca5 pcid: Optimize PCI bus scanning 2023-02-15 20:05:25 -07:00
Jeremy Soller 6fb6fa34cb ahci: logging adjustments 2023-02-15 19:36:12 -07:00
Jeremy Soller b6321aa764 nvme: logging adjustments 2023-02-15 19:34:05 -07:00
Jeremy Soller 5bbe2e3f4c ahci, ihda, pci, xhci: logging adjustments 2023-02-15 19:30:59 -07:00
Jeremy Soller 98a3106749 ihda, usbhid, xhci: logging adjustments 2023-02-15 19:24:50 -07:00
Jeremy Soller 00720cc95b ihdad: adjust log levels 2023-02-15 19:17:55 -07:00
Jeremy Soller e62b798a8b xhci: Fix status stage TRB direction in get_desc_raw 2023-02-15 13:13:39 -07:00
Jeremy Soller a86f32e67a xhci: Workaround for missing interrupts 2023-02-15 11:47:48 -07:00
Jeremy Soller 15f5b38ea9 Update libc crate 2023-02-11 14:44:43 -07:00
Jeremy Soller 717ece2a54 Update libc crate 2023-02-11 14:44:22 -07:00
Jeremy Soller d3445af7f6 Update libc crate 2023-02-11 14:43:51 -07:00
Jeremy Soller 74cfc428dc Update libc crate 2023-02-11 14:43:04 -07:00
Jeremy Soller 513564a4d3 Update libc crate 2023-02-11 14:42:57 -07:00
Jeremy Soller 1dee81c757 Update libc crate 2023-02-11 14:42:46 -07:00
Jeremy Soller c8ccaf79ff Update libc crate 2023-02-11 14:42:11 -07:00
Jeremy Soller 111cae7362 Update libc crate 2023-02-11 14:41:54 -07:00
Jeremy Soller 625064004d Update for new Rust nightly 2023-02-11 14:37:22 -07:00
Jeremy Soller 3b4e0652bd Merge branch 'master' into 'master'
Add drivers description.

See merge request redox-os/drivers!87
2023-02-08 19:03:03 +00:00
Alberto Souza 800c56f15a Add README.md 2023-02-08 18:55:59 +00:00
Jeremy Soller 6789f2846d Merge branch 'rw_van_230127' into 'master'
Add description text in toml format for each symbol in acpi:/symbols

See merge request redox-os/drivers!86
2023-01-29 13:18:35 +00:00
Ron Williams 9c739d7648 Add description text in toml format for each symbol in acpi:/symbols 2023-01-28 22:47:28 -08:00
Jeremy Soller fcfaca7ec3 Merge branch 'rw_van_230122' into 'master'
switch to aml crate, implement acpi:/symbols

See merge request redox-os/drivers!85
2023-01-23 13:21:26 +00:00
Ron Williams f4564d6caf switch to aml crate, implement acpi:/symbols 2023-01-22 19:42:41 -08:00
Jeremy Soller c9722c4024 More work on sb16 driver 2023-01-21 16:14:04 -07:00
Jeremy Soller eb7b811c36 Add initial sb16 driver 2023-01-21 14:24:40 -07:00
Jeremy Soller d74a406dcd rtl8168d: Allow use of BAR1 for 32-bit systems 2023-01-20 13:30:41 -07:00
Jeremy Soller ee03583b58 Prevent drives from being opened more than once 2023-01-11 21:34:33 -07:00
Jeremy Soller e0bf7a95f5 ihda: Remove LineOut from supported devices, it breaks some laptops 2022-12-18 10:59:58 -07:00
Jeremy Soller 24022dc37a Use Super for screen toggle, allowing apps to use function keys 2022-12-17 15:40:40 -07:00
Jeremy Soller 163a6b525e vesad: support partial sync 2022-12-16 08:27:20 -07:00
Jeremy Soller debb678901 ahci: remove pause function 2022-12-06 10:35:16 -07:00
Jeremy Soller 970cfd2862 ide: yield instead of spin 2022-12-02 10:45:11 -07:00
Jeremy Soller 5874776304 xhci: temporarily ignore bos descriptors 2022-12-02 08:25:13 -07:00
Jeremy Soller 508a2ee4de xhci: default to debug logging 2022-12-02 08:24:54 -07:00
Jeremy Soller 6187ea09bc xhci: port reset outside of async code, assume slot type is 0 if missing 2022-12-02 08:24:28 -07:00
Jeremy Soller 7a8177e15e xhci: Derive log file name from scheme name 2022-11-28 06:56:12 -07:00
Jeremy Soller f3e678cb8a xhci: Fix deadlock when a stall is recieved 2022-11-28 06:55:00 -07:00
Jeremy Soller 4b54a3d2cd xhci: Add DescriptorKind derives 2022-11-28 06:53:04 -07:00
Jeremy Soller 2f15288beb xhci: Perform both port reset and controller reset 2022-11-28 06:52:20 -07:00
Jeremy Soller 43375cbe9d xhci: Warn on unknown BOS instead of panic 2022-11-27 16:31:04 -07:00
Jeremy Soller c3ddedafc4 ahcid: Yield instead of spin when waiting for interrupt 2022-11-27 11:45:50 -07:00
Jeremy Soller d42f626808 nvmed: Yield instead of spin when waiting for submission queue item 2022-11-27 09:25:03 -07:00
Jeremy Soller fc4a69ccf9 ihda: Fix copy pasted rtl8168 names 2022-11-23 11:47:19 -07:00
Jeremy Soller 089280a62c Pass-through volume keys 2022-11-22 13:35:40 -07:00
Jeremy Soller cd3bfc04fc ps2: Ensure that scancode set is always translated to orbital constants 2022-11-22 13:14:19 -07:00
Jeremy Soller 43704e56f0 ps2: Handle extended (prefixed with 0xE0) keycodes 2022-11-22 12:15:53 -07:00
Jeremy Soller 336a25d644 ihda: fix compilation on i686 2022-11-21 15:52:54 -07:00
Jeremy Soller 7448cbff2d ihda: Select output based on pin sense and prioritized device type 2022-11-21 14:38:10 -07:00
Jeremy Soller 91c4085488 ihda: remove unused HDANode members 2022-11-21 14:25:52 -07:00
Jeremy Soller 20474ef5f7 Make volume curve cubed instead of squared 2022-11-21 12:09:25 -07:00
Jeremy Soller acd75dcb0d Improve volume curve 2022-11-21 10:58:37 -07:00
Jeremy Soller 7eada2053b Adjust volume in audiod instead 2022-11-21 09:56:23 -07:00
Jeremy Soller 8ff9a0bed6 Add volume control 2022-11-21 09:53:47 -07:00
Jeremy Soller 9315af5e41 Match ac97 and hda buffering 2022-11-20 13:16:51 -07:00
Jeremy Soller c57b3c8910 rtl8168: enable MSI and MSI-X 2022-11-19 16:18:39 -07:00
Jeremy Soller 860dd2ee31 ihda: Reduce default volume 2022-11-19 08:21:32 -07:00
Jeremy Soller ff205ad65d ihda: Enable MSI and use pcid channel 2022-11-19 08:18:51 -07:00
Jeremy Soller 4dc0cba159 ihda: Improvements to configure, add codec file 2022-11-18 14:37:11 -07:00
Jeremy Soller aadf2ec9dc ihda: Add 1ms polling 2022-11-18 14:36:28 -07:00
Jeremy Soller 7c3f177ec0 ihda: Set correct intctl based on number of streams 2022-11-18 14:25:34 -07:00
Jeremy Soller 304dcad78b ihda: Use default connection for finding dac 2022-11-16 14:56:11 -07:00
Jeremy Soller 2564997cac ac97: make driver work 2022-11-15 14:52:18 -07:00
Jeremy Soller d7ca6eeeed ac97: add stub driver for AC97 2022-11-15 13:37:31 -07:00
Jeremy Soller 2cdfb46a71 Use audiohw: instead of hda: 2022-11-15 12:43:22 -07:00
Jeremy Soller b0d7fedc37 Use audiohw: instead of hda: 2022-11-15 12:43:08 -07:00
Jeremy Soller c993b0ef40 ihdad: Turn on by default 2022-11-15 11:07:48 -07:00
Jeremy Soller c63fe7f2d6 ihdad: attempt to enable headphone jacks 2022-11-15 11:07:37 -07:00
Jeremy Soller 0fe60a00fc ihdad: improve logging 2022-11-15 10:58:00 -07:00
Jeremy Soller c8ca7940d4 ihdad: increase buffers to 4 to eliminate stuttering (mostly) 2022-11-15 09:02:25 -07:00
Jeremy Soller 39df471bc2 Enable LTO 2022-11-02 14:36:53 -06:00
Jeremy Soller 766020195b Note when there is a missing USB driver 2022-09-26 11:07:41 -06:00
Jeremy Soller 3313543528 Merge branch 'fix-aarch64-ahcid-build-breakage' into 'master'
aarch64: The use of yield needs the stdsimd feature apparently

See merge request redox-os/drivers!82
2022-09-26 16:20:53 +00:00
Robin Randhawa 08542ae288 aarch64: The use of yield needs the stdsimd feature apparently 2022-09-26 17:17:32 +01:00
Jeremy Soller a4a3c4f7e8 vesad: Support multiple displays 2022-09-25 16:46:13 -06:00
Jeremy Soller c651590cbd Fix booting on systems which always return 0xFF from ps2 ports 2022-09-21 15:57:09 -06:00
Jeremy Soller cbcf133518 vesad: use framebuffer stride 2022-09-16 13:28:04 -06:00
Jeremy Soller 14be75f29f ided: Add trace logs for IDE read/write 2022-09-14 08:33:48 -06:00
Jeremy Soller 2462857e2d ided: Improvements to DMA code, fixes some virtualbox issues 2022-09-13 14:38:50 -06:00
Jeremy Soller b8cb9d0e03 ided: DMA support 2022-09-12 21:48:14 -06:00
Jeremy Soller a6bafa17b0 Add pcid methods to read/write pci config region 2022-09-12 21:47:16 -06:00
Jeremy Soller 91bb118d73 ided: support 28-bit LBA 2022-09-10 15:43:01 -06:00
Jeremy Soller 4d05737b63 ps2d: Increase timeouts 2022-09-09 09:29:10 -06:00
Jeremy Soller ae66182c4e Name disk driver log files based on scheme name 2022-09-09 08:51:02 -06:00
Jeremy Soller efc5cc712d Disable xhcid until it works on real hardware 2022-09-09 08:38:52 -06:00
Jeremy Soller 303b5ae6b8 ps2d: Improve timing and control over device scanning 2022-09-08 18:19:47 -06:00
Jeremy Soller 80c60f0111 ps2d: Set resolution and scaling instead of using defaults 2022-09-08 10:40:03 -06:00
Jeremy Soller a0300e2d9c ps2d: Use thread::yield_now to ensure delays are acceptable 2022-09-08 10:08:12 -06:00
Jeremy Soller 49ba91b0ee Improvements to ps2 mouse init 2022-09-08 09:55:06 -06:00
Jeremy Soller 2751d7d792 ahcid: Use pause instead of yield 2022-09-07 20:37:11 -06:00
Jeremy Soller 09465d3640 ided: Do I/O in 64 KiB chunks 2022-09-07 16:23:57 -06:00
Jeremy Soller 4fe7733cad ided: Use pause instruction instead of yield_now when waiting for status 2022-09-07 16:14:56 -06:00
Jeremy Soller a7848cc079 Fix control base register 2022-09-07 15:47:08 -06:00
Jeremy Soller 08a1595f54 Implement ided using PIO and code from ahci 2022-09-07 15:28:04 -06:00
Jeremy Soller 41217ad6fa Add ided stub 2022-09-07 12:16:16 -06:00
Jeremy Soller e2a8255547 Allow reading PCI header through pcid socket 2022-09-07 12:15:41 -06:00
Jeremy Soller 3ed83c74cf Workaround for real hardware prp issue 2022-09-07 12:01:15 -06:00
Jeremy Soller fc8ef508a5 xhcid: Make polling mode code match normal irq code 2022-09-02 11:32:38 -06:00
Jeremy Soller 988cb5c066 xhcid: fix polling mode 2022-09-02 11:24:35 -06:00
Jeremy Soller c68aaac16c Improvements for USB keyboard 2022-09-01 08:01:24 -06:00
Jeremy Soller ecb53b977d QEMU USB touchscreen support 2022-08-31 21:15:13 -06:00
Jeremy Soller 83779b1b5b Implement simple usb mouse driver 2022-08-31 18:44:18 -06:00
Jeremy Soller c848aba481 USB HID report debug 2022-08-31 17:44:59 -06:00
Jeremy Soller fe13ea390a Add feature for nvmed to not use reactor thread 2022-08-31 10:53:21 -06:00
Jeremy Soller 4bca3e55d3 Fix xhcid compilation 2022-08-31 08:49:39 -06:00
Jeremy Soller 0e85c01ea3 Implement 64-bit BARs 2022-08-31 08:46:53 -06:00
Jeremy Soller e70d6b7ffb Update to redox_syscall 0.3.4 2022-08-31 08:46:41 -06:00
Jeremy Soller efab53910e Return error on nvme completion status 2022-08-30 11:59:10 -06:00
Jeremy Soller 55526d6ab0 Do not set SGL flag, we only use PRP 2022-08-30 11:51:00 -06:00
Jeremy Soller b13bcf729a Update redox-syscall 2022-08-30 10:34:29 -06:00
Jeremy Soller 3379a64258 Fix for last nvmed commit 2022-08-30 10:15:26 -06:00
Jeremy Soller 50338d9b24 Remove unnecessary event queue from nvmed 2022-08-30 09:56:12 -06:00
Jeremy Soller 83e7da750d Read actual BGA resolution when updating display resolution 2022-08-27 17:16:15 -06:00
Jeremy Soller 86b065d724 Allow boot to continue if HCI probe does not return 2022-08-27 08:33:53 -06:00
Jeremy Soller 8bbf1d8f5b Fix typo in xhcid 2022-08-27 08:18:19 -06:00
Jeremy Soller 1effea3ce8 Update redox-exec 2022-08-24 18:42:27 -06:00
Jeremy Soller 32674f3193 Update dependencies 2022-08-24 15:51:49 -06:00
Jeremy Soller 7c1707c7de Ignore some ps2 init errors to improve compatibility 2022-08-23 07:58:24 -06:00
Jeremy Soller 734bb92776 Update redox_syscall 2022-08-22 08:59:21 -06:00
Jeremy Soller b194ed5639 Update redox-exec 2022-08-20 20:28:49 -06:00
Jeremy Soller 28c12e0382 Add aarch64 code 2022-08-19 12:51:27 -06:00
Jeremy Soller 3d75c04628 Convert use of lea instruction 2022-08-19 11:53:20 -06:00
Jeremy Soller af040956df Simplify 32-bit x86 assembly 2022-08-19 10:13:28 -06:00
Jeremy Soller 00fbd71519 Reduce complexity of arch-specific assembly 2022-08-19 10:05:24 -06:00
Jeremy Soller 62283649ba Update redox-exec 2022-08-18 15:25:50 -06:00
Jeremy Soller 7e8b92045f Update relibc 2022-08-17 14:21:47 -06:00
Jeremy Soller fb93690ea4 Use BITS 32 for 32-bit assembly 2022-08-17 14:02:51 -06:00
Jeremy Soller 639ba80612 Fix argument registers for i686 2022-08-17 11:19:23 -06:00
4lDO2 04f9c840c7 Add LICENSE 2022-08-16 10:49:42 +00:00
Jeremy Soller 0b094452d7 Merge branch 'relibc_cwd' into 'master'
Adapt to cwd only being in relibc.

See merge request redox-os/bootstrap!1
2022-08-16 09:18:03 +00:00
4lDO2 35a8c6d9ac Use upstream relibc again. 2022-08-16 11:02:08 +02:00
4lDO2 91a389cebf Adapt to cwd only being in relibc. 2022-08-12 15:05:37 +02:00
4lDO2 f99c17ab4a Fix reading directories in initfs. 2022-07-29 23:50:47 +02:00
Jeremy Soller 015b9ebd43 Update redox-exec 2022-07-29 09:54:28 -06:00
Jeremy Soller ff56ac5499 Add x86 32-bit support 2022-07-29 08:58:57 -06:00
4lDO2 6772933553 Don't link directly with relibc, use redox-exec. 2022-07-28 14:21:16 +02:00
4lDO2 af873f7626 Update redox_syscall dependency. 2022-07-27 17:55:39 +02:00
Jeremy Soller c644ce9e7d Merge branch 'userspace_fexec' into 'master'
Userspace fexec

See merge request redox-os/drivers!81
2022-07-27 15:21:31 +00:00
4lDO2 156f1d4e52 Use redox-daemon 2022-07-27 16:41:47 +02:00
4lDO2 54d64d6ecb Use redox-daemon 2022-07-27 16:39:18 +02:00
4lDO2 d1709e5dbc Use redox-daemon 2022-07-27 16:37:11 +02:00
4lDO2 934f1307a3 Use redox-daemon 2022-07-27 16:34:00 +02:00
4lDO2 c930dfdc08 Replace syscall::clone() with libc::fork(). 2022-07-27 16:30:29 +02:00
4lDO2 d3fd7f2dbe Use redox-daemon 2022-07-27 16:29:09 +02:00
4lDO2 4b1b17cf3c Use redox-daemon 2022-07-27 16:26:50 +02:00
4lDO2 21e30b7339 Replace syscall::clone() with libc::fork(). 2022-07-27 16:25:01 +02:00
4lDO2 badd5906d5 Page-align size in physmap. 2022-07-27 15:33:25 +02:00
4lDO2 322af701d6 Use aligned addresses in physmap. 2022-07-27 15:33:21 +02:00
Jeremy Soller 71fd85ce53 Update Cargo.lock 2022-07-26 17:37:27 -06:00
Jeremy Soller ec22a4f393 Update Cargo.lock 2022-07-26 17:32:02 -06:00
Jeremy Soller cb9656d83d Fix minor issue on x86_64 2022-07-26 17:31:02 -06:00
Jeremy Soller 1668052a1c Update Cargo.lock 2022-07-26 17:27:40 -06:00
Jeremy Soller 00de428d6b Workarounds for x86 32-bit 2022-07-26 17:20:34 -06:00
Jeremy Soller 4ac01b10e9 Update Cargo.lock 2022-07-26 16:15:38 -06:00
Jeremy Soller 090b0ba8cf Update Cargo.lock 2022-07-26 16:15:06 -06:00
Jeremy Soller 3264ab537b Update Cargo.lock 2022-07-26 16:14:23 -06:00
Jeremy Soller 4e8083eb60 Update Cargo.lock 2022-07-26 16:14:06 -06:00
Jeremy Soller 0c87d80852 Update Cargo.lock 2022-07-26 16:13:20 -06:00
Jeremy Soller da8ecef8a7 Workarounds for aarch64 support 2022-07-26 16:11:45 -06:00
Jeremy Soller 860821c150 Support compilation on more architectures 2022-07-26 16:01:54 -06:00
Jeremy Soller fd45fa2818 Update Cargo.lock 2022-07-26 15:21:04 -06:00
Jeremy Soller b15b3193b8 Use syscall::Daemon 2022-07-25 10:49:48 -06:00
4lDO2 0b7d6139ae Use redox-daemon 2022-07-18 16:20:33 +02:00
4lDO2 da090b007d Serve the initfs scheme here 2022-07-12 14:11:45 +02:00
4lDO2 6eaec937d7 Remove commented code. 2022-07-07 19:30:36 +02:00
4lDO2 3dac3d1ed6 Fix env parsing. 2022-07-05 14:24:17 +02:00
4lDO2 f174685820 Initial Commit. 2022-07-05 14:06:59 +02:00
Jeremy Soller aedeb00e58 ps2d: Fix issue with VirtualBox controller init 2022-05-02 13:37:16 -06:00
Jeremy Soller 465aaa6d34 Make config and set_config retry, switch timeouts to spin loops 2022-04-28 08:20:20 -06:00
Jeremy Soller 568203d91b Make ps2d compatible with more laptops 2022-04-27 21:50:32 -06:00
Jeremy Soller 2ad84308bf Daemonize ps2d before doing ps2 init 2022-04-27 20:38:41 -06:00
Jeremy Soller 64f40c584b Fix ps2d daemon name in log messages 2022-04-27 15:12:52 -06:00
Jeremy Soller 0e9e91ddef Improve ps2d retries, fixes a few PS/2 mice 2022-04-27 15:07:25 -06:00
Jeremy Soller 59d3260722 Increase ps2d timeouts 2022-04-25 09:11:24 -06:00
Jeremy Soller 1991764a0b Add log context if it is set. Remove timestamp feature 2022-04-19 18:22:56 -06:00
Jeremy Soller 8bb6986dbc Use requesting process's PID to ensure output is not jumbled 2022-04-19 18:18:20 -06:00
Jeremy Soller b4256fdf00 Improve ahcid error format 2022-04-19 18:03:52 -06:00
Jeremy Soller ed5257e23f Enable xhcid and make usbhidd more quiet 2022-04-13 17:01:43 -06:00
Jeremy Soller a3a76284cb xhcid: set logging filter to info 2022-04-13 09:05:26 -06:00
Jeremy Soller 8db1781146 xhcid: use actual BAR size 2022-04-12 20:34:56 -06:00
Jeremy Soller 84a20ca706 Send events to orbital 2022-04-11 20:32:50 -06:00
Jeremy Soller 220e13c2d6 Map USB keyboards using us layout 2022-04-11 20:28:44 -06:00
Jeremy Soller 8e1f91137e e1000d: use syscall::Daemon 2022-04-01 18:02:49 -06:00
4lDO2 3795ea4893 Merge branch 'update-toolchain-2022' into 'master'
Update toolchain to 2022-03-18.

See merge request redox-os/drivers!79
2022-03-27 10:04:06 +00:00
4lDO2 89b8fb8984 Refactor into a separate library and tools crate. 2022-03-26 18:15:49 +01:00
4lDO2 d5a98187a4 Update syscall 2022-03-25 21:02:13 +01:00
4lDO2 1804f1a302 Update syscall 2022-03-25 15:28:35 +01:00
4lDO2 1af1a597f2 Update syscall 2022-03-25 15:27:52 +01:00
4lDO2 1c1eccdcc0 Update syscall 2022-03-25 15:27:33 +01:00
4lDO2 8669516ecd Update syscall 2022-03-25 15:23:27 +01:00
4lDO2 98d6f67d41 Update syscall 2022-03-25 15:10:04 +01:00
4lDO2 3aa241558c Update syscall 2022-03-25 15:08:49 +01:00
4lDO2 44f7557f12 Update syscall 2022-03-25 15:07:06 +01:00
4lDO2 e05506d0f3 Update syscall 2022-03-25 14:52:12 +01:00
4lDO2 07f10fb4d1 Update redox_syscall to v0.2.12 2022-03-24 16:06:00 +01:00
4lDO2 d426ffacea Update toolchain to 2022-03-18. 2022-03-19 15:06:29 +01:00
Jeremy Soller 0e6698de64 ps2d: Wait for ps2 initialization before sending daemon ready 2022-03-01 21:46:15 -07:00
Jeremy Soller 76d46d9236 p2sd: disable second port if no mouse found 2022-03-01 21:41:55 -07:00
Jeremy Soller 397f45e19d p2sd: fixes for mouseless systems 2022-03-01 21:34:53 -07:00
Jeremy Soller c69ee40684 Print out selected keymap 2022-03-01 20:56:08 -07:00
Jeremy Soller c5a1013bc2 rtl8168d: use syscall::Daemon 2022-03-01 20:34:27 -07:00
Jeremy Soller 0ff0c42ce6 p2sd: Add timeout handling 2022-03-01 20:34:13 -07:00
Jeremy Soller 04ceace6a9 Use syscall::Daemon, enter null namespace 2022-03-01 07:19:33 -07:00
Jeremy Soller ca64072b38 Use syscall::Daemon 2022-02-28 15:13:46 -07:00
Jeremy Soller 64b49f10a0 Fix vesad rusttype feature 2022-02-28 14:23:47 -07:00
Jeremy Soller ac92188447 Move bgad and vboxd out of initfs 2022-02-28 14:17:34 -07:00
Jeremy Soller 0a617abb36 Disable xhcid 2022-02-28 14:10:41 -07:00
Jeremy Soller d31133956d Remove debug: logging from acpid, logd now handles that 2022-02-28 14:02:58 -07:00
Jeremy Soller 88fc91dfb7 Only create acpi scheme after tables are found and parsed 2022-02-28 11:21:47 -07:00
Jeremy Soller 70cb1051cb Support multiple outputs and fix dup 2022-02-14 10:37:56 -07:00
Jeremy Soller 07a2c5d590 Do not require display:input in usbhidd yet 2022-02-14 10:12:12 -07:00
Jeremy Soller d40a908cfd Add logging to usbhidd 2022-02-14 09:38:40 -07:00
Jeremy Soller 0cd3a6b797 Fix scheme name for xhcid and launch drivers 2022-02-14 09:38:31 -07:00
Jeremy Soller 88a6eb17e9 Make nvmed less async, reduces hangs 2022-02-11 14:26:21 -07:00
Jeremy Soller a1d8b81428 Increase NVME debug level 2022-02-11 11:00:50 -07:00
Jeremy Soller 544f1cbebc nvmed,xhcid: print BAR number 2022-02-11 10:44:38 -07:00
Jeremy Soller 33ef3a3262 xhcid: panic if BAR is 0 2022-02-11 10:42:05 -07:00
Jeremy Soller b9d6ca7db5 nvmed: panic if BAR is 0 2022-02-11 10:41:56 -07:00
Jeremy Soller 5e42b0697e Skip parsing vendor caps with length 0 2022-02-11 09:23:48 -07:00
Jeremy Soller 4a8059302f Disable ihdad, it causes issues on real hardware 2022-02-11 08:53:41 -07:00
Jeremy Soller 5e3248ce26 Get vesad framebuffer from env 2022-02-05 19:57:11 -07:00
Jeremy Soller 36b3af4262 ihdad logging 2021-12-01 16:14:15 -07:00
Jeremy Soller 4da3ceb723 Workaround hang on real hardware 2021-08-10 18:25:44 -06:00
4lDO2 08d18160ee Fix overwrite of image while writing inodes. 2021-07-02 14:22:35 +02:00
4lDO2 312499d042 Derive Clone and Copy for Entry. 2021-06-30 12:33:28 +02:00
4lDO2 0a41ea5b8f Implement more traits for Inode. 2021-06-30 12:13:19 +02:00
4lDO2 811f58cc9a Add #![no_std]. 2021-06-29 21:09:43 +02:00
4lDO2 2a9d380f02 Merge branch 'update_dependencies' into 'master'
Update dependencies.

See merge request redox-os/drivers!78
2021-06-18 15:24:25 +00:00
Jeremy Soller 400a50661f Merge branch 'update_dependencies' into 'master'
Update dependencies.

See merge request redox-os/netstack!36
2021-06-17 20:30:39 +00:00
4lDO2 7a2b3d7656 Update dependencies. 2021-06-17 18:18:27 +02:00
4lDO2 8f7d759508 Update dependencies. 2021-06-17 18:15:31 +02:00
4lDO2 0ed497fe23 Update syscall. 2021-06-17 14:39:09 +02:00
4lDO2 4080e5dd09 Update syscall. 2021-06-17 14:37:32 +02:00
4lDO2 73e48331bf Update syscall. 2021-06-17 14:36:19 +02:00
4lDO2 6e5c133b17 Update syscall. 2021-06-17 14:34:55 +02:00
4lDO2 db3ae355bc Update syscall. 2021-06-17 14:34:23 +02:00
4lDO2 e19c81559b Update syscall. 2021-06-17 14:33:18 +02:00
4lDO2 280bbcec2a Update dependencies. 2021-06-17 14:28:38 +02:00
4lDO2 7a9536c380 Update syscall. 2021-06-17 14:25:46 +02:00
Jeremy Soller 5a279d4081 Use redox-log in ahcid 2021-06-01 21:37:52 -06:00
Jeremy Soller abb4760379 Merge branch 'acpid' into 'master'
Add a userspace ACPI driver.

See merge request redox-os/drivers!75
2021-05-06 18:30:39 +00:00
Jeremy Soller 21c62fd61f Allow character devices to be used as run input 2021-05-05 21:14:49 -06:00
Jeremy Soller 7e735ba11e Update dependencies 2021-04-28 20:57:08 -06:00
Jeremy Soller 4e42e03be9 Update dependencies 2021-04-28 20:55:40 -06:00
Jeremy Soller 8f833bf545 Update dependencies 2021-04-28 20:48:07 -06:00
Jeremy Soller 15dc86a1d7 Update dependencies 2021-04-28 20:45:53 -06:00
Jeremy Soller bee08cbdf1 Update dependencies 2021-04-28 20:42:59 -06:00
4lDO2 fd83cd3ac7 Add license. 2021-04-01 19:11:37 +02:00
4lDO2 7206288e72 Handle O_TRUNC properly.
This ensures that files that were replaced due to O_CREAT, will now be
emptied when O_TRUNC is passed (which is the default).
2021-04-01 19:08:44 +02:00
4lDO2 eaf78bb51b Run rustfmt.
In the future we should add CI with a rustfmt check, making correct
formatting a hard requirement.
2021-04-01 09:46:17 +02:00
4lDO2 7f3938c774 Merge branch 'fix-duplicate-files' into 'master'
ramfs: Fix duplicated files bug

See merge request redox-os/ramfs!3
2021-04-01 07:38:36 +00:00
Joshua Abraham 70e52d4ec9 ramfs: Fix duplicated files bug
Previously ramfs allowed identical filenames to be created if the
O_CREAT flag was used. This patch fixes the behavior and instead
opens the existing file as long as O_EXCL is not specified.
2021-03-31 19:16:32 -05:00
Jeremy Soller a4fdf5ea30 Revert "Merge branch 'ramfs-nofile' into 'master'"
This reverts merge request !1
2021-03-30 12:41:40 +00:00
4lDO2 93e26f8c37 Merge branch 'missing_ENOENT' into 'master'
Fix missing 'use ENOENT'

See merge request redox-os/ramfs!2
2021-03-30 12:11:48 +00:00
James Graves 737a41854d Fix missing 'use ENOENT' 2021-03-30 09:16:06 +00:00
Jeremy Soller 0cfe98150e Merge branch 'ramfs-nofile' into 'master'
ramfs: SchemeMut: return ENOENT in filesystem calls when file does not exist

See merge request redox-os/ramfs!1
2021-03-30 01:57:27 +00:00
Joshua Abraham 4523d80c24 ramfs: SchemeMut: return ENOENT in filesystem calls when file does not exist 2021-03-29 20:38:52 -05:00
4lDO2 641feb01b1 Print parsed tables only with debug verbosity. 2021-03-13 12:40:26 +01:00
4lDO2 c6efa649be Add DMAR parsing.
In the future, this will probably be moved into its own driver, probably
called `intelvtdd` or `intelvfiod`. This is because `acpid` already
provides an interface to read from ACPI tables, which `pcid` has used
for quite long (when that scheme was provided by the kernel). AMD
implements IOMMU as a PCI function, so letting these be separate drivers
would certainly be beneficial.

The same thing might apply for HPET or MADT, which are the only ACPI
tables still parsed in the kernel.
2021-03-13 12:34:56 +01:00
4lDO2 391f7c4184 WIP: Improve acpid logging. 2021-03-12 23:45:16 +01:00
4lDO2 3989477669 Also open a file descriptor in debug:.
This is to allow the shutdown logs to reach serial output before the
system shuts down, which is especially useful on QEMU.
2021-03-11 17:50:17 +01:00
4lDO2 5fc0f0fa4e Successfully parse the namespace. 2021-03-11 12:48:34 +01:00
4lDO2 0feb8685a6 Fix the acpi scheme freeze. 2021-03-11 08:31:43 +01:00
4lDO2 20e6384cca WIP: Implement the userspace ACPI scheme. 2021-03-10 20:50:16 +01:00
4lDO2 7de9816c50 Basic ACPI init code, daemonize. 2021-03-10 18:06:30 +01:00
4lDO2 5d661eab59 Successfully load physical SDTs, and handle kstop*
Well, while it does now wait for the kstop pipe, that is not to say that
it actually performs the ACPI shutdown... yet.
2021-03-10 14:38:43 +01:00
4lDO2 df4a6aee81 Remove global variables, make it compile. 2021-03-10 12:13:28 +01:00
4lDO2 be984885bb WIP: Move ACPI code from kernel to drivers. 2021-03-10 11:24:27 +01:00
4lDO2 00b7674321 Use correct syscall when dropping PCIe context. 2021-03-08 14:37:38 +01:00
4lDO2 ae65c19bad Put the output file handle behind a guard.
This prevents the image from leaking, in case there is an error, as it
removes the file when the guard is dropped, before the "ok" status is
set.
2021-02-20 15:04:40 +01:00
4lDO2 ef6c880595 Add license. 2021-02-20 14:35:45 +01:00
4lDO2 5e9e2e9ca8 Rename utils into redox-initfs-ar. 2021-02-20 14:33:37 +01:00
4lDO2 3b85a1d887 Finish kernel-facing API. 2021-02-20 14:17:40 +01:00
4lDO2 672a92bb51 Create a skeleton for the initfs API for kernel. 2021-02-20 13:59:51 +01:00
4lDO2 1cdb1c7f19 Increse default limit to 64 MiB. 2021-02-20 12:09:56 +01:00
4lDO2 8b5474189d WIP: (probably) complete basic initfs-ar util. 2021-02-20 11:51:33 +01:00
4lDO2 2eefa1a16f Initial Commit 2021-02-19 23:29:04 +01:00
Jeremy Soller 18c14b1d8f Update redox_syscall and redox_termios 2021-01-19 11:34:05 -07:00
Jeremy Soller 16e4064624 Update redox_syscall 2021-01-19 11:24:59 -07:00
Jeremy Soller 0c5c45c580 Update redox_syscall 2021-01-19 11:23:26 -07:00
Jeremy Soller 59c52b4ac4 Update redox_syscall 2021-01-15 13:07:14 -07:00
Jeremy Soller 0485990b08 Update redox_syscall 2021-01-15 13:03:03 -07:00
Jeremy Soller c177f71b21 Update redox_syscall 2021-01-15 13:00:21 -07:00
Jeremy Soller 56c5713e6e Merge branch 'update-syscall-version-plus-buildix' into 'master'
Syscall dependency version bump + Fix build breakage

See merge request redox-os/init!6
2021-01-15 19:45:05 +00:00
Robin Randhawa fc657b5c23 Syscall dependency version bump + Fix build breakage
Breakage needed use of WaitFlags.
2021-01-15 18:01:48 +00:00
Jeremy Soller e6510c20c5 Merge branch 'update-syscall' into 'master'
vesad: Update redox_syscall

See merge request redox-os/drivers!74
2020-11-02 17:43:25 +00:00
jD91mZM2 c255a869ba Don't use a local dependency lmao 2020-10-29 15:57:09 +01:00
jD91mZM2 ca2b3fa2d4 Update to cargo release of redox_syscall 2020-08-27 17:55:01 +02:00
jD91mZM2 85411f2f91 vesad: fix embarassing bug from last commit 2020-08-17 17:00:12 +02:00
jD91mZM2 ac64d09186 vesad: Provide legacy fmap implementation 2020-08-17 16:28:02 +02:00
jD91mZM2 321f708d0f vesad: Update redox_syscall 2020-08-17 14:39:25 +02:00
Jeremy Soller 31bae74334 Merge branch 'code_hygiene' into 'master'
Code hygiene

See merge request redox-os/drivers!72
2020-08-08 12:55:24 +00:00
Jeremy Soller ccd65a0c88 Update redox_syscall 2020-08-02 16:23:39 -06:00
Jeremy Soller 47f62378ed Update smoltcp 2020-08-02 16:07:21 -06:00
Jeremy Soller f6b0ef229a Update redox_syscall 2020-08-02 16:05:05 -06:00
Jeremy Soller 293f4fb988 Update redox_syscall 2020-08-02 16:04:17 -06:00
Jeremy Soller 328b88a4a4 Update redox_syscall 2020-08-02 16:03:50 -06:00
Jeremy Soller 01dc1544a4 Update syscall 2020-08-02 15:38:20 -06:00
Jeremy Soller 9888f74802 Update syscall 2020-08-02 15:37:20 -06:00
Jeremy Soller 2f0ad188dd Update syscall and raw-cpuid 2020-08-02 15:33:32 -06:00
Jeremy Soller 4343ac6b54 Update to newer syscall 2020-08-02 15:31:42 -06:00
Jeremy Soller ec060cca50 Update syscall 2020-08-02 15:27:33 -06:00
Jeremy Soller be101621cc Update to newer syscall 2020-08-02 15:25:03 -06:00
Wren Turkal 6018b6fc49 Fix lint issues from rustc.
Signed-off-by: Wren Turkal <wt@penguintechs.org>
2020-08-01 16:52:47 -07:00
Wren Turkal dadc0c6c10 Remove unused imports.
Signed-off-by: Wren Turkal <wt@penguintechs.org>
2020-08-01 12:48:06 -07:00
Jeremy Soller 63dc11fbb9 Merge branch 'add_pci_vendor_specific_capability' into 'master'
Add pci vendor specific capability.

See merge request redox-os/drivers!71
2020-08-01 18:18:31 +00:00
Jeremy Soller 7b8485a582 Merge branch 'pci_ids_info' into 'master'
Add more structure cli to pcid.

See merge request redox-os/drivers!67
2020-08-01 18:16:31 +00:00
Wren Turkal 65982d5e02 Add more structure cli to pcid.
This change adds a structopt commandline interface to the pcid tool.
This add some help for the arguments that pcid takes.

Signed-off-by: Wren Turkal <wt@penguintechs.org>
2020-08-01 18:16:31 +00:00
Jeremy Soller 9279c4a64b Merge branch 'gitignore_ide_files' into 'master'
Ignore all target directories.

See merge request redox-os/drivers!70
2020-08-01 12:24:56 +00:00
Jeremy Soller 54e9bb544d Merge branch 'fix_cap_parser' into 'master'
Fix buggy assertion in pcid capability parser.

See merge request redox-os/drivers!69
2020-08-01 12:24:06 +00:00
Wren Turkal 39fea64403 Add pci vendor specific capability.
Signed-off-by: Wren Turkal <wt@penguintechs.org>
2020-08-01 00:40:30 -07:00
Wren Turkal 3323a143af Ignore all target directories.
When working in an IDE like vscode, it uses rust infrastructure to
check the code, which results in "target" folders in the base of
the crates I am working on. For example, if I am working on pcid
code, I get a "target" folder in the pcid folder. This change
causes git to ignore all those target directories.

Signed-off-by: Wren Turkal <wt@penguintechs.org>
2020-07-31 21:58:28 -07:00
Wren Turkal 5db50db7a9 Fix buggy assertion in pcid capability parser.
The pcid capability parsing code has an assertion that checks for dword
alignment. Unfortunately, the check was previously checking for
alignment to qwords. This fixes that.

I found this issue by using qemu to emulate adding different pci
devices. I managed to come across a device that had a capability
aligned on dword, but not qword. That exposed the bug.

Signed-off-by: Wren Turkal <wt@penguintechs.org>
2020-07-31 21:39:21 -07:00
Jeremy Soller 5021c68cb3 Merge branch 'fix_pci_bus_scan' into 'master'
Fixed PCI bus scan to scan bus 0xFF.

See merge request redox-os/drivers!68
2020-07-28 13:22:17 +00:00
Wren Turkal 5dfd5f7e7c Fixed PCI bus scan to scan bus 0xFF.
Previously, the PCI bus scan was skipping bus 0xFF. Now it does not.
I used a match expression to make sure that all cases are accounted for.

I also changed the PCI dev scan and PCI func scan to use a match
expression in a similar way to make sure all cases are account. While
this is functionally the same as before, the match expression will not
allow unhandled cases and should be easier to read and make it harder
to introduce bugs.

Signed-off-by: Wren Turkal <wt@penguintechs.org>
2020-07-27 22:49:39 -07:00
Jeremy Soller a16604fc2c e1000d and rtl8168d will use pipe to wait for network: before continuing 2020-07-19 21:04:10 -06:00
Jeremy Soller b99671d8bb Wait for vesad to create display: before continuing 2020-07-16 16:33:29 -06:00
jD91mZM2 b997e03e44 Update Cargo.lock 2020-07-16 16:16:58 +02:00
jD91mZM2 05b16898ee Update Cargo.lock 2020-07-16 15:56:15 +02:00
jD91mZM2 549eb4675a Update Cargo.lock 2020-07-16 15:55:41 +02:00
Jeremy Soller bbec25fa3b ps2d: better error logging 2020-07-15 22:24:12 -06:00
Jeremy Soller 24aa9192cb pcid: Fix extra newlines in log 2020-07-15 22:23:34 -06:00
Jeremy Soller 4b06280e1b Merge branch 'remove_unsafe' into 'master'
Remove unsafe declarations.

See merge request redox-os/drivers!65
2020-07-14 12:56:44 +00:00
Wren Turkal 00b8ad9fc2 Remove unnecessary unsafe declarations.
The removed unsafe statements were identified by rustc as unneeded during
compilation.

Signed-off-by: Wren Turkal <wt@penguintechs.org>
2020-07-14 12:56:44 +00:00
jD91mZM2 ea390f66ac Comment explaining when ipcd connects to existing 2020-06-28 12:23:47 +02:00
Jeremy Soller eedf9edc7d Merge branch 'xhci-32bit-dev' into 'master'
Support xHCs that only support 32-bit physical addresses.

See merge request redox-os/drivers!64
2020-06-18 19:17:20 +00:00
4lDO2 6bd4bb814f Support xHCs that only support 32-bit physical addresses. 2020-06-18 19:17:20 +00:00
4lDO2 ec847e309d Remove all dbg! statements. 2020-06-18 10:30:23 +02:00
Jeremy Soller 538475a813 Remove pbr patch 2020-05-28 11:57:39 -06:00
Jeremy Soller 7ccf8d27b0 Remove pbr patch 2020-05-28 11:54:30 -06:00
Jeremy Soller efa48434b4 Update time to 0.1.43 2020-05-25 07:40:16 -06:00
Jeremy Soller 713058f183 Update dependencies, add patches 2020-05-22 09:06:03 -06:00
Jeremy Soller f3a35af0de Move ixgbed in-tree 2020-05-22 09:05:22 -06:00
Jeremy Soller 1fe52ea0f2 Add patches 2020-05-21 14:07:07 -06:00
Jeremy Soller 331d744eab Merge branch 'redox-unix' into 'master'
Redox unix

See merge request redox-os/netstack!35
2020-05-21 17:59:59 +00:00
Jeremy Soller 1d5c9d0e39 Merge branch 'pcid-capabilities-fix' into 'master'
Improved PCI capability parsing.

See merge request redox-os/drivers!63
2020-05-21 12:16:22 +00:00
4lDO2 146265682a Improved PCI capability parsing. 2020-05-21 12:16:22 +00:00
Jeremy Soller 294127e4ad Merge branch 'revert-ahci-interrupts' into 'master'
Revert "Enable ahcid interrupts"

See merge request redox-os/drivers!62
2020-05-20 17:57:52 +00:00
4lDO2 f149620e5a Revert "Enable ahcid interrupts"
This reverts commit f00a049439.
2020-05-20 19:49:05 +02:00
Jeremy Soller 5cdce0d527 Merge branch 'nvme-msi' of https://gitlab.redox-os.org/4lDO2/drivers 2020-05-06 08:59:01 -06:00
4lDO2 07b1fe79fa Cleanup, and remove trace log writes for nvmed. 2020-05-03 16:33:56 +02:00
4lDO2 938cce8c8c make qemu_nvme works!
only cleanup left...
2020-05-03 16:02:23 +02:00
4lDO2 3558397859 ASYNC COMMAND SUBMISSION WORKS (partially). 2020-05-03 15:47:09 +02:00
4lDO2 cea6ce7d7a Move the setrens to a later position, in nvmed. 2020-05-02 00:05:04 +02:00
4lDO2 2db3bf4689 Read real block sizes. 2020-05-01 20:00:24 +02:00
4lDO2 1936f05030 NVME WORKS WITH IRQs 2020-05-01 14:14:47 +02:00
4lDO2 64e9eea9b0 Implement asynchronous command __submission__.
Note that by writing submission, I'm referring to blocking until a
submission queue has more entries available. The command completion
handling is already async.
2020-05-01 13:14:31 +02:00
4lDO2 c61e886108 Refactor and rustfmt the nvme driver. 2020-05-01 11:57:55 +02:00
4lDO2 167b994aea WIP: Asyncify IO SQ creation too. 2020-04-30 15:01:35 +02:00
4lDO2 3207f5a009 WIP: Make I/O completion queue creation async. 2020-04-30 14:48:43 +02:00
4lDO2 cbeb0070ec WIP: Asyncify namespace identification. 2020-04-29 20:44:38 +02:00
4lDO2 737870439a Wrap some NVME commands in async (not compiling). 2020-04-29 20:36:35 +02:00
4lDO2 6c2f103841 WIP: Complete the NVME CQ reactor (doesn't compile yet) 2020-04-29 19:35:48 +02:00
4lDO2 d485176bd6 Improve startup interrupt initialization. 2020-04-27 15:59:06 +02:00
4lDO2 e6a46bb6a6 Begin with NVME MSI support. 2020-04-25 23:02:16 +02:00
4lDO2 4016b0c7b8 Fix failing pcid config parsing. 2020-04-23 15:35:44 +02:00
4lDO2 7b69d5b9b5 WIP: Use the enhanced pcid IPC. 2020-04-22 21:21:55 +02:00
4lDO2 07d4ae0e60 Recognize the AHCI-specific SATA PCI capability. 2020-04-22 18:52:51 +02:00
4lDO2 fe95c942ac Add pcid logging. 2020-04-22 18:27:43 +02:00
4lDO2 aea6e1b84c Improve xhcid logging. 2020-04-22 18:09:56 +02:00
4lDO2 85691b8f4e Fix xhcid. 2020-04-22 14:43:06 +02:00
4lDO2 cafee6ad7b Allow per-cpu IRQ allocation. 2020-04-22 13:43:53 +02:00
4lDO2 4f62888bb4 Various fixes. 2020-04-21 15:42:51 +02:00
4lDO2 afe9c88f37 Allow every settable MSI field to be set. 2020-04-21 15:42:51 +02:00
Jeremy Soller 1d3978c69f Merge branch 'ps2d' 2020-04-20 14:16:30 -06:00
Jeremy Soller 751f5490bd Disable vmmouse again, for performance 2020-04-20 13:00:34 -06:00
Jeremy Soller 5795a7a27d Merge branch 'pcie' into 'master'
Add support for reading the extended PCIe configuration space

See merge request redox-os/drivers!60
2020-04-20 18:42:48 +00:00
Jeremy Soller af039d9507 Support relative vmmouse mode, and use by default 2020-04-20 11:24:18 -06:00
Jeremy Soller 9150f7cc85 Use serio: from kernel 2020-04-20 11:23:29 -06:00
Jeremy Soller a6dbe788f6 Undo some changes 2020-04-20 11:23:15 -06:00
Jeremy Soller 255e5fcb68 WIP: ps2d interrupt fixes 2020-04-19 14:27:44 -06:00
4lDO2 cee5a39ccc Fix pcie memory destructor. 2020-04-19 17:32:45 +02:00
4lDO2 14206f0e5c Successfully read config space with PCIe MMIO*.
*to the extent where all the subdriver appear to function as normal.
2020-04-19 17:32:45 +02:00
4lDO2 31d5a95cf9 Add MCFG parsing for PCIe. 2020-04-19 17:32:45 +02:00
Jeremy Soller 55645674d3 Merge branch 'msi' into 'master'
Greatly improve xhcid by using real MSI-X irqs.

See merge request redox-os/drivers!59
2020-04-19 15:32:02 +00:00
4lDO2 da188109d4 Change the default log level to debug. 2020-04-19 17:11:08 +02:00
4lDO2 81afdb2750 Remove two todo comments. 2020-04-19 14:45:46 +02:00
4lDO2 57bde84edb usbscsid works again, AFAICT. 2020-04-19 14:45:46 +02:00
4lDO2 0e802e2085 Fix two deadlocks. 2020-04-19 14:45:46 +02:00
4lDO2 f4398854fc Add trace debug printlns for opening handles. 2020-04-19 14:45:46 +02:00
4lDO2 74c77412bf Replace all calls to [e]println with log macros. 2020-04-19 14:45:46 +02:00
4lDO2 80d3affa1c Enable xhci logging, powered by redox-log. 2020-04-19 14:45:46 +02:00
4lDO2 ae49a0ba30 Update chashmap version. 2020-04-19 14:45:46 +02:00
4lDO2 08616920d6 Get descriptor fetching working. 2020-04-19 14:45:46 +02:00
4lDO2 f3d2d3e2d1 Fix the IRQ reactor when doing subsequent cmds. 2020-04-19 14:45:46 +02:00
4lDO2 ddf71d48e6 Get the Enable Slot cmd working, asynchronously!
This is the first command that actually worked by calling the IRQ
reactor and then getting a response. While this may not be that much on
its own, it means the async/await model actually works in this context.

Now the major problem is getting rid of all the deadlocks, and later
remove block_on(future) in the Scheme impl, and instead go async with
future spawning instead.
2020-04-19 14:45:46 +02:00
4lDO2 e58245b280 Use an event queue in the IRQ reactor. 2020-04-19 14:45:46 +02:00
4lDO2 9e34ed3fbf It compiles! 2020-04-19 14:45:46 +02:00
4lDO2 078a929bfc Fix borrow checker errors, except SchemeMut::handle. 2020-04-19 14:45:46 +02:00
4lDO2 6791429cd2 Fix most high-level errors in xhcid. 2020-04-19 14:45:46 +02:00
4lDO2 bae238bbef Asyncify Xhci::execute_transfer. 2020-04-19 14:45:46 +02:00
4lDO2 443b160b6d Add internal locking to the Xhci struct. 2020-04-19 14:45:46 +02:00
4lDO2 cfc4d65d48 THE INTERRUPTS ARE GETTING GENERATED! 2020-04-19 14:45:46 +02:00
4lDO2 cb5a72fbc1 Successfully recognize (only one) MSI-X IRQ.
Somehow it only happens once though.
2020-04-19 14:45:46 +02:00
4lDO2 fa594155c9 Allow subdrivers to get the capability structs. 2020-04-19 14:45:46 +02:00
4lDO2 735c55f656 Rebase. 2020-04-19 14:45:46 +02:00
4lDO2 7536048ceb Parse some of the PCI capabilities, and setup IPC. 2020-04-19 14:45:46 +02:00
Jeremy Soller bd860de51e Temporarily disable qemu mouse integration 2020-04-18 11:24:05 -06:00
4lDO2 6b005a02f4 Make most of the scheme work, except for deletion. 2020-04-04 10:26:43 +02:00
4lDO2 931aa86ba8 Support some path operations. 2020-04-01 17:14:23 +02:00
Jeremy Soller a24b73efcf nvmed: Simplify init logging 2020-03-29 19:56:37 -06:00
Jeremy Soller 2cac3cb752 nvmed: Fix partition offset check 2020-03-29 19:26:13 -06:00
4lDO2 4b83d5834e Implement most of the scheme. 2020-03-29 21:42:32 +02:00
4lDO2 4736a52639 Initial commit. 2020-03-29 11:22:21 +02:00
Jeremy Soller a01f1c4c80 nvmed: fix block size conversion 2020-03-28 13:53:42 -06:00
Jeremy Soller 4fd8664deb pcid: Skip empty buses and devices 2020-03-28 13:35:50 -06:00
Jeremy Soller 3dbf9ad3e7 Comment out XHCI interrupt message 2020-03-11 11:58:52 -06:00
Jeremy Soller f00a049439 Enable ahcid interrupts 2020-02-22 20:10:43 -07:00
Jeremy Soller c1b4292675 Improve ahcid interrupt handling 2020-02-22 19:46:28 -07:00
Jeremy Soller fc8cbe847b Merge branch 'usb' into 'master'
Add a fully functioning USB SCSI block device driver.

See merge request redox-os/drivers!58
2020-02-21 17:13:39 +00:00
4lDO2 3203a33498 REDOXFS WORKS (read-only) ON USB! 2020-02-21 16:45:35 +01:00
4lDO2 4072d5d282 Implement READ CAPACITY 10.
This allows the block count and block size to be determined when no
block descriptors in the mode sense data are returned.
2020-02-18 19:18:20 +01:00
4lDO2 fab13d6404 Fix get_mode_sense10 and some bbb error handling. 2020-02-16 21:27:41 +01:00
4lDO2 3c9527206f Add basic SCSI error handling. 2020-02-15 23:54:23 +01:00
4lDO2 4d14310e2d Rustfmt. 2020-02-15 09:56:32 +01:00
4lDO2 20e5c02391 Use correct ioc and chain bits when creating trbs. 2020-02-15 09:55:36 +01:00
4lDO2 bd0892e45d Make the usb scsi scheme able to do block I/O. 2020-02-15 00:26:19 +01:00
4lDO2 d44296dec9 Almost successfully read blocks using SCSI. 2020-02-14 18:38:24 +01:00
4lDO2 034e6bce70 Set up a basic SCSI scheme, and get disk size.
Some commands are unused though, and probably won't be used, for example
ReportSuppOpcodes. Also, there appears to be lots of different versions
of the SCSI specification.
2020-02-14 00:02:13 +01:00
4lDO2 9d88528188 Make SCSI commands working. 2020-02-12 23:17:50 +01:00
4lDO2 73ca576558 Use the real DCIs instead of driver-level numbers.
Sidenote: instead of STALLing because the driver didn't configure the
endpoints properly, regular transfers now work. Thus, QEMU was able to
recognize that it received a Bulk-Only Transport CBW. Yay!

Additionally, to make life easier when debugging, usbctl was added; now
it can get endpoint statuses which were previously non-accessible from
shell scripts, after the transition to the new ctl+data endpoint
interface.
2020-02-12 22:07:37 +01:00
4lDO2 56541efd13 Use correct endpoint indices. 2020-02-12 15:10:01 +01:00
4lDO2 1a7625c0bc Allow stalled endpoints to be reset. 2020-02-12 13:46:28 +01:00
4lDO2 dd9124eb82 Simplify the endpoint interface. 2020-02-11 23:07:20 +01:00
4lDO2 127ef077c2 Select correct max packet sizes during init. 2020-02-11 12:54:34 +01:00
4lDO2 05392696fe Use more correct params in configure_endpoint.
Most importantly in the endpoint contexts of the input context,
specifying the properties of the endpoints that are being configured.
2020-02-11 11:39:29 +01:00
4lDO2 d82ae0a5f6 Add periodic (driver interface-level) transfers. 2020-02-10 23:12:11 +01:00
4lDO2 d64cb02986 Allow (untested) usb device requests to send data. 2020-02-10 18:55:09 +01:00
4lDO2 e052c5968d Support detecting USB port speeds. 2020-02-10 16:23:19 +01:00
4lDO2 cff3cf0d28 Add basic logic to usbscsid and support alternate interface. 2020-02-10 11:23:18 +01:00
4lDO2 62915fadb1 Implement stream transfers.
They only use one stream though, which defeats the purpose of streams,
but at least transfers now work.
2020-02-09 22:35:56 +01:00
4lDO2 6b70e80d20 Add (untested) transfer support. 2020-02-09 17:17:36 +01:00
4lDO2 ae76f57162 Prepare for orbital communication. 2020-02-09 11:12:18 +01:00
4lDO2 1013daf606 IT WORKS! 2020-02-08 17:18:09 +01:00
Jeremy Soller e0ca9648ea Merge branch 'bugfix/fix-unnamed-sockets' into 'master'
Fix unnamed sockets

See merge request redox-os/ipcd!3
2020-02-08 14:01:03 +00:00
4lDO2 3fd4bc4b3b Add functions for the HID-specific requests. 2020-02-08 12:28:17 +01:00
Tiago Lam ea4247c0b5 chan: Support turning unnamed into named sockets.
Previous approach, reverted in commit c7cf2ca, would break unnamed
sockets - since it assumed there would always be an interim step were
one would first name an unnamed socket, before "listen" / "connect".

Instead of using the same approach as the "tcp:" scheme in Redox's
netstack, which requires an extra mapping of temporary unnamed sockets,
handle the different use cases in dup(). Thus, if a "buf" is provided
that's not a "connect" or "listen", it must be a new path for turning
the unnamed socket into a named socket and should be handled as such.
2020-02-08 10:29:52 +00:00
Tiago Lam 73570b0926 Revert "chan: Support opening "empty" ChanScheme."
This reverts commit 9526ffa80f.
2020-02-08 10:24:57 +00:00
4lDO2 53ddfbb88e Fix the HID report descriptor parsing. 2020-02-08 11:05:29 +01:00
4lDO2 b308dad7c6 Add a basic HID driver unable to parse report descs.
Custom device requests are now implemented though.
2020-02-08 10:21:21 +01:00
Jeremy Soller c7cf2ca0e0 Merge branch 'feature/support-af-unix-sockets' into 'master'
Support AF_UNIX sockets

See merge request redox-os/ipcd!2
2020-02-07 02:18:48 +00:00
4lDO2 1b74f335b0 Add a driver interface accessible to class drivers. 2020-02-06 21:45:44 +01:00
Tiago Lam fad13404d5 chan: Keep path in for new Handle.
While supporting AF_UNIX, once an accept() is called in relibc, in turn,
a dup() is also called with "listen". While processing this ipcd
effectively creates a new handler, losing track of the path of the
previous handler.

However, it is important to keep this path in the newly created Handler
as well, so the socket can be queried later by relibc (when calling
fpath()) and fill in appropriately its sockaddr_un struct.
2020-02-06 08:27:47 +00:00
Tiago Lam 9526ffa80f chan: Support opening "empty" ChanScheme.
Similarly to how the "tcp:" in Redox's netstack supports opening a first
empty scheme, only to later on being dup()'ed and set with an
appropriate path, this follows the same approach - a map of NullFile
structs is kept and initially associated with an id. Next time dup() is
called, the true Handle is created, keeping the same definitions of the
previously created NullFile.

Not that it is important to add support for this in the ipcd to support
AF_UNIX sockets, otherwise the socket() created in relibc won't be
associated with a address / path.
2020-02-06 08:27:47 +00:00
4lDO2 ae0d43c12a Add a framework-ish for USB drivers. 2020-02-03 21:48:35 +01:00
4lDO2 8c158328a3 Add class and vendor device reqs to the API. 2020-02-02 11:31:13 +01:00
4lDO2 d4f1480d1b Add some basic HID descriptor handling. 2020-02-02 10:00:09 +01:00
4lDO2 d66b0c5bd8 Fix the state virtual file. 2020-02-01 23:28:19 +01:00
4lDO2 c4a393e296 Correctly index the dev ctx arr for slot states. 2020-02-01 22:02:20 +01:00
4lDO2 295aa02e5d Support reading the slot state. 2020-02-01 18:20:24 +01:00
4lDO2 cbd9d83b69 SUPPORT CONFIGURE_ENDPOINTS! 2020-02-01 15:05:14 +01:00
4lDO2 93d99c4f4f Add a skeleton for endpoint enabling (in the driver API). 2020-02-01 15:04:56 +01:00
Jeremy Soller 13e472b6eb Implement VTIME 2020-01-28 11:05:46 -07:00
Jeremy Soller ce1d87e2aa Fix resources 2020-01-28 10:57:23 -07:00
Jeremy Soller b6042e673c Implement OPOST and ONLCR 2020-01-26 19:54:18 -07:00
Jeremy Soller f32f5c735d Merge branch 'kalfar' into 'master'
Fix randd TODOs for CSPRNG and allowing entropy write

See merge request redox-os/randd!10
2020-01-20 23:55:19 +00:00
Kalfar 276270fef5 Remove /dev/random TODO comment and add explanation from https://www.2uo.de/myths-about-urandom/ 2020-01-20 21:32:20 +00:00
4lDO2 dd4dd952d0 Improve (subjective...) the descriptor fetching. 2020-01-19 11:37:05 +11:00
4lDO2 8b375518d9 Fix the descriptor parsing by somewhat. 2020-01-19 11:37:05 +11:00
4lDO2 faa29b1854 Add a really basic interface to xhcid. 2020-01-19 11:37:05 +11:00
Jeremy Soller e191e502e1 Merge branch 'master' into 'master'
Add partitioning support to nvmed

See merge request redox-os/drivers!56
2020-01-14 13:34:24 +00:00
Kalfar 0eb534417e Change PRNG to be ChaCha20 PRNG and seeding with 512 bits of entropy from rdrand (if available)
Add permissions to scheme operations
Add ability to change owner/group/mode
Add ability to write entropy to the PRNG scheme
Add streaming of ChaCha20 PRNG output based on file open operation.
Add not seeded message if rdrand not present on CPU
Add extra TODOs for new future work
2020-01-14 05:41:39 +00:00
4lDO2 5807909ed1 Add partitioning support to nvmed. 2020-01-09 10:38:31 +11:00
4lDO2 60f05af555 Move the block-io-to-unaligned-io wrapper to its own crate. 2020-01-08 22:34:28 +11:00
Jeremy Soller 8bd1176cda Merge branch 'master' into 'master'
Add partition support to ahcid

See merge request redox-os/drivers!55
2020-01-05 01:40:27 +00:00
4lDO2 5848f668a6 Don't fail when the blocksize couldn't be retrieved.
This is required for ahcid to work with make qemu_efi.
2020-01-05 12:17:47 +11:00
4lDO2 2a7216c342 It (partition support) works! 2020-01-05 10:43:07 +11:00
4lDO2 119f7a5595 Add partition support for ahcid (untested). 2020-01-04 19:35:16 +11:00
Jeremy Soller 01f30577c1 Update smoltcp 2019-11-29 18:54:09 -07:00
Jeremy Soller 43e8747f0c Update dependencies 2019-10-19 20:56:31 -06:00
Jeremy Soller ac5da3935b Update dependencies 2019-10-19 20:37:35 -06:00
Jeremy Soller 4a32dfea15 Update dependencies 2019-10-19 20:27:36 -06:00
Jeremy Soller f264f99ddd Merge branch 'patch-1' into 'master'
Update README.md to remove broken link.

Closes #1

See merge request redox-os/ipcd!1
2019-10-06 23:45:36 +00:00
Coleman McFarland 3ff2d28a92 Update README.md to remove broken link.
Opting to just remove the link altogether to fix #1
2019-09-22 13:46:46 +00:00
Jeremy Soller 084587ed02 Add TODO to address spurious interrupts 2019-09-11 22:03:34 -06:00
Jeremy Soller c7f02e5e21 rtl8168d: fix calculation of next read size 2019-09-11 21:03:07 -06:00
Jeremy Soller 7f95962fa2 rtl8168d: match 8169 device and add documentation 2019-09-11 20:35:09 -06:00
Jeremy Soller 283ff736c6 Make separate config for xhcid 2019-09-11 20:09:13 -06:00
Jeremy Soller a38a20984e Basic implementation of NVMe IRQ handler 2019-09-05 20:37:20 -06:00
Jeremy Soller 8da1c13b73 Use BAR size for ihda 2019-09-04 20:44:24 -06:00
Jeremy Soller 2087f0ad03 Fix parsing of bar size 2019-09-04 20:40:18 -06:00
Jeremy Soller eda6bc6f92 Calculate and use PCI BAR memory sizes in most drivers. 2019-09-04 20:38:08 -06:00
Jeremy Soller a1144552d5 Re-enable QEMU mouse integration 2019-09-04 19:55:28 -06:00
Jeremy Soller aecb345abc Remove rtl8168d debugging 2019-08-29 20:31:33 -06:00
Jeremy Soller 2de4a526fb Merge scheme handling in e1000d and rtl8168d 2019-08-29 20:16:48 -06:00
Jeremy Soller a0ada39f1b rtl8168d: Open irq file with O_NONBLOCK 2019-08-29 19:31:56 -06:00
Jeremy Soller d49c945826 rtl8168d: Use pause in spin loops 2019-08-29 08:22:16 -06:00
Jeremy Soller 249606a8c9 Fix nvmed on real hardware 2019-08-28 20:15:03 -06:00
Jeremy Soller 745d8818e1 Read completion using ptr::read_volatile 2019-08-27 21:16:58 -06:00
Jeremy Soller 0e7b056508 Update redox_syscall for pcspkrd 2019-08-26 17:27:02 -06:00
Jeremy Soller d7385333d1 Merge branch 'redox-unix' 2019-08-26 17:16:39 -06:00
Jeremy Soller b8a75d064e Merge branch 'fix-it-keymaps' into 'master'
Fixed inverted chars

See merge request redox-os/drivers!53
2019-08-25 03:35:37 +00:00
Fabio Di Francesco f86495e0c5 Fixed inverted chars 2019-08-25 03:35:37 +00:00
Jeremy Soller 13dd6ae28f nvmed: add to initfs and fix reading larger block sizes 2019-08-24 20:45:48 -06:00
Jeremy Soller b2c76034b7 nvmed: add scheme with read/write implemented using polling 2019-08-24 20:24:01 -06:00
Jeremy Soller 9c277981be nvmed: Set up I/O queues 2019-08-24 09:26:13 -06:00
Jeremy Soller df4a7b054b nvmed: Identify controller and namespaces 2019-08-24 08:37:38 -06:00
Jeremy Soller 37e92ac8e5 nvmed: Implement admin queue 2019-08-23 20:29:19 -06:00
Jeremy Soller d74627a5f9 Merge branch 'fix-it-kb-layout' into 'master'
Fixed main inclusion

See merge request redox-os/drivers!51
2019-08-16 18:58:25 +00:00
Fabio Di Francesco f9dbc94979 Fixed main inclusion 2019-08-16 18:58:25 +00:00
Jeremy Soller 32bac01603 Merge branch 'add-it-kb-layout' into 'master'
Add italian keyboard layout (it)

See merge request redox-os/drivers!50
2019-08-16 13:08:55 +00:00
Fabio Di Francesco 6022bcc1e6 Add italian keyboard layout (it) 2019-08-16 13:08:55 +00:00
Jeremy Soller 89d8a8a6f6 Support MouseRelativeEvent 2019-08-12 13:37:03 -06:00
Jeremy Soller 743fac4727 Allow warnings 2019-08-07 21:26:02 -06:00
Jeremy Soller 2b27f7a816 Merge branch 'redox-unix' into 'redox-unix'
ixgbed: handle EOF

See merge request redox-os/drivers!48
2019-07-30 12:29:18 +00:00
Jeremy Soller e351c3f0b6 Merge branch 'speedup' into 'redox-unix'
Speed up e1000 driver

See merge request redox-os/drivers!49
2019-07-30 12:29:11 +00:00
Simon Ellmann 5e4b53fe92 Speed up e1000 driver 2019-07-30 14:03:48 +02:00
Simon Ellmann 16dfc7785e ixgbed: handle EOF 2019-07-30 13:01:54 +02:00
Jeremy Soller 56894fbdc2 rtl8168d: handle EOF 2019-07-26 20:13:37 -06:00
Jeremy Soller 0c665a30a1 Handle scheme EOF 2019-07-18 21:33:23 -06:00
Jeremy Soller 41f689bec3 vesad: handle EOF 2019-07-18 21:17:13 -06:00
Jeremy Soller b77f9f6b2f bgad: handle EOF 2019-07-18 21:15:24 -06:00
Jeremy Soller c259b9d44c Add TODO to eventually handle in-flight syscalls with ENODEV 2019-07-18 21:14:20 -06:00
Jeremy Soller dfd21dfd36 ihdad: Handle EOF 2019-07-18 21:13:30 -06:00
Jeremy Soller 974fe7488f e1000d: handle EOF 2019-07-18 21:10:02 -06:00
Jeremy Soller 217e51f830 ahcid: Handle EOF 2019-07-18 21:04:52 -06:00
Jeremy Soller f5bcff90f8 Fix unmount logic 2019-07-18 20:24:52 -06:00
Jeremy Soller b0bb843a65 Allow unmount of chan and shm 2019-07-18 20:22:56 -06:00
Jeremy Soller b6cc9f2ebd Mount chan and shm O_NONBLOCK 2019-07-18 20:22:38 -06:00
Jeremy Soller 953a4b9737 Break on EOF 2019-07-18 19:51:13 -06:00
Jeremy Soller 537f07e74c Break on EOF 2019-07-18 19:50:06 -06:00
Jeremy Soller 1752de22bf Break on EOF 2019-07-18 19:46:50 -06:00
Jeremy Soller 2653a4ff98 Add redoxer ci 2019-07-07 11:53:34 -06:00
jD91mZM2 6c993af1a2 Update ixgbed 2019-07-06 18:43:08 +02:00
Jeremy Soller 4f145abfd2 Merge branch 'redox-unix' into 'redox-unix'
Add ixgbed to Cargo.toml

See merge request redox-os/drivers!47
2019-07-05 21:35:36 +00:00
Simon Ellmann e88a65e11b Add ixgbed to Cargo.toml 2019-07-05 16:03:38 +02:00
Jeremy Soller 55da4bcb84 Add missing import 2019-07-03 19:57:32 -06:00
Jeremy Soller f4d54c1831 Merge branch 'redox-unix' into 'redox-unix'
Add ixgbe driver and split filesystem.toml into separate driver config files

See merge request redox-os/drivers!46
2019-07-03 20:21:38 +00:00
Simon Ellmann 1e3413acaa Add ixgbe driver and split filesystem.toml into separate driver config files 2019-07-03 20:22:19 +02:00
Jeremy Soller cb12b31e9b Merge branch 'master' into 'master'
Split filesystem.toml into separate config.toml for each driver

See merge request redox-os/drivers!45
2019-07-02 15:11:53 +00:00
Simon Ellmann e70bdc838a Split filesystem.toml into separate config.toml for each driver 2019-07-02 14:41:36 +02:00
Jeremy Soller 0b3a383443 Merge branch 'edition-upgrade' into 'redox-unix'
Edition upgrade and build fixes

See merge request redox-os/drivers!42
2019-07-01 22:34:52 +00:00
Jeremy Soller a63ca23c72 Merge branch 'master' into 'master'
Simplify mapping of vendor and device ids in driver toml files by adding an ids field

See merge request redox-os/drivers!44
2019-07-01 22:25:36 +00:00
Simon Ellmann 645c54e9a4 Simplify mapping of vendor and device ids in driver toml files by adding an ids field 2019-07-01 23:10:03 +02:00
Jeremy Soller e6c9fc92e8 Merge branch 'pcid' into 'master'
Make pcid parse config files from directory

See merge request redox-os/drivers!43
2019-07-01 00:39:11 +00:00
Simon Ellmann 5811100827 Make pcid parse config files from directory 2019-07-01 02:36:13 +02:00
Jeremy Soller 97e2ab90f8 Merge branch 'master' into 'master'
Add ixgbe driver

See merge request redox-os/drivers!41
2019-06-30 22:25:22 +00:00
Simon Ellmann 42c2184d70 Add ixgbe driver 2019-06-30 23:53:53 +02:00
Roland Ruckerbauer b50437af8a Fixed deprecated syntax in vesad
2018 edition upgrade & fixes for a bunch of 'future error warnings'

Actually upgrading all crates to 2018 edition
2019-06-29 21:47:52 +02:00
Jeremy Soller 3529d23d97 Enter null namespace at correct time 2019-06-23 20:22:39 -06:00
Jeremy Soller c55307073c Remove patches which are now done in the cookbook 2019-06-16 11:08:49 -06:00
jD91mZM2 131659dcde Remove unneeded patches, they're now global 2019-06-16 14:44:18 +02:00
Jeremy Soller d1a50d0fd0 Remove libc patch 2019-06-15 10:54:29 -06:00
Jeremy Soller a3014c3682 Merge branch 'pcspkr' into 'master'
Add pcspkr driver

See merge request redox-os/drivers!39
2019-06-12 23:11:31 +00:00
jD91mZM2 85f6cea0bd Support multiple connectors to listener 2019-04-25 17:06:37 +02:00
jD91mZM2 50e0b499f4 Cleanup event system 2019-04-25 14:50:50 +02:00
Jeremy Soller 438691c241 Patches for Redox as part of the unix target family 2019-04-24 20:41:27 -06:00
Jeremy Soller a9928cf4aa Add gitignore 2019-04-23 14:02:08 -06:00
Jeremy Soller 396750c2da Fixes for building with Redox in the unix target family 2019-04-23 13:45:20 -06:00
Jeremy Soller 50652ceb93 Temporary patches for Redox with unix target family 2019-04-23 13:25:41 -06:00
Jeremy Soller 7afaadabd9 Ensure that MMIO memory is mapped without caching 2019-04-08 20:22:01 -06:00
Jeremy Soller 2079856d97 Update to new fevent 2019-03-13 14:11:38 -06:00
Jeremy Soller 2ef4408a7a Update to new fevent 2019-03-13 14:08:44 -06:00
Jeremy Soller e090281086 Support for new fevent 2019-03-13 13:58:55 -06:00
Jeremy Soller 3efdf1db8a Support for new fevent 2019-03-13 13:58:08 -06:00
Jeremy Soller 4b0707e6b2 Support for new fevent 2019-03-13 13:57:49 -06:00
Jeremy Soller 00ad7e74ab Remove debugging 2019-03-12 20:32:14 -06:00
Jeremy Soller 4384a16d4f Ensure that missing network events do not hang the network stack 2019-03-12 20:31:02 -06:00
Jeremy Soller 370b11fbf3 Cleanup of wait queue 2019-03-11 20:03:11 -06:00
Tibor Nagy ae8a6075a2 Add pcspkr driver 2019-03-05 18:35:01 +01:00
Jeremy Soller d9b9c7158d Fix dropping packet type when partial packet read occurs 2019-03-02 14:57:49 -07:00
Jeremy Soller b543fe8388 Enable ctrl-z and ctrl-\ 2019-03-02 14:57:28 -07:00
Jeremy Soller f5ff59f085 Merge branch 'update-lockfile' into 'master'
Update Cargo.lock

See merge request redox-os/init!4
2019-02-27 13:09:13 +00:00
Robin Randhawa 1e86998534 Update Cargo.lock 2019-02-27 12:36:34 +00:00
Jeremy Soller 25aec9f2a7 Disable interrupts for ahcid 2019-02-18 21:11:41 -07:00
Jeremy Soller c9e0dc4fd5 Go back to polling ahcid to prevent hangs 2019-02-18 21:05:44 -07:00
Jeremy Soller dca4ea500d Post read fevent at EOF 2019-02-17 20:31:13 -07:00
Jeremy Soller 19aabd5e66 Fix hangs when a tcp stream is closed 2019-02-17 20:19:35 -07:00
Jeremy Soller 3f41225d78 Convert e1000d to using SchemeBlockMut, update dependencies 2019-02-02 13:59:49 -07:00
Jeremy Soller dba4db694c Use WouldBlock with network file 2019-02-02 13:58:19 -07:00
Jeremy Soller 777670a3ad Merge branch 'ihdad-audiod' into 'master'
ihdad: Fix audiod blocking

See merge request redox-os/drivers!38
2019-02-02 00:27:56 +00:00
Nagy Tibor ee3569d484 ihdad: Fix audiod blocking 2019-02-02 00:20:33 +00:00
Jeremy Soller 82cc517580 Merge branch 'readme' into 'master'
Preliminary Readme

See merge request redox-os/init!1
2019-01-22 21:52:01 +00:00
SamwiseFilmore 958b3046e9 Preliminary Readme 2019-01-17 00:03:23 +00:00
Jeremy Soller 3f754a6903 Merge branch 'master' into 'master'
Change value to be mutable

Closes #8

See merge request redox-os/randd!9
2019-01-16 13:04:36 +00:00
Abhishek Bhattacherjee 43dfc178b5 Change value to be mutable
Fixes #8.
2019-01-16 09:51:42 +00:00
Jeremy Soller 9cc7432436 Merge branch 'aarch64-prep' into 'master'
aarch64-prep: Update Cargo.lock

See merge request redox-os/ptyd!6
2019-01-15 19:17:03 +00:00
Jeremy Soller 21664b36b7 Merge branch 'aarch64-prep' into 'master'
aarch64-prep: Update Cargo.lock

See merge request redox-os/zerod!2
2019-01-15 19:16:31 +00:00
Jeremy Soller a62f3ec2a9 Merge branch 'aarch64-prep' into 'master'
aarch64-prep: Update Cargo.lock

See merge request redox-os/logd!2
2019-01-15 19:16:19 +00:00
Jeremy Soller 23c96d74ac Merge branch 'aarch64-prep' into 'master'
Aarch64 prep

See merge request redox-os/randd!8
2019-01-15 19:15:28 +00:00
Robin Randhawa dd570a7924 aarch64-prep: Update Cargo.lock
Needed to work with the latest redox_syscall mods.
2019-01-15 12:27:52 +00:00
Robin Randhawa 8e8e4a1837 aarch64-prep: Update Cargo.lock
Needed to work with the latest redox_syscall mods.
2019-01-15 12:20:37 +00:00
Robin Randhawa 0e613dcc15 aarch64-prep: Wrap x86_64 specific crate references and code with conditionals 2019-01-15 12:20:22 +00:00
Robin Randhawa 1198e4b615 aarch64-prep: Update Cargo.lock
Needed to work with the latest redox_syscall mods.
2019-01-15 12:16:43 +00:00
Robin Randhawa 32ab1a6e9d aarch64-prep: Update Cargo.lock
Needed to work with the latest redox_syscall mods.
2019-01-15 12:15:22 +00:00
Jeremy Soller a38dfb3231 Use IRQs to prevent spin loops in ahcid 2019-01-12 12:52:57 -07:00
Jeremy Soller ca748c99f9 Enable HD audio 2019-01-12 08:02:02 -07:00
Jeremy Soller 6bab760a65 Update lock file 2019-01-08 20:18:10 -07:00
Jeremy Soller 880c107dd3 Enable debugging 2019-01-05 07:54:45 -07:00
Jeremy Soller 1ea5e3158b Use smoltcp submodule 2019-01-03 21:23:59 -07:00
Jeremy Soller 51446652a1 Update smoltcp 2019-01-01 20:23:21 -07:00
Jeremy Soller 1e65a21242 Attempt to read scheme after interrupt 2019-01-01 20:22:08 -07:00
Jeremy Soller 3fcafeed85 Update smolnetd 2019-01-01 18:29:29 -07:00
jD91mZM2 06f4d6b9a3 Support new fmap stuff! 2018-12-30 15:43:59 +01:00
Jeremy Soller 5404dfac32 Use signed 16-bit samples, saturate when mixing 2018-12-29 19:14:42 -07:00
Jeremy Soller 50664455bc Implement O_NONBLOCK 2018-12-29 15:13:03 -07:00
Jeremy Soller 8e40611a8a Implement most functions 2018-12-29 15:10:39 -07:00
Jeremy Soller 939b294eae ihdad: cleanup, fix blocking code, decrease buffer size to decrease latency 2018-12-29 12:21:12 -07:00
Jeremy Soller c02d06c5da cargo init 2018-12-29 10:40:48 -07:00
Jeremy Soller 8e8d929c4b Initial commit 2018-12-29 17:32:40 +00:00
Jeremy Soller c47c68f44c Update fmap support 2018-12-28 16:19:09 -07:00
jD91mZM2 49e424d8a4 Add separate scheme for fmap 2018-12-28 18:12:31 +01:00
jD91mZM2 fb9b68405c Bump Cargo.lock 2018-12-24 17:03:17 +01:00
Jeremy Soller 5cd0752799 Merge branch 'ihdad-fpath' into 'master'
ihdad: Implement fpath

See merge request redox-os/drivers!37
2018-12-15 00:31:30 +00:00
Tibor Nagy fe9338c94b ihdad: Implement fpath
Fixes the output of sys:/iostat.
The correct implementation is TODO like most of the scheme related code in this driver.
2018-12-15 01:06:51 +01:00
Jeremy Soller 4d537dbd57 Fix compilation 2018-12-06 17:55:51 -07:00
Jeremy Soller fcfdcc1263 Merge branch 'dup_tcp_conditional' into 'master'
fix return statement of else block in dup function

See merge request redox-os/netstack!34
2018-12-06 17:45:38 +00:00
Colleen 01b6f9b98c fix return statement of else block in dup function 2018-12-06 17:45:38 +00:00
Jeremy Soller 0e55459e0e Remove unused feature 2018-11-12 15:00:36 -07:00
Jeremy Soller 6a9fa00603 Update smolnetd 2018-10-29 19:54:53 -06:00
Jeremy Soller 0cbd484ad2 Update Cargo.lock 2018-10-14 19:56:50 -06:00
Jeremy Soller c1ddae5cee Update Cargo.lock 2018-10-14 19:56:44 -06:00
Jeremy Soller 3f7bf2a687 Update Cargo.lock 2018-10-14 19:56:35 -06:00
Jeremy Soller e57f62b8f5 Update Cargo.lock 2018-10-14 19:56:33 -06:00
Jeremy Soller ed2111b54e Update Cargo.lock 2018-10-14 19:56:31 -06:00
Jeremy Soller f1d3aa6480 Update Cargo.lock 2018-10-14 19:56:24 -06:00
Jeremy Soller 795b86db13 Disable ihdad 2018-09-23 09:45:31 -06:00
Jeremy Soller 4dd40fa373 Implement fgetfl, fsetfl for null 2018-09-20 14:22:30 -07:00
jD91mZM2 f9ed9ab263 Add gitignore 2018-09-09 18:48:00 +02:00
Jeremy Soller 638e6f09fc Merge branch 'master' into 'master'
Send readable event from fevent

See merge request redox-os/randd!6
2018-09-01 13:09:08 +00:00
jD91mZM2 34cfe146de Fix compilation 2018-08-29 17:59:03 +02:00
jD91mZM2 a7eb42fbeb Send readable event from fevent
This fixes one problem with openssl on relibc, since relibc correctly respects readable/writable status unlike the newlib implementation which always says it's readable.
2018-08-29 17:47:25 +02:00
jD91mZM2 2214442a64 Update Cargo.lock 2018-08-26 13:03:36 +02:00
jD91mZM2 9f253fe92e Update Cargo.lock 2018-08-26 13:01:57 +02:00
jD91mZM2 1df5b6fc29 Merge branch 'fixes' into 'master'
Update Cargo.lock

See merge request redox-os/netstack!32
2018-07-27 16:19:26 +00:00
jD91mZM2 f72a3f7bfe Merge branch 'fixes' into 'master'
Update Cargo.lock

See merge request redox-os/drivers!36
2018-07-27 16:17:56 +00:00
Robin Randhawa ea90c7ae7b Update Cargo.lock
A 'precise' cargo update of tokio is needed for the build to succeed.
2018-07-25 18:13:10 +01:00
Robin Randhawa cc2a5ff01d Update Cargo.lock
A 'precise' cargo update of tokio is needed for builds to succeed.
2018-07-25 18:02:27 +01:00
Jeremy Soller 4a2b8500e4 Update Cargo.lock 2018-07-12 07:25:52 -06:00
Jeremy Soller 1616f6399a Update Cargo.lock 2018-07-12 07:09:59 -06:00
stratact 39d533cb07 Merge branch 'master' into 'master'
cargo update

See merge request redox-os/netstack!31
2018-07-05 21:39:44 +00:00
Paul Sajna b90aa2c663 cargo update 2018-07-05 14:35:17 -07:00
stratact 31bf879e87 Merge branch 'master' into 'master'
cargo update

See merge request redox-os/drivers!34
2018-07-05 20:57:42 +00:00
Paul Sajna 9d923a9794 cargo update 2018-07-05 13:51:51 -07:00
Jeremy Soller 64b5416e90 Merge branch 'moveSocketToGitLab' into 'master'
Update Cargo.lock to use socket2 on our GitLab

See merge request redox-os/drivers!33
2018-06-24 16:27:34 +00:00
bujiraso 18bb29bcd7 Update Cargo.lock to use socket2 on our GitLab 2018-06-24 13:13:37 -03:00
Dan Robertson 8edf468f33 Bump smoltcp version
Fixed packet buffer logic error in smoltcp
2018-06-21 13:44:18 +00:00
Jeremy Soller 8a52c84f1a Update to new alloc API 2018-06-19 17:44:51 -06:00
Jeremy Soller 7ddadca881 Merge branch 'master' into 'master'
Update smoltcp

Closes #30

See merge request redox-os/netstack!30
2018-06-19 13:58:02 +00:00
jD91mZM2 f9d6f5d87f Update smoltcp 2018-06-19 15:50:09 +02:00
jD91mZM2 19f8137eef Tiny cleanup 2018-06-16 16:17:25 +02:00
Jeremy Soller 63b5755aee Merge branch 'master' into 'master'
Bump Cargo.lock

See merge request redox-os/drivers!32
2018-06-14 16:07:39 +00:00
jD91mZM2 1f1c2ff4e8 Bump Cargo.lock 2018-06-14 18:06:21 +02:00
Jeremy Soller 61d8db324e Merge branch 'master' into 'master'
Fix compilation

See merge request redox-os/drivers!31
2018-06-13 08:24:48 +00:00
jD91mZM2 c6b1dea60d Fix compilation
There was a version mismatch because of outdated redox_event and some issues with the Cargo.lock that `cargo update` fixed
2018-06-13 07:20:05 +02:00
Jeremy Soller 40a8cb7dbb Update links to gitlab 2018-06-12 12:30:44 -06:00
Jeremy Soller 35a21cee2f Update links to gitlab 2018-06-12 12:30:43 -06:00
Jeremy Soller b4974a84ae Merge branch 'gitlab' into 'master'
Add GitLab CI

See merge request redox-os/ptyd!4
2018-06-10 18:25:25 +00:00
jD91mZM2 d488301133 Add GitLab CI 2018-06-10 20:07:00 +02:00
jD91mZM2 1e09107684 Add GitLab CI 2018-06-10 20:04:32 +02:00
Jeremy Soller 7ef36fd820 Merge pull request #30 from jD91mZM2/master
Make it edge-triggered
2018-06-08 08:14:15 -06:00
jD91mZM2 a33edcf322 Remove unused import from example 2018-06-07 20:11:57 +02:00
jD91mZM2 85aa51328a Slightly improve code for requiring listener/client 2018-06-07 18:05:36 +02:00
jD91mZM2 fd5b7b2921 Make it edge-triggered 2018-06-04 05:37:18 +02:00
jD91mZM2 97179331df Add more messages to event test & delete unused variable 2018-06-03 17:25:40 +02:00
jD91mZM2 879bbf0dad Revert "Only send events that were asked for"
This reverts commit 438acd7d09.

Apparently the test I wrote passes anyway with the old code.
I assume the kernel is filtering the events out.
2018-06-03 17:22:39 +02:00
jD91mZM2 438acd7d09 Only send events that were asked for 2018-06-03 17:09:56 +02:00
jD91mZM2 9454cdfbb4 Code cleanup & bugfixes related to connections dropped early 2018-06-03 15:01:39 +02:00
jD91mZM2 31a2b95fe0 Add hello example 2018-06-02 18:19:55 +02:00
jD91mZM2 6f362b4548 Rename struct 2018-06-02 18:07:18 +02:00
jD91mZM2 34e82a7235 Return EPIPE instead of ENOTCONN 2018-06-02 18:04:30 +02:00
jD91mZM2 8a54eadae0 Fix events & more event tests 2018-06-02 17:17:03 +02:00
jD91mZM2 af3813c518 Add unnamed sockets & don't send EOF before connected 2018-06-02 16:28:33 +02:00
jD91mZM2 92ba44c99b README: Fix broken link 2018-06-02 15:58:34 +02:00
jD91mZM2 4327481d3c Rename example 2018-06-02 12:22:47 +02:00
jD91mZM2 1a731fcb24 Rename to ipcd because that sounds better 2018-06-02 12:14:48 +02:00
jD91mZM2 eae2252c5f Announce when ready to dup 2018-06-02 11:56:51 +02:00
jD91mZM2 974d37f8e2 Properly send EOF 2018-06-02 11:10:08 +02:00
jD91mZM2 9369ea58d8 Minor code cleanup 2018-06-02 10:52:56 +02:00
jD91mZM2 ac7ddf2e40 Add README and LICENSE 2018-06-02 10:39:20 +02:00
jD91mZM2 b4133ff956 Support events 2018-06-02 10:27:10 +02:00
jD91mZM2 da017f7941 Basic nonblocking I/O 2018-06-02 09:27:54 +02:00
jD91mZM2 1624deadfa Initial commit 2018-06-02 09:00:49 +02:00
Jeremy Soller 6a8d8103f2 Merge pull request #3 from jD91mZM2/master
Convert into edge-triggered model
2018-05-31 11:57:38 -06:00
jD91mZM2 94fac87bc6 Convert into edge-triggered model 2018-05-31 19:12:23 +02:00
jD91mZM2 7fe9c67a53 Use new SchemeBlock trait (#29)
* Use new SchemeBlock trait

* Use EAGAIN over EWOULDBLOCK
2018-05-30 10:55:05 -06:00
jD91mZM2 6ffe327989 Switch to an edge-triggered event system (#28) 2018-05-30 09:25:57 -06:00
Romeo Disca 3a92b2c466 add udp support (#26)
* icmp.rs add udp branches to read and write

* add write_buf implementation to icmp udp port unreachable

* add udp port support
2018-05-21 13:12:24 -06:00
Jeremy Soller 202ead3b93 Update rtl8168d to new events 2018-05-20 16:16:45 -06:00
Jeremy Soller aaafbbad33 Update e1000d to new event 2018-05-20 16:11:19 -06:00
Jeremy Soller a2a534f137 Update event crate 2018-05-20 15:20:05 -06:00
Jeremy Soller 32a58c3b64 Update event crate 2018-05-20 15:19:40 -06:00
Jeremy Soller 9bc5c5197e Fix mistaken use of flags 2018-05-20 13:40:14 -06:00
Jeremy Soller 1fc5ebd797 Make vesad handle events per handle 2018-05-20 13:37:01 -06:00
Jeremy Soller 7d181f5e68 Update to new event 2018-05-20 11:31:37 -06:00
Jeremy Soller 0a9b15939e Update to new event 2018-05-20 11:05:10 -06:00
Jeremy Soller f645041293 dnsd: enter null namespace 2018-05-19 19:33:41 -06:00
Jeremy Soller 287fdde19a Update to new heap API 2018-04-28 21:35:13 -06:00
Jeremy Soller 79df020cbd If an IRQ is not set, use IRQ #9 2018-04-21 09:43:49 -06:00
Jeremy Soller 5584be96c0 Erase character if in canonical mode with a space 2018-03-24 15:58:46 -06:00
Jeremy Soller 390f04baaf Update lock file 2018-03-24 12:14:24 -06:00
Jeremy Soller 1474d20b04 Fix issue where packet may be truncated 2018-03-12 21:13:58 -06:00
Jeremy Soller 849ce0b96b Merge pull request #29 from ids1024/atapi_capacity
ahcid: fix atapi capacity detection
2018-03-11 19:25:57 -06:00
Ian Douglas Scott d893a73e1e ahcid: fix atapi capacity detection 2018-03-11 18:24:23 -07:00
Jeremy Soller a081f9e2ff Remove IRQ debug print 2018-03-10 16:03:21 -07:00
Jeremy Soller 329750afb9 Remove debug prints 2018-03-10 16:02:06 -07:00
Jeremy Soller 5bccc80152 Fix rtl8168 driver 2018-03-10 15:12:55 -07:00
Jeremy Soller 7fbb2c32e2 Fix BAR variables 2018-03-01 08:24:24 -07:00
Jeremy Soller 452c586bd0 Merge pull request #28 from dlrobertson/update_pci_parsing
Allow PCI Config space parsing to handle types
2018-03-01 08:18:41 -07:00
Dan Robertson 4d349192da Allow PCI Config space parsing to handle types
- Update the PCI config space parsing to be able to handle multiple
   types.
 - Use a trait to abstract out reading from the config space in order to
   allow testing/fuzzing of the parser.
2018-02-27 22:46:30 +00:00
Dan Robertson 57cb6cbbef Merge pull request #18 from dlrobertson/update_use_of_timestamp
Use smoltcp::time types instead of u64 timestamps
2018-02-16 03:07:48 +00:00
Dan Robertson 76d8feae8d Use smoltcp::time types instead of u64 timestamps
smoltcp is moving towards using time::Duration and time::Instant instead
of a u64 timestamp.
2018-02-16 02:59:09 +00:00
Jeremy Soller 42adde5809 Resize ps2d bounding box when vesad resizes 2018-02-06 09:52:14 -07:00
Jeremy Soller 501c3581ea Merge pull request #27 from xTibor/fix-unicode
vesad: Fix Unicode character input
2018-02-05 22:13:02 -07:00
Tibor Nagy 1b60f10b0e vesad: Fix Unicode character input
Characters beyond 0x80 now properly encoded as UTF-8.
2018-02-06 05:02:55 +01:00
Jeremy Soller 33fc507b6a Merge pull request #26 from dlrobertson/add_range_config
Allow using a device ID range in toml config
2018-02-04 07:32:32 -07:00
Dan Robertson b332607d77 Allow using a device ID range in toml config 2018-02-04 02:35:36 +00:00
Jeremy Soller ff93aabbe6 Merge pull request #17 from batonius/netcfg_commit
Change netcfg to validate on write and commit on fsync
2018-02-03 07:10:00 -07:00
Egor Karavaev 67a2d7900a netcfg adds/set method 2018-02-03 15:42:06 +03:00
Egor Karavaev cf78d85d64 netcfg commits on fsync 2018-02-03 00:40:30 +03:00
Dan Robertson 9fd9a349d3 Merge pull request #16 from NilSet/license
Add license and readme
2018-01-31 18:29:25 +00:00
Tommie Levy 44e1d6943f Add license and readme 2018-01-31 10:24:43 -08:00
Jeremy Soller 0c52a6a66a Merge pull request #14 from batonius/netcfg
The netcfg scheme
2018-01-30 12:41:01 -07:00
Egor Karavaev 1eeec8eae0 Netcfg notifications. 2018-01-30 22:09:31 +03:00
Jeremy Soller 416206e1db Fix #2 by blocking if more than 64 packets are collected 2018-01-29 21:53:39 -07:00
Egor Karavaev eea72fcef3 Remove closed fd. 2018-01-29 02:00:14 +03:00
Egor Karavaev ae7d9b40f8 netcfg: interface addr node. 2018-01-29 02:00:14 +03:00
Egor Karavaev 1e95808242 netcfg write nodes 2018-01-29 02:00:14 +03:00
Egor Karavaev a7f365d96c Add the netcfg schema. 2018-01-29 02:00:14 +03:00
Jeremy Soller 1461404502 Remove unnecessary unsafe 2018-01-28 14:51:24 -07:00
Jeremy Soller 0897ddff17 Remove unnecessary parens 2018-01-28 14:50:14 -07:00
Jeremy Soller 78cff3f57c Remove unnecessary parens 2018-01-28 14:49:29 -07:00
Jeremy Soller 510af9c1f8 Merge pull request #13 from batonius/dnsd
The dnsd daemon
2018-01-28 14:06:06 -07:00
Egor Karavaev 32c673d814 dnsd timeouts 2018-01-28 23:12:19 +03:00
Egor Karavaev e6dfb7f5b2 Implement the dns: schema. 2018-01-28 22:48:51 +03:00
Egor Karavaev 5fba322823 Add dnds bin. 2018-01-28 22:48:39 +03:00
Jeremy Soller c674239df0 Merge pull request #8 from dlrobertson/use_byteorder
Use byteorder to improve readability
2018-01-23 17:04:13 -07:00
Dan Robertson b3812568fe Use byteorder to improve readability
Use byteorder instead of using less readable bitmasks and shifts.
2018-01-23 23:26:53 +00:00
Jeremy Soller 97e6adadbc Merge pull request #6 from dlrobertson/updatez
Updates to sync with upstream changes
2018-01-09 17:45:48 -07:00
Jeremy Soller 74ed054d50 Merge pull request #23 from ids1024/dma
ahci: refactor duplicated ATA command code into a method
2018-01-07 08:36:37 -07:00
Ian Douglas Scott c8154e7607 ahci: refactor duplicated ATA command code into a method 2018-01-06 23:47:45 -08:00
Jeremy Soller 6394b1b5f0 Merge pull request #22 from ids1024/atapi
ahci: Basic ATAPI support (Needed for CD drives)
2018-01-04 15:41:14 -07:00
Ian Douglas Scott 9de5eb7045 atapi: Implement read support 2018-01-04 14:20:12 -08:00
Ian Douglas Scott 78ab386268 Move capacity reading to seperate method 2018-01-04 12:25:47 -08:00
Ian Douglas Scott c78d4dcff0 ahci: atapi support (incomplete)
It can currently retrieve the capacity; no reads or writes yet.
2018-01-02 23:03:54 -08:00
Jeremy Soller b9ca3b7ce8 Fix time format 2018-01-02 21:52:28 -07:00
Jeremy Soller 16f8738bff Initial commit 2018-01-02 21:51:52 -07:00
Dan Robertson 372d688de9 Updates to sync with upstream changes
polling API for EthernetInterface has changed.
2017-12-25 03:50:48 +00:00
Jeremy Soller 946eb5f95a Merge pull request #5 from dlrobertson/update
Sync with smoltcp updates
2017-12-20 15:41:26 -07:00
Dan Robertson 5d3a830ce7 Sync with smoltcp updates
- Use EthernetInterfaceBuilder instead of EthernetInterface::new
 - smoltcp removed the ArpCache trait in favor of ManagedMap.

NB: This breaks the use of loopback and sending packets to yourself.
2017-12-20 22:16:01 +00:00
Alex Lyon c9bac05f07 Remove warning and add Cargo.lock 2017-12-18 16:09:51 -08:00
Alex Lyon 3158f9c7c0 Move zero scheme from kernel space to user space 2017-12-15 20:13:54 -08:00
Jeremy Soller c11736f74c Merge pull request #21 from ghatdev/master
pcid: fix error E0133
2017-12-06 20:08:09 -07:00
SeongUk Cho dd5f83cd39 solved error: #[derive] can't be used on a non-Copy #[repr(packed)] struct (error E0133) 2017-12-01 21:52:01 +09:00
2e07aab6de fixed pcid unsafe problem 2017-12-01 21:41:21 +09:00
2b4b940360 unsafe problem fixed 2017-12-01 21:35:55 +09:00
66826a8bf8 unsafe edited 2017-12-01 20:34:15 +09:00
Jeremy Soller 9275feebe9 Merge pull request #4 from redox-os/smolnetd
Smolnetd
2017-11-26 09:13:36 -07:00
Jeremy Soller b7fe49ccd0 Remove debug statement 2017-11-20 19:45:23 -07:00
Jeremy Soller ce05b12a7a Update ransid for vesad 2017-11-20 19:26:16 -07:00
Jeremy Soller 9deb8dcb0d Merge pull request #5 from raw-bin/master
Fix randd induced build breakage due to a missing crate dependency
2017-11-18 07:46:01 -07:00
Jeremy Soller 39dae664b1 Merge pull request #4 from xTibor/fix-rand
Use rand from crates.io
2017-11-17 20:19:42 -07:00
Tibor Nagy 03e99db648 Use rand from crates.io
The `rand` crate has been removed from the standard library.
https://github.com/rust-lang/rust/commit/6bc8f164b09b9994e6a2d4c4ca60d7d36c09d3fe
2017-11-18 04:01:51 +01:00
Robin Randhawa af245a6db1 Silence build warning due to unused argument
The fstat fn's 'id' argument was unused. Changed to '_id' as per
compiler suggestion to quiescen warning.
2017-11-17 18:00:51 +00:00
Robin Randhawa fd92da99eb Fix breakage due to missing dependency on the rand crate
Also update Cargo.lock
2017-11-17 17:51:26 +00:00
Jeremy Soller 5e65afb769 Implement null file that can only be duped or closed. 2017-11-16 19:43:13 -07:00
Jeremy Soller 34abddb2f0 Update Cargo.lock 2017-11-14 19:49:32 -07:00
Egor Karavaev 2242ad90f9 Poll timeout calculation fix. 2017-11-13 23:49:58 +03:00
Egor Karavaev 337f318f6f Implement icmp: schema in smolnetd, remove icmpd. 2017-11-12 23:04:08 +03:00
Egor Karavaev 7b9b15c37f Updating upstream smoltcp. 2017-11-10 22:26:58 +03:00
Egor Karavaev e4fef61865 Update for new Device trait. 2017-11-04 15:44:55 +03:00
Jeremy Soller 29e3c38c1d Remove old schemes, use patched smoltcp, remove log feature 2017-10-29 20:39:53 -06:00
Egor Karavaev 077673d9e5 Update smoltcp. 2017-10-25 21:18:24 +03:00
Egor Karavaev b54ead7d77 Support for loopback interface. 2017-10-24 22:23:03 +03:00
Jeremy Soller 1155db75b2 Create LICENSE 2017-10-20 20:10:03 -06:00
Jeremy Soller 4f2895f401 Create LICENSE 2017-10-20 20:09:35 -06:00
Jeremy Soller 9311987d2a Create LICENSE 2017-10-20 20:08:02 -06:00
Jeremy Soller bd102d7f0d Create LICENSE 2017-10-20 20:05:49 -06:00
Jeremy Soller 7f7109b218 Update Cargo.lock 2017-10-11 20:54:45 -06:00
Jeremy Soller 12989384c0 Update Cargo.lock 2017-10-11 20:54:45 -06:00
Jeremy Soller 8d755de886 Merge remote-tracking branch 'batonius/smolnetd' into smolnetd 2017-10-09 20:49:37 -06:00
Jeremy Soller bc6d234bd0 Utilize null namespace 2017-10-09 20:49:23 -06:00
Jeremy Soller 581aabdd70 Utilize null namespace 2017-10-09 20:49:04 -06:00
Jeremy Soller bcdfbb1dfa Utilize null namespace 2017-10-09 20:48:34 -06:00
Jeremy Soller 763910a51a Merge branch 'master' of https://github.com/redox-os/init 2017-10-09 20:47:20 -06:00
Jeremy Soller c94d543529 Utilize null namespace 2017-10-09 20:47:11 -06:00
Jeremy Soller b553e1ddc0 Merge pull request #19 from redox-os/cap
Use capability mode (null namespace) for drivers
2017-10-09 20:39:17 -06:00
Jeremy Soller bd8a377c78 Use capability mode (null namespace) for drivers 2017-10-09 20:36:16 -06:00
Egor Karavaev ecd3848de9 Code cleanup. 2017-10-09 20:40:24 +03:00
Egor Karavaev 0584743789 Updating upstream smoltcp. 2017-10-07 00:18:10 +03:00
Egor Karavaev 454dfd9a39 Support for tcp listen. 2017-10-05 11:10:55 +03:00
Jeremy Soller 5b018426d2 Update Cargo.lock 2017-10-04 20:29:41 -06:00
Jeremy Soller 5deeb5683a Update Cargo.lock 2017-10-04 20:29:41 -06:00
Jeremy Soller b0ed813035 Update Cargo.lock 2017-10-04 20:29:41 -06:00
Jeremy Soller 57ce75e297 Update Cargo.lock 2017-10-04 20:29:41 -06:00
Jeremy Soller e3a9314a5a Update Cargo.lock 2017-10-04 20:29:41 -06:00
Jeremy Soller e4a297b725 vmmouse support 2017-10-03 20:54:49 -06:00
Egor Karavaev 5c6187749b Non-blocking IP sockets. 2017-10-04 00:17:57 +03:00
Egor Karavaev 309be70095 Improved timeout handling. 2017-10-03 20:37:32 +03:00
Egor Karavaev 37275adba6 Update smoltcp. 2017-10-03 18:35:44 +03:00
Jeremy Soller 6166bdcb60 Fix permissions, daemonize 2017-10-02 20:55:29 -06:00
Egor Karavaev 57f7378a5c Update smoltcp. 2017-10-03 00:52:44 +03:00
Egor Karavaev 672c93eee0 TCP scheme. 2017-10-03 00:30:14 +03:00
Egor Karavaev de733b4bf8 Factor out generic socket scheme. 2017-10-02 22:11:31 +03:00
Egor Karavaev 4d9a8c2777 Blocking UDP. 2017-10-02 19:22:22 +03:00
Jeremy Soller 8e41cb9f03 Use disk heirarchy 2017-09-30 20:49:11 -06:00
Jeremy Soller b39a8a29b9 Allow variables in arguments 2017-09-30 18:10:30 -06:00
Jeremy Soller 94b869cd61 Update cargo.lock 2017-09-27 20:32:08 -06:00
Egor Karavaev 2a8478db8f UDP blocking WIP. 2017-09-28 01:02:52 +03:00
Egor Karavaev 3198a8eb69 UDP settings. 2017-09-26 23:51:04 +03:00
Egor Karavaev c62eca07d9 Move file descriptors to schemas. 2017-09-26 22:24:04 +03:00
Egor Karavaev 0a41339def UDP dup. 2017-09-26 01:07:49 +03:00
Egor Karavaev e9f9e821c6 Use FromStr implementations from smoltcp. 2017-09-21 00:35:17 +03:00
Egor Karavaev a15184ce1f Initial support for UDP options. 2017-09-20 10:16:24 +03:00
Egor Karavaev 05650efcb1 Split scheme.rs. 2017-09-20 10:08:37 +03:00
Egor Karavaev 203fa64580 Add BufferPool. 2017-09-20 10:08:37 +03:00
Egor Karavaev 0c5fff907c Factor out logger. 2017-09-20 10:08:37 +03:00
Egor Karavaev 4058f5c4e8 Udp scheme support. 2017-09-20 10:08:37 +03:00
Egor Karavaev 5b89874deb Wip. 2017-09-20 10:08:37 +03:00
Egor Karavaev fb539515d7 Initial integraion of smoltcpd. 2017-09-20 10:08:37 +03:00
Egor Karavaev 1ad591ad05 Add Smolnetd daemon. 2017-09-20 10:08:14 +03:00
Egor Karavaev 091d7472a6 Replace usize with RawFd where it makes sense. 2017-09-20 10:08:14 +03:00
Jeremy Soller 47179f9701 Update dependencies, better implementation of C socket 2017-09-17 16:37:52 -06:00
Jeremy Soller 5f70470c5c Send events on connect 2017-09-16 11:59:08 -06:00
Jeremy Soller 46c84616ec Fix static 2017-09-09 15:06:22 -06:00
Jeremy Soller 17b592b064 Remove unnecessary extern crate 2017-08-30 22:05:56 -06:00
Jeremy Soller 053524acac Remove unused extern crate 2017-08-30 22:03:10 -06:00
Jeremy Soller bc186fbb0d Disable XHCI driver due to lockups 2017-08-27 11:23:05 -06:00
Jeremy Soller ebbd50d299 Update lock file 2017-08-23 19:59:15 -06:00
Jeremy Soller 4e40c1c8af Add method for resizing display 2017-08-21 20:19:58 -06:00
Jeremy Soller 770a23ef94 Add ability to query BGA 2017-08-21 20:08:37 -06:00
Jeremy Soller ee58fcaa61 Spin for reset, do not yield 2017-08-21 19:19:07 -06:00
Jeremy Soller 4d6bf89397 Add debug messages, update lock file 2017-08-21 19:00:54 -06:00
Jeremy Soller 1d7e51b423 Update main.rs 2017-08-21 09:24:55 -06:00
Jeremy Soller 1e7240eda6 Update config.rs 2017-08-21 09:24:13 -06:00
Jeremy Soller 68938a755c Update Cargo.lock 2017-08-19 14:47:03 -06:00
Jeremy Soller 5f11f72489 Update Cargo.lock 2017-08-19 14:47:00 -06:00
Jeremy Soller cce699888a Update Cargo.lock 2017-08-19 14:46:58 -06:00
Jeremy Soller 2d8b9f4358 Update Cargo.lock 2017-08-19 14:46:47 -06:00
Jeremy Soller 8c6ba9df54 Update Cargo.lock 2017-08-19 14:46:45 -06:00
Jeremy Soller cccec2f67e Remove unnecessary mut 2017-08-12 11:38:40 -06:00
Jeremy Soller 18f28d46b4 Update mut usage in vesad 2017-08-12 11:20:56 -06:00
Jeremy Soller 649f1c8b20 Remove debugging of ring 2017-08-06 17:19:07 -06:00
Jeremy Soller 87342d6fce Improve ring state machine 2017-08-06 17:16:07 -06:00
Jeremy Soller 14d8165079 Cleanup xhci, add basic IRQ event functions, cleanup e1000d and rtl8168d 2017-08-06 15:19:56 -06:00
Jeremy Soller 0231e44892 Print out more values 2017-08-06 08:20:31 -06:00
Jeremy Soller d15635e242 Do not shut down after running 2017-08-06 08:09:11 -06:00
Jeremy Soller 144cc2a995 Prettier format of debug data 2017-08-05 21:07:08 -06:00
Jeremy Soller 096a9a6e52 Read device, config, interface, and endpoint descriptions 2017-08-05 20:17:28 -06:00
Jeremy Soller dbceebbc09 Update main.rs 2017-08-04 08:54:16 -06:00
Jeremy Soller 646e8c9eac xhci: WIP grab device information 2017-08-03 21:30:49 -06:00
Jeremy Soller 1109da47fb Update Cargo.lock 2017-08-02 21:15:56 -06:00
Jeremy Soller e088dca7bd Update Cargo.lock 2017-08-02 21:14:39 -06:00
Jeremy Soller 9a5a05b3b2 Remove raw_mode usage from vesad 2017-08-02 20:02:30 -06:00
Jeremy Soller a9d42d05fb Update Cargo.lock 2017-08-02 19:53:22 -06:00
Jeremy Soller 529c9f69eb Update Cargo.lock 2017-08-02 19:53:06 -06:00
Jeremy Soller 48eb950401 Update Cargo.lock 2017-08-02 19:52:23 -06:00
Jeremy Soller b00f190377 Update Cargo.lock 2017-08-02 19:52:13 -06:00
Jeremy Soller 2aed860782 Update Cargo.lock 2017-08-02 19:51:46 -06:00
Jeremy Soller 4798290a2a Fix echo handling 2017-08-01 20:32:09 -06:00
Jeremy Soller 19c9132c76 Implement cooked mode correctly, implement vmin 2017-08-01 20:18:11 -06:00
Jeremy Soller eb64f59d10 Simplify vesad, use ptyd for control logic 2017-08-01 19:43:55 -06:00
Jeremy Soller 832f830cc4 Update EventSte structure 2017-08-01 19:40:25 -06:00
Jeremy Soller e23c6e28e4 Echonl and better creation of output vec 2017-07-31 21:47:11 -06:00
Jeremy Soller bb5720df1d WIP: Implement termios 2017-07-31 21:42:54 -06:00
Jeremy Soller 21d50cf7e6 Update Cargo.lock 2017-07-29 08:25:04 -06:00
Jeremy Soller ee3d4a7cb7 Update Cargo.lock 2017-07-29 08:25:00 -06:00
Jeremy Soller f4a9882764 Update Cargo.lock 2017-07-29 08:24:45 -06:00
Jeremy Soller 7c27222bb8 Update Cargo.lock 2017-07-29 08:24:39 -06:00
Jeremy Soller e83471f53f Update Cargo.lock 2017-07-29 08:24:33 -06:00
Jeremy Soller 545ec4d21f Add more debugging 2017-07-27 21:28:16 -06:00
Jeremy Soller 84a8a6c064 Add missing import 2017-07-27 21:02:56 -06:00
Jeremy Soller b4209a6a9c Refactor XHCI driver 2017-07-27 21:01:42 -06:00
Jeremy Soller d2f9874f9d Update Cargo.lock 2017-07-26 08:17:40 -06:00
Jeremy Soller 14e1b556ab Update Cargo.lock 2017-07-26 08:17:39 -06:00
Jeremy Soller 191273e1ac Add Cargo.lock file 2017-07-26 08:03:55 -06:00
Jeremy Soller db24f41ddd Add Cargo.lock file 2017-07-26 08:03:48 -06:00
Jeremy Soller 51abd85d70 Add Cargo.lock file 2017-07-26 08:02:46 -06:00
Jeremy Soller 31830fb9af Add Cargo.lock file 2017-07-26 08:02:31 -06:00
Jeremy Soller fc1a21c8ee Add Cargo.lock file 2017-07-26 08:02:08 -06:00
Jeremy Soller cd46783126 Add Cargo.lock 2017-07-26 08:00:17 -06:00
Jeremy Soller 3d28932f9c Add Cargo.lock 2017-07-26 07:59:59 -06:00
Jeremy Soller b346221840 Add Cargo.lock 2017-07-26 07:54:58 -06:00
Jeremy Soller 8c9a42a809 Add Cargo.lock 2017-07-26 07:54:19 -06:00
Jeremy Soller 49cb1e3836 Add Cargo.lock 2017-07-26 07:53:16 -06:00
Jeremy Soller 43c1d5b6b0 Read events 2017-07-23 21:36:51 -06:00
Jeremy Soller 325b303c54 Fix mapping size of XHCI, add more debugging 2017-07-23 21:13:27 -06:00
Jeremy Soller 815b59b80b Add runtime registers, testing for TLB to XHCI 2017-07-23 20:22:19 -06:00
Jeremy Soller 4f8138bca7 Do not send SIGTSTP or SIGQUIT yet 2017-07-23 16:56:04 -06:00
Jeremy Soller 6b488a4e2b Fix negation of pgid 2017-07-23 16:03:04 -06:00
Jeremy Soller 6f02841197 WIP: Process termios cc 2017-07-23 15:06:41 -06:00
Jeremy Soller a44184adb7 Add pgrp 2017-07-23 12:54:32 -06:00
Jeremy Soller b69fd15d3c Use crates.io source 2017-07-23 11:42:19 -06:00
Jeremy Soller f03eaa8c24 Add window size 2017-07-23 11:10:34 -06:00
Jeremy Soller 36a34e70b2 Add termios read/write file 2017-07-23 10:53:24 -06:00
Jeremy Soller 854b6470c4 Use termios crate (WIP) 2017-07-23 10:27:46 -06:00
Jeremy Soller 182688120a Refactor ptyd to prepare for adding sizes and foreground groups 2017-07-22 15:17:10 -06:00
Jeremy Soller abd68c2ef3 Add gitignore 2017-07-22 13:51:21 -06:00
Jeremy Soller f242652631 Add gitignore 2017-07-22 13:49:41 -06:00
Jeremy Soller 2cce5b3499 Add gitignore, add EINVAL import 2017-07-22 13:49:12 -06:00
Jeremy Soller 513ddd9eb5 Imports for EINVAL 2017-07-22 13:44:21 -06:00
Jeremy Soller 473ac85faa Return error when dup buf is not empty 2017-07-22 13:17:48 -06:00
Jeremy Soller 7f1eddc84d Return error when dup buf is not empty 2017-07-22 13:16:41 -06:00
Jeremy Soller 29c45c725b Return error when dup buf is not empty 2017-07-22 13:16:05 -06:00
Jeremy Soller bf5f0d0fad Return error when dup buf is not empty 2017-07-22 13:15:45 -06:00
Jeremy Soller 133d38ba7e Trim network config 2017-07-20 20:01:22 -06:00
Jeremy Soller ce78f9cf9e Use dashes for mac addresses 2017-07-20 19:39:50 -06:00
Jeremy Soller 15f3f0ad0f Split pcid into initfs and fs parts 2017-07-20 19:37:35 -06:00
Jeremy Soller c54aa03e54 Add newlines to network config 2017-07-20 19:02:50 -06:00
Jeremy Soller 942b25147d Merge pull request #3 from ids1024/chr
Use syscall::MODE_CHR constant
2017-07-10 17:58:37 -06:00
Jeremy Soller 0d6010b629 Merge pull request #1 from ids1024/fstat
Support fstat()
2017-07-10 17:57:32 -06:00
Ian Douglas Scott 589243ab2c Use syscall::MODE_CHR constant 2017-07-10 16:47:29 -07:00
Ian Douglas Scott a0bb53c258 Support fstat() 2017-07-10 16:43:21 -07:00
Jeremy Soller ac8765d554 Merge pull request #2 from ids1024/fcntl
Allow fcntl
2017-07-10 17:08:22 -06:00
Ian Douglas Scott 369be9ef77 Allow fcntl 2017-07-10 15:51:14 -07:00
Jeremy Soller cd782acf77 Add gitignore, update vesad 2017-07-08 19:23:03 -06:00
Jeremy Soller 60f24f4e6d Merge pull request #1 from ids1024/fstat
Implement fstat()
2017-06-24 20:52:39 -06:00
Jeremy Soller 0ff1e7d106 Merge pull request #17 from xTibor/fix_seek_flags
ihdad: Fix seek flags
2017-06-24 17:33:10 -06:00
Tibor Nagy d75e540fb7 ihdad: Fix seek flags 2017-06-25 00:49:08 +02:00
Jeremy Soller dc1cd969cd Merge pull request #3 from ids1024/curl
tcpd: fix bug in partial reads that was breaking https in curl
2017-06-22 16:29:54 -06:00
Ian Douglas Scott 20793828c4 tcpd: fix bug in partial reads that was breaking https in curl 2017-06-22 15:26:18 -07:00
Ian Douglas Scott fa70dd8072 Implement fstat() 2017-06-18 12:56:01 -07:00
Jeremy Soller 5ef20a47e7 Update pcid.toml to specify intel hd audio more broadly 2017-06-17 17:03:18 -06:00
Jeremy Soller 426fe55638 Merge pull request #16 from TheSchemm/master
Refactored ihdad and added Qemu support.
2017-06-17 16:51:42 -06:00
TheSchemm 402b46561b Refactored ihdad and added Qemu support. 2017-06-17 17:07:19 -05:00
Jeremy Soller aa49ee7b20 Merge pull request #15 from TheSchemm/master
Added $DEVID and $VENID as arguments to pass to driver.
2017-06-16 21:40:15 -06:00
TheSchemm beefc3e1e6 Added and as arguments to pass to driver. 2017-06-16 22:16:50 -05:00
Jeremy Soller c61ebc269e Merge pull request #2 from ids1024/fpath
Correct fpath() for tcpd
2017-06-16 18:11:43 -06:00
Ian Douglas Scott a2d75af7d7 Correct fpath() for tcpd 2017-06-16 16:39:48 -07:00
Jeremy Soller b027725a1e Merge pull request #1 from batonius/icmpd
Initial ICMP support
2017-06-13 13:19:07 -06:00
Egor Karavaev 53db52c119 Fix clippy warnings. 2017-06-13 16:23:49 +03:00
Egor Karavaev ce69cdbb8f Add small fix after testing with ping. 2017-06-12 19:59:25 +03:00
Egor Karavaev 47563fa29e Add support for Echo sub-header. 2017-06-12 15:25:15 +03:00
Egor Karavaev 8301ee85a1 Add initial support for icmp scheme. 2017-06-12 00:23:04 +03:00
Egor Karavaev 69bb8fb80b Add icmpd daemon, only Echo reply for now. 2017-06-11 00:53:30 +03:00
Jeremy Soller 602ab29aba Fix path of ihdad 2017-06-03 14:13:51 -06:00
Jeremy Soller a2fe86c725 Update Cargo.toml 2017-06-03 12:50:44 -06:00
Jeremy Soller 70fc136f81 Merge pull request #13 from TheSchemm/master
Early Beta of the Intel HD Audio Driver
2017-06-03 12:50:28 -06:00
TheSchemm e1f24810ba Early Beta of the Intel HD Audio Driver 2017-06-03 13:45:52 -05:00
Jeremy Soller bb30739804 Organize pcid.toml 2017-05-10 21:49:16 -06:00
Jeremy Soller 24f9dbccb0 Add pcid.toml, cargo workspace 2017-05-10 21:46:59 -06:00
Jeremy Soller a1030a6379 Move randd from main repo 2017-05-09 21:40:13 -06:00
Jeremy Soller 7ea19465bb Move ptyd from main repo 2017-05-09 21:38:53 -06:00
Jeremy Soller 6bfd4be40e Fix missing ethernetd 2017-05-09 21:35:58 -06:00
Jeremy Soller daaa8a3a39 Add ethernetd, ipd, tcpd, and udpd 2017-05-09 21:31:09 -06:00
Jeremy Soller 15675ea9c3 Allow retry of commands, allow failure of commands 2017-04-26 21:28:45 -06:00
Jeremy Soller d3c29d0fb4 Merge pull request #12 from kaedroho/fix/gb-layout-syntax
Fix a couple of syntax errors in keymap.rs
2017-04-23 11:22:54 -06:00
Karl Hobley 60c3ed19c8 Fix a couple of syntax errors in keymap.rs
My previous pull request that added a GB keyboard layout also added a
couple of syntax errors. This PR fixes them. Apologies for that.
2017-04-23 17:54:14 +01:00
Jeremy Soller 38cea07d4f Merge pull request #11 from kaedroho/feature/gb-keymap
Add GB keymap
2017-04-23 10:12:23 -06:00
Karl Hobley bc1efaebf3 Added gb keymap 2017-04-23 16:16:43 +01:00
Jeremy Soller 466c776bf4 Merge pull request #10 from kaedroho/feature/serde
Migrate to serde. Fixes #9
2017-04-23 08:59:22 -06:00
Karl Hobley 77827f57b7 Rename 'english' keymap to 'us'
This keyboard layout is only used in the United States, other
english-speaking countries may have their own standard keyboard layouts.

This commit changes the name of the 'english' layout to 'us' to match
X11.
2017-04-23 15:48:51 +01:00
Karl Hobley 520c140da8 Migrate to serde. Fixes #9 2017-04-23 15:29:48 +01:00
Jeremy Soller b3849ddf36 Convert vesad to be handle based, allow O_NONBLOCK 2017-04-18 21:02:30 -06:00
Jeremy Soller 032a45c552 Open stdio without cloexec 2017-04-16 12:50:26 -06:00
Jeremy Soller 1e7013915b Add path implementation for e1000d and ahcid 2017-04-15 09:57:37 -06:00
Jeremy Soller 6c1f476735 Prevent files from being passed by init to launched children 2017-04-15 09:56:59 -06:00
Jeremy Soller 35cd7e4c13 Merge pull request #7 from TechnoMancer/xhcidev
xhci: fix port detection.
2017-04-10 07:30:07 -06:00
Paul Davey e712a35230 xhci: fix port detection.
Ports are now correctly represented as 4 consecutive u32 registers.
Port state now reads all 4 bits of the state value.
2017-04-11 01:10:47 +12:00
Jeremy Soller f872fee4e6 Merge remote-tracking branch 'origin/vbox_resize' 2017-03-27 18:32:18 -06:00
Jeremy Soller 59b5790024 Merge branch 'alx' 2017-03-27 18:30:54 -06:00
Jeremy Soller 7957308f01 Catch screenbuffer event 2017-03-26 21:20:09 -06:00
Jeremy Soller 4d04f50b2a Handle input event from ransid 2017-03-26 15:32:28 -06:00
Jeremy Soller 0b94ce28e4 WIP: ALX driver 2017-03-26 15:24:25 -06:00
Jeremy Soller 21991855fd Merge pull request #5 from meven/add-azerty-bepo-support
Add support for french azerty and bepo keymap
2017-03-25 14:36:35 -06:00
Meven 8804e67702 Add support for french azerty and bepo keymap 2017-03-25 17:58:34 +01:00
Jeremy Soller 742bad2fd3 Remove unused import 2017-03-23 22:19:38 -06:00
Jeremy Soller ca262809dc Fix issue with scroll on odd width display 2017-03-23 22:18:25 -06:00
Jeremy Soller 58246591c0 Resize ransid 2017-03-22 22:15:58 -06:00
Jeremy Soller b8aca0f5f0 Fix bugs in resize in vesad 2017-03-22 20:53:10 -06:00
Jeremy Soller a0c5ab7911 WIP: VBox resize 2017-03-22 15:59:53 -06:00
Jeremy Soller 83dbbe2c41 Merge pull request #4 from chebykinn/fix-ahcid
Fix missing use statement
2017-03-22 08:38:06 -06:00
Ivan Chebykin 4c93b53de0 Combine thread use statement with previous 2017-03-22 17:01:49 +03:00
Ivan Chebykin b6268ff95c Fix missing use statement 2017-03-22 16:35:32 +03:00
Jeremy Soller beef16096f Use thread::yield_now instead of pause in ahcid, e1000d, and rtl8168d
Remove debugging from e1000d
2017-03-21 20:52:39 -06:00
Jeremy Soller 898ec5acbd Yield unstead of pause in loops in rtl8168d 2017-03-21 20:38:57 -06:00
Jeremy Soller 3a8e40d78c Yield unstead of spinning without interruption for loops in e1000d, add information about link speed 2017-03-21 20:38:27 -06:00
Jeremy Soller 050abc1a7e Do not cli in ps2d 2017-03-21 20:37:47 -06:00
Jeremy Soller c544b72c73 Reset, wait for link up 2017-03-21 16:56:26 -06:00
Jeremy Soller 060934a77d Remove debug statement, again 2017-03-20 22:23:56 -06:00
Jeremy Soller f384376e19 Remove debug statement 2017-03-20 22:00:45 -06:00
Jeremy Soller 63df9fff38 Fix interrupts in PS/2 driver, support for absolute mouse position and new orbclient event format 2017-03-20 21:39:41 -06:00
Jeremy Soller bad856d7b4 Support for mouse events in vbox driver 2017-03-20 21:39:12 -06:00
Jeremy Soller a294fe6d6f Update to support absolute mouse events 2017-03-20 21:38:30 -06:00
Jeremy Soller 66d2aa8c01 Add virtualbox guest driver (WIP) 2017-03-18 21:48:33 -06:00
Jeremy Soller 2593c25212 Add support for BGA mode setting (WIP) 2017-03-18 21:47:38 -06:00
Jeremy Soller fe65978ac4 Update to catch title event 2017-03-08 15:00:53 -07:00
Jeremy Soller 8b14b587b9 Merge pull request #2 from adrianN/remove_scheme_todo
Make enum values List and Disk contain two values
2017-03-05 07:55:45 -08:00
Adrian Neumann ebc5f86e8c Make enum values List and Disk contain two values instead of a tuple of values. 2017-03-05 15:44:06 +01:00
Jeremy Soller f4d6fbb4a2 Update orbclient, add scroll events 2017-02-27 21:48:15 -07:00
Jeremy Soller 96fbf1658f More completely disable XHCI driver 2017-02-24 13:25:57 -07:00
Jeremy Soller 975082c18a Disable XHCI driver to prevent deadlocks 2017-02-24 13:21:26 -07:00
Jeremy Soller 63dd2286fe nvmed: Verify correct memory space 2017-02-18 19:07:11 -07:00
Jeremy Soller 7be81d7837 Add read, write command structures 2017-02-18 15:00:14 -07:00
Jeremy Soller 28dbc45637 WIP: NVME driver 2017-02-18 14:05:04 -07:00
Jeremy Soller 5b223c06d0 Improve XHCI driver 2017-02-13 22:15:19 -07:00
Jeremy Soller bd146da9bc Better errors when display not found 2017-02-07 20:53:41 -07:00
Jeremy Soller 911e20c177 Merge pull request #1 from little-dude/master
remove unused #[macro_use]
2017-01-24 12:48:21 -07:00
Corentin Henry d8a35a9a08 remove unused #[macro_use] 2017-01-24 11:09:09 -08:00
Jeremy Soller 1b684e2406 Specify crates.io versions, update rust, cleanup modules 2017-01-13 15:10:43 -07:00
Jeremy Soller 4bb229959e Specify crates.io versions 2017-01-13 15:10:16 -07:00
Jeremy Soller c8a4a0d67c Mistake in init using wrong fd in dup2, update userutils 2017-01-12 19:13:38 -07:00
Jeremy Soller 61ff636174 Fix issue with init script stdio failing on vga=no 2017-01-12 18:41:11 -07:00
Jeremy Soller 778852f92d WIP: XHCI 2017-01-10 20:48:59 -07:00
Jeremy Soller cc299464fc Use orbclient font 2017-01-09 21:20:58 -07:00
Jeremy Soller c95f2dec04 Update submodules 2017-01-09 20:38:42 -07:00
Jeremy Soller 608403765d Refactor to move io into syscall, and use git for crate references 2017-01-09 20:36:36 -07:00
Jeremy Soller 552ce2c4b4 Update init to handle directories 2017-01-05 15:02:54 -07:00
Jeremy Soller 9eeade8860 Cleanup dependencies 2017-01-04 16:46:18 -07:00
Jeremy Soller 184539c133 Fix name of bgad 2017-01-04 16:25:55 -07:00
Martin Lindhe 50d7e630f7 fix some typos 2017-01-03 13:14:37 +01:00
Jeremy Soller cf46a3b5fc Fallback in ahci driver when disk: not available, ability to list disk devices 2017-01-02 08:53:50 -07:00
Jeremy Soller fd16415383 Revert change that incorrectly overshifts char data 2016-12-30 21:30:24 -07:00
xTibor 34708d4290 Fix vesad text rendering 2016-12-28 02:37:10 +01:00
Jeremy Soller 04813e3e6e Update orbutils 2016-12-17 15:05:07 -07:00
Jeremy Soller f3fa07ded9 Add BGA driver stub 2016-12-14 08:34:45 -07:00
Jeremy Soller a876a2925f Remove replacement for libc 2016-12-06 15:15:08 -07:00
Jeremy Soller b7b861de84 Activate orbital screen on load 2016-11-29 21:25:45 -07:00
Jeremy Soller 4efc72b0a8 Remove rand replace 2016-11-27 16:49:29 -07:00
Jeremy Soller 159fdd0e7d Clean up cfg rusttype 2016-11-25 17:01:19 -07:00
Jeremy Soller 3667c0ffd9 Use mmio, disable timer interrupt 2016-11-22 17:05:23 -07:00
Jeremy Soller 68a2fe57bc WIP: Predictable naming 2016-11-21 12:23:17 -07:00
Jeremy Soller aa5f12c302 Fix printing of escape codes 2016-11-20 11:51:37 -07:00
Jeremy Soller ccaf9636cf Update syscall and rust, add fcntl for permissions 2016-11-15 16:12:51 -07:00
Jeremy Soller bac443482a Switch to real standard, fix daemonization on real standard 2016-11-10 20:02:51 -07:00
Jeremy Soller 03abcd0e0e Update for new rustc-serialize 2016-11-10 11:28:43 -07:00
Jeremy Soller 60f880817f Invert on cursor 2016-11-10 10:35:43 -07:00
Waylon Cude febfbfedb3 Added dvorak keymap (#752)
Keymaps are passed as arguments to ps2d.
To select the dvorak keymap use `ps2d dvorak`,
otherwise the kymap will default to english.
2016-11-10 08:56:38 -07:00
Jeremy Soller 08557a7c13 Fix build, remove cfg(redox) 2016-11-09 17:00:48 -07:00
Jeremy Soller db37769a8b Update to use upstream libc and rand 2016-11-09 10:43:05 -07:00
Jeremy Soller 428e34f77d Disable power management 2016-11-07 20:46:34 -07:00
Jeremy Soller 8daf977c58 Fix eventing in kernel 2016-11-03 16:02:44 -06:00
Jeremy Soller 9064550f6a Fix rustc-serialize 2016-11-03 15:47:54 -06:00
Jeremy Soller 0fdebfd4a1 Update syscall lib, update submodules and dependencies 2016-11-03 15:10:32 -06:00
Jeremy Soller 83c58e0486 Remove resource_sceme, Fix syscall crate name, add fmap 2016-11-02 19:48:25 -06:00
Jeremy Soller 621e557174 Remove resource_sceme, Fix syscall crate name, add fmap 2016-11-02 19:48:25 -06:00
Jeremy Soller e4b4eb5a83 Update terminal emulator 2016-11-02 14:17:11 -06:00
Jeremy Soller cde0a9c8a1 Correct init process, allow waiting on any children, reap zombies in init 2016-11-01 11:04:53 -06:00
Jeremy Soller 81c4b8c998 Smp (#23)
* Fire up multiple processors

* Use IPIs to wake up secondary processors

* Much better exception information

* Modifications to show more information on fault

* WIP: Use real libstd

* Add TLS (not complete)

* Add random function, export getpid, cleanup

* Do not spin APs until new context

* Update rust

* Update rust

* Use rd/wrfsbase

* Implement TLS

* Implement compiler builtins and update rust

* Update rust

* Back to Redox libstd

* Update rust
2016-10-31 10:49:00 -06:00
Jeremy Soller e71e27a3c6 Update vesad ransid branch 2016-10-26 14:17:57 -06:00
Jeremy Soller fe339a9362 Redo networking (#22)
* Rewriting network functions

* Add buffer to dup
Fix non-blocking handling by triggering once on enabling events to read to EOF

* Modifications for UDP API

* Implement TCP client side

* Add active close

* Add DMAR parser

* Implement basic TCP listening. Need to improve the state machine

* Reduce debugging

* Fixes for close procedure

* Updates to fix path processing in libstd
2016-10-26 13:19:56 -06:00
Jeremy Soller 891a8a85b3 Update submodules 2016-10-23 19:01:30 -06:00
Jeremy Soller 87a7261781 Add O_NONBLOCK 2016-10-23 15:38:49 -06:00
Jeremy Soller 9c94a5cd86 Event based ethernetd 2016-10-23 15:26:36 -06:00
Jeremy Soller a1acadd373 More debugging of writes in ahcid 2016-10-22 22:23:09 -06:00
Jeremy Soller b18653c57d Debug all driver activity to display:1, use format to avoid line splitting 2016-10-22 19:35:23 -06:00
Jeremy Soller 5724bacd2b Set mac address on boot 2016-10-22 19:13:57 -06:00
Jeremy Soller cb5f38dfdc Do not throw pcid into background - this prevents ethernetd from exiting if it tries to open network: too early 2016-10-22 19:00:36 -06:00
Jeremy Soller 04266d6438 WIP: Make network drivers send fevent packets 2016-10-22 17:14:52 -06:00
Jeremy Soller 8ee024b34f Simplify vesad by using SchemeMut 2016-10-22 14:54:13 -06:00
Jeremy Soller 4d3580f0f2 Fix tx and rx 2016-10-20 16:48:09 -06:00
Jeremy Soller 1f0ba2b945 Do not block on IRQ read, add more debugging to RTL8168/9 2016-10-20 15:49:17 -06:00
Jeremy Soller 71a9795139 Do not ack IRQ in ahcid, as it does not enable IRQs 2016-10-20 14:37:05 -06:00
Jeremy Soller 6b60fd6c59 Fix buffers by using two 32-bit high and low parts 2016-10-20 14:28:58 -06:00
Jeremy Soller d78981ded6 Add rtl8168 driver, make drivers use O_NONBLOCK 2016-10-20 12:52:58 -06:00
Jeremy Soller 571c5ac641 Less output in pcid, fix e1000d crate name 2016-10-19 13:19:37 -06:00
Jeremy Soller 665eaa5298 Allow init to change stdio 2016-10-17 11:00:55 -06:00
Jeremy Soller f0664243c3 Remove question mark where not required 2016-10-15 20:56:32 -06:00
Jeremy Soller b69014a48a Correct size of data 2016-10-14 22:06:20 -06:00
Jeremy Soller 385df792b0 Divide init into two files 2016-10-14 21:11:29 -06:00
Jeremy Soller 9eb092a215 Significant improvements for events - switch to event queue in orbital 2016-10-14 20:12:21 -06:00
Jeremy Soller e089cffc39 Add specification to vesad
Fix piping
Fix bug where resources are not closed
Add arpd
Remove question_mark features
2016-10-14 18:22:57 -06:00
Jeremy Soller ea59208002 Use a single thread for ps/2 driver 2016-10-14 12:54:37 -06:00
Jeremy Soller d494576d59 Move IRQ ack higher in mouse driver 2016-10-14 12:42:02 -06:00
Jeremy Soller 815c471aed Orbital (#16)
* Port previous ethernet scheme

* Add ipd

* Fix initfs rebuilds, use QEMU user networking addresses in ipd

* Add tcp/udp, netutils, dns, and network config

* Add fsync to network driver

* Add dns, router, subnet by default

* Fix e1000 driver. Make ethernet and IP non-blocking to avoid deadlocks

* Add orbital server, WIP

* Add futex

* Add orbutils and orbital

* Update libstd, orbutils, and orbital
Move ANSI key encoding to vesad

* Add orbital assets

* Update orbital

* Update to add login manager

* Add blocking primitives, block for most things except waitpid, update orbital

* Wait in waitpid and IRQ, improvements for other waits

* Fevent in root scheme

* WIP: Switch to using fevent

* Reorganize

* Event based e1000d driver

* Superuser-only access to some network schemes, display, and disk

* Superuser root and irq schemes

* Fix orbital
2016-10-13 17:21:42 -06:00
Jeremy Soller 936f177775 Allow sending/receiving with e1000 driver 2016-10-08 20:36:51 -06:00
Jeremy Soller a6304e690e Enable bus mastering 2016-10-08 20:36:21 -06:00
Jeremy Soller 2cadfb8691 Graphics (#13)
Virtual Terminals
2016-10-07 20:18:05 -06:00
Jeremy Soller da74f55e06 Correct ctrl-c behavior 2016-10-06 19:21:48 -06:00
Jeremy Soller 00a9a12840 Implement unix permissions 2016-10-05 18:01:05 -06:00
Jeremy Soller 7eb3a5f23a Add permissions to the filesystem, preliminary permissions to the syscalls 2016-10-05 14:24:08 -06:00
Jeremy Soller 1983def7f4 More detailed print on ahci error 2016-09-30 12:06:50 -06:00
Jeremy Soller 9027443bf7 Add delete and insert to ps2d 2016-09-30 10:34:44 -06:00
Jeremy Soller 758dfb5fe6 Do not emit I/O error in the case that a small buffer is passed - just return 0 2016-09-30 10:27:12 -06:00
Jeremy Soller c1a1de1a0d Fix dup deadlock, add stat 2016-09-29 18:34:58 -06:00
Jeremy Soller e4005d0503 Add dup to ahci disk scheme 2016-09-29 17:45:01 -06:00
Jeremy Soller 71990b7c54 Update extrautils, more efficient font drawing 2016-09-29 13:44:34 -06:00
Jeremy Soller e542783402 Make rusttype optional for vesad 2016-09-29 13:17:19 -06:00
Jeremy Soller 31a059a9fd Automatically get size of terminal 2016-09-29 12:25:43 -06:00
Jeremy Soller 1e519c75ac Implement control and navigation in ps2 driver 2016-09-28 21:59:51 -06:00
Jeremy Soller 13b64da01a Improvements for cooked mode 2016-09-28 15:17:37 -06:00
Jeremy Soller 3d714f1c3b Some fixes for cooked mode 2016-09-28 15:04:15 -06:00
Jeremy Soller 0a4b617eac Cleaner blending of fonts. Do not draw cursor when disabled 2016-09-28 12:19:30 -06:00
Jeremy Soller 9f5353453a Remove debugging 2016-09-27 21:27:32 -06:00
Jeremy Soller e6737c591f Add disk scheme (mostly finished) 2016-09-27 20:52:26 -06:00
Jeremy Soller 8727861301 Make AHCI driver read bytes 2016-09-27 20:26:54 -06:00
Jeremy Soller 64d949fc62 Abstractions for better Ahci driver 2016-09-27 11:14:27 -06:00
Jeremy Soller 0218393e92 Remove unnecessary slash 2016-09-26 17:39:58 -06:00
Jeremy Soller 8e553d619d Fix allocate_frames 2016-09-26 17:13:35 -06:00
Jeremy Soller 7bee7c6a82 WIP: AHCI drivers and more memory syscalls 2016-09-26 17:00:06 -06:00
Jeremy Soller f79f80e595 Launch commands for each device found if specified 2016-09-25 16:59:25 -06:00
Jeremy Soller 7ca0bcede8 Event support - demonstration in example scheme 2016-09-23 17:54:39 -06:00
Jeremy Soller ffaf2160ca WIP: Kevent 2016-09-23 15:47:53 -06:00
Jeremy Soller 2a5ff38f8d Add cursor 2016-09-22 17:11:42 -06:00
Jeremy Soller a6d5d23d96 Fix openlibm 2016-09-22 16:57:26 -06:00
Jeremy Soller 690a433421 Switch to using rusttype 2016-09-22 16:15:38 -06:00
Jeremy Soller 7253270bd8 Do not write ps2d keyboard to serial 2016-09-22 10:23:00 -06:00
Jeremy Soller 0cbc3eacf7 Add wnohang, make PS/2 driver write input to display scheme, which then passes it to the shell 2016-09-22 10:10:27 -06:00
Jeremy Soller 6ab16af3f5 Add login process. Remove debugging. Fix order of arguments 2016-09-22 08:43:22 -06:00
Jeremy Soller b9a2554432 Add login process. Remove debugging. Fix order of arguments 2016-09-22 08:43:22 -06:00
Jeremy Soller dbb554f885 Increase optimization, fix clobbers in vesad 2016-09-21 16:46:16 -06:00
Jeremy Soller a77bc89a9f WIP: Userspace console 2016-09-21 12:18:48 -06:00
Jeremy Soller 6d8a75ff9b Launch ion 2016-09-20 21:56:40 -06:00
Jeremy Soller 492437bb9c WIP: VESA driver. Make initfs generated by code 2016-09-20 21:52:45 -06:00
Jeremy Soller f0d65c068e Create example userspace scheme. Remove kernel duplication of syscalls, use syscall crate instead 2016-09-20 16:23:28 -06:00
Jeremy Soller 3e4544c4de Grant to allow passing data to scheme handler 2016-09-20 14:50:04 -06:00
Jeremy Soller a737a71254 Implement user schemes. Example in pcid. Currently deadlocks in UserInner 2016-09-20 08:47:16 -06:00
Jeremy Soller 1bbd71d7d8 Move PS/2 driver to userspace 2016-09-19 17:19:49 -06:00
Jeremy Soller a60773c1c5 PS/2 driver convert to char 2016-09-19 10:24:19 -06:00
Jeremy Soller aeabb66d9a Seperate PS/2 keyboard and mouse driver 2016-09-19 09:43:30 -06:00
Jeremy Soller 0feba280aa Allow userspace to handle IRQs (WIP). Create basic keyboard handler 2016-09-18 20:17:08 -06:00
Jeremy Soller a87ab74e8f Run pcid as a daemon 2016-09-17 08:09:32 -06:00
Jeremy Soller e306348e44 More compact output 2016-09-11 16:24:43 -06:00
Jeremy Soller 4b3bc6ac11 PCI driver WIP 2016-09-11 15:56:48 -06:00
70 changed files with 1957 additions and 508 deletions
+1
View File
@@ -9,3 +9,4 @@ sysroot/
.vs/
# Local settings folder for the devcontainer extension that most IDEs support.
.devcontainer/
Cargo.lock
+84
View File
@@ -0,0 +1,84 @@
# Base functions intentionally removed/replaced by Red Bear commits.
# These exist in upstream but were replaced with RB-specific implementations
# or removed as part of RB refactoring. Documented per Phase 17 verification.
# initfs — RB uses different initfs tooling
bootstrap/src/initfs.rs:pub unsafe redox_fcntl_v0
initfs/src/lib.rs:pub root_inode
initfs/tools/src/lib.rs:allocate
initfs/tools/src/lib.rs:allocate_contents
initfs/tools/src/lib.rs:count
initfs/tools/src/lib.rs:new
initfs/tools/src/lib.rs:pub build_initfs
initfs/tools/src/lib.rs:write_inode_table
# graphics drivers — RB refactored KMS/display layer
drivers/graphics/console-draw/src/lib.rs:pub from_psf
drivers/graphics/driver-graphics/src/kms/connector.rs:pub set_connector_edid
drivers/graphics/driver-graphics/src/kms/connector.rs:update_from_edid
drivers/graphics/driver-graphics/src/kms/objects.rs:into_object
drivers/graphics/driver-graphics/src/kms/objects.rs:pub add_plane
drivers/graphics/driver-graphics/src/kms/objects.rs:pub get_framebuffer_maybe_closed
drivers/graphics/driver-graphics/src/kms/objects.rs:pub get_plane
drivers/graphics/driver-graphics/src/kms/objects.rs:pub plane_ids
drivers/graphics/driver-graphics/src/kms/objects.rs:pub planes
drivers/graphics/driver-graphics/src/kms/objects.rs:pub remove_framebuffer_if_closed
drivers/graphics/driver-graphics/src/kms/objects.rs:remove
drivers/graphics/driver-graphics/src/kms/objects.rs:try_from_object
drivers/graphics/driver-graphics/src/kms/properties.rs:pub remove_blob
drivers/graphics/driver-graphics/src/lib.rs:fb_has_any_use
drivers/graphics/driver-graphics/src/lib.rs:get_unique
drivers/graphics/driver-graphics/src/lib.rs:set_plane
# ihdgd (Intel GPU) — RB driver refactoring
drivers/graphics/ihdgd/src/device/mod.rs:add_kms_pipe
drivers/graphics/ihdgd/src/device/mod.rs:unsafe new
drivers/graphics/ihdgd/src/device/mod.rs:unsafe new_pci_bar
drivers/graphics/ihdgd/src/device/scheme.rs:get_unique
drivers/graphics/ihdgd/src/device/scheme.rs:set_plane
# vesad — RB framebuffer refactoring
drivers/graphics/vesad/src/scheme.rs:get_unique
drivers/graphics/vesad/src/scheme.rs:set_plane
# virtio-gpu — RB async GPU refactoring
drivers/graphics/virtio-gpud/src/main.rs:daemon
drivers/graphics/virtio-gpud/src/scheme.rs:async create_dumb_buffer_inner
drivers/graphics/virtio-gpud/src/scheme.rs:async disable_cursor
drivers/graphics/virtio-gpud/src/scheme.rs:async move_cursor
drivers/graphics/virtio-gpud/src/scheme.rs:async resource_attach_backing
drivers/graphics/virtio-gpud/src/scheme.rs:async resource_create_2d
drivers/graphics/virtio-gpud/src/scheme.rs:async send_request_cursor
drivers/graphics/virtio-gpud/src/scheme.rs:async update_cursor
drivers/graphics/virtio-gpud/src/scheme.rs:get_unique
drivers/graphics/virtio-gpud/src/scheme.rs:set_plane
# input daemons — RB uses different daemon pattern
drivers/inputd/src/main.rs:daemon
# USB HID — RB input refactoring
drivers/input/usbhidd/src/main.rs:send_gamepad_axis
drivers/input/usbhidd/src/main.rs:send_gamepad_button
# virtio-net — RB uses different daemon pattern
drivers/net/virtio-netd/src/main.rs:daemon
# pcid — RB PCI refactoring
drivers/pcid/src/driver_interface/mod.rs:connect_default
drivers/pcid/src/scheme.rs:pub mmap_prep
# redoxerd — RB executor refactoring
drivers/redoxerd/src/main.rs:pub getpty
# xhcid (USB) — RB USB refactoring
drivers/usb/xhcid/src/driver_interface.rs:pub xhci_dci
drivers/usb/xhcid/src/xhci/mod.rs:new
drivers/usb/xhcid/src/xhci/mod.rs:pub get
drivers/usb/xhcid/src/xhci/mod.rs:pub index
# netstack — RB network stack refactoring
netstack/src/main.rs:get_network_adapter
# ramfs — RB filesystem refactoring
ramfs/src/scheme.rs:as_inode
ramfs/src/scheme.rs:relpathat
Generated
+92 -82
View File
@@ -13,7 +13,7 @@ dependencies = [
"pcid",
"redox-scheme",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"scheme-utils",
"spin",
]
@@ -56,7 +56,7 @@ dependencies = [
"plain",
"redox-scheme",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"ron",
"rustc-hash",
"scheme-utils",
@@ -76,7 +76,7 @@ dependencies = [
"log",
"pcid",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
]
[[package]]
@@ -100,7 +100,7 @@ dependencies = [
"libredox",
"log",
"pcid",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"ron",
"serde",
]
@@ -206,7 +206,7 @@ dependencies = [
"libc",
"libredox",
"redox-scheme",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"scheme-utils",
]
@@ -238,7 +238,7 @@ dependencies = [
"fdt 0.2.0-alpha1",
"libredox",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
]
[[package]]
@@ -316,18 +316,18 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7"
[[package]]
name = "bytemuck"
version = "1.25.0"
version = "1.25.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec"
checksum = "d6aedf8ae72766347502cf3cb4f41cf5e9cc37d28bee90f1fdaaae15f9cf9424"
dependencies = [
"bytemuck_derive",
]
[[package]]
name = "bytemuck_derive"
version = "1.10.2"
version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9abbd1bc6865053c427f7198e6af43bfdedc55ab791faed4fbd361d789575ff"
checksum = "f65693059b6b9c588b9f62fed1cedbf0a8b805631457ea162d68f0de186f3de5"
dependencies = [
"proc-macro2",
"quote",
@@ -342,9 +342,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]]
name = "cc"
version = "1.2.66"
version = "1.2.67"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f5d6cac793997bd970000024b2934968efe83b382de4fdcf4fcb46b6ee4ad996"
checksum = "e17dd265a7d0f31ef544e1b20e03add05d3b45b491b633b10d67145d2acc1a38"
dependencies = [
"find-msvc-tools",
"shlex",
@@ -436,7 +436,7 @@ dependencies = [
"libredox",
"log",
"redox-log",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
]
[[package]]
@@ -526,7 +526,7 @@ dependencies = [
"libc",
"libredox",
"redox-scheme",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
]
[[package]]
@@ -597,7 +597,7 @@ dependencies = [
"log",
"partitionlib",
"redox-scheme",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"scheme-utils",
]
@@ -614,7 +614,7 @@ dependencies = [
"log",
"redox-ioctl",
"redox-scheme",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"scheme-utils",
]
@@ -625,7 +625,7 @@ dependencies = [
"daemon",
"libredox",
"redox-scheme",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"scheme-utils",
]
@@ -681,7 +681,7 @@ dependencies = [
"i2c-interface",
"libredox",
"log",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"ron",
"serde",
]
@@ -698,7 +698,7 @@ dependencies = [
"log",
"pcid",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
]
[[package]]
@@ -778,7 +778,7 @@ dependencies = [
"ransid",
"redox-scheme",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"scheme-utils",
]
@@ -798,7 +798,7 @@ dependencies = [
"ransid",
"redox-scheme",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"scheme-utils",
"toml",
]
@@ -956,7 +956,7 @@ dependencies = [
"libredox",
"log",
"redox-scheme",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"ron",
"scheme-utils",
"serde",
@@ -1045,7 +1045,7 @@ dependencies = [
"fdt 0.1.5",
"libredox",
"log",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"ron",
]
@@ -1060,7 +1060,7 @@ dependencies = [
"i2c-interface",
"libredox",
"log",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"ron",
"serde",
]
@@ -1080,7 +1080,7 @@ dependencies = [
"log",
"orbclient",
"redox-scheme",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"ron",
"scheme-utils",
"serde",
@@ -1090,7 +1090,7 @@ dependencies = [
name = "i2c-interface"
version = "0.1.0"
dependencies = [
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"serde",
]
@@ -1105,7 +1105,7 @@ dependencies = [
"libredox",
"log",
"redox-scheme",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"ron",
"scheme-utils",
"serde",
@@ -1146,7 +1146,7 @@ dependencies = [
"log",
"pcid",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
]
[[package]]
@@ -1161,7 +1161,7 @@ dependencies = [
"pcid",
"redox-scheme",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"scheme-utils",
"spin",
]
@@ -1184,7 +1184,7 @@ dependencies = [
"range-alloc",
"redox-scheme",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"void",
]
@@ -1206,7 +1206,7 @@ dependencies = [
"libc",
"libredox",
"plain",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"serde",
"serde_json",
"toml",
@@ -1223,7 +1223,7 @@ dependencies = [
"log",
"orbclient",
"redox-scheme",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"scheme-utils",
]
@@ -1237,7 +1237,7 @@ dependencies = [
"daemon",
"libredox",
"log",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"ron",
"serde",
]
@@ -1253,7 +1253,7 @@ dependencies = [
"i2c-interface",
"libredox",
"log",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"ron",
"serde",
]
@@ -1273,7 +1273,7 @@ dependencies = [
"pci_types",
"pcid",
"redox-scheme",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"ron",
"scheme-utils",
"serde",
@@ -1300,7 +1300,7 @@ dependencies = [
"rand 0.10.2",
"redox-scheme",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"scheme-utils",
]
@@ -1325,9 +1325,10 @@ dependencies = [
"daemon",
"driver-network",
"libredox",
"log",
"pcid",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
]
[[package]]
@@ -1355,13 +1356,13 @@ checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
[[package]]
name = "libredox"
version = "0.1.18+rb0.3.0"
version = "0.1.18+rb0.3.1"
dependencies = [
"bitflags 2.13.0",
"ioslice",
"libc",
"plain",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
]
[[package]]
@@ -1385,7 +1386,7 @@ dependencies = [
"driver-block",
"libredox",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
]
[[package]]
@@ -1419,7 +1420,7 @@ dependencies = [
"daemon",
"libredox",
"redox-scheme",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"scheme-utils",
]
@@ -1476,7 +1477,7 @@ dependencies = [
"redox-log",
"redox-scheme",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"scheme-utils",
"smoltcp",
]
@@ -1532,7 +1533,7 @@ dependencies = [
"partitionlib",
"pcid",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"smallvec 1.15.2",
]
@@ -1657,7 +1658,7 @@ dependencies = [
"pico-args",
"plain",
"redox-scheme",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"scheme-utils",
"serde",
]
@@ -1674,7 +1675,7 @@ dependencies = [
"log",
"pcid",
"pico-args",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"serde",
"toml",
]
@@ -1728,7 +1729,7 @@ dependencies = [
"orbclient",
"redox-scheme",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
]
[[package]]
@@ -1739,7 +1740,7 @@ dependencies = [
"libredox",
"redox-scheme",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"redox_termios",
"scheme-utils",
]
@@ -1773,7 +1774,7 @@ dependencies = [
"indexmap",
"libredox",
"redox-scheme",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"scheme-utils",
"slab",
]
@@ -1793,9 +1794,9 @@ dependencies = [
[[package]]
name = "rand"
version = "0.8.6"
version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a"
checksum = "22f6172bdec972074665ed81ed53b71da00bfc44b65a753cfde883ec4c702a1a"
dependencies = [
"libc",
"rand_chacha 0.3.1",
@@ -1879,7 +1880,7 @@ dependencies = [
"rand_core 0.5.1",
"raw-cpuid",
"redox-scheme",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"scheme-utils",
"sha2",
]
@@ -1951,7 +1952,7 @@ name = "redox-ioctl"
version = "0.1.0"
dependencies = [
"drm-sys",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
]
[[package]]
@@ -1967,10 +1968,10 @@ dependencies = [
[[package]]
name = "redox-scheme"
version = "0.11.2+rb0.3.0"
version = "0.11.2+rb0.3.1"
dependencies = [
"libredox",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
]
[[package]]
@@ -1994,7 +1995,7 @@ dependencies = [
[[package]]
name = "redox_syscall"
version = "0.9.0+rb0.3.0"
version = "0.9.0+rb0.3.1"
dependencies = [
"bitflags 2.13.0",
]
@@ -2014,15 +2015,15 @@ dependencies = [
"libredox",
"qemu-exit",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"redox_termios",
]
[[package]]
name = "regex"
version = "1.12.4"
version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1292b7759ae1cb9ec195452d1390a074f0cd8541ab7a5a8c31cd6db45d4a6ba"
checksum = "2a0e75113e14dc5acb068cd0786884f214f1312650a3d36d269f5c4f3cdee8a2"
dependencies = [
"aho-corasick",
"memchr 2.8.3",
@@ -2032,9 +2033,9 @@ dependencies = [
[[package]]
name = "regex-automata"
version = "0.4.14"
version = "0.4.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f"
checksum = "1f388202e4b80542a0921078cc23b6333bcf1409c1e3f86404cae4766a6131db"
dependencies = [
"aho-corasick",
"memchr 2.8.3",
@@ -2090,7 +2091,7 @@ dependencies = [
"log",
"pcid",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
]
[[package]]
@@ -2105,7 +2106,7 @@ dependencies = [
"log",
"pcid",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
]
[[package]]
@@ -2144,7 +2145,7 @@ dependencies = [
"log",
"redox-scheme",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"scheme-utils",
"spin",
]
@@ -2155,7 +2156,7 @@ version = "0.0.0"
dependencies = [
"libredox",
"redox-scheme",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
]
[[package]]
@@ -2411,6 +2412,15 @@ dependencies = [
"numtoa",
]
[[package]]
name = "thermald"
version = "0.1.0"
dependencies = [
"anyhow",
"common",
"log",
]
[[package]]
name = "thiserror"
version = "1.0.69"
@@ -2497,7 +2507,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675"
dependencies = [
"cfg-if 1.0.4",
"rand 0.8.6",
"rand 0.8.7",
"static_assertions",
]
@@ -2519,7 +2529,7 @@ dependencies = [
"libredox",
"log",
"redox-scheme",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"ron",
"scheme-utils",
"serde",
@@ -2533,7 +2543,7 @@ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
[[package]]
name = "usb-core"
version = "0.3.0"
version = "0.3.1"
[[package]]
name = "usbctl"
@@ -2554,7 +2564,7 @@ dependencies = [
"inputd",
"log",
"orbclient",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"rehid",
"xhcid",
]
@@ -2565,7 +2575,7 @@ version = "0.1.0"
dependencies = [
"common",
"log",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"xhcid",
]
@@ -2580,7 +2590,7 @@ dependencies = [
"log",
"plain",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"thiserror 2.0.18",
"xhcid",
]
@@ -2618,7 +2628,7 @@ dependencies = [
"orbclient",
"pcid",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
]
[[package]]
@@ -2639,7 +2649,7 @@ dependencies = [
"orbclient",
"ransid",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
]
[[package]]
@@ -2655,7 +2665,7 @@ dependencies = [
"log",
"pcid",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"spin",
"static_assertions",
"thiserror 2.0.18",
@@ -2674,7 +2684,7 @@ dependencies = [
"log",
"pcid",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"static_assertions",
"thiserror 2.0.18",
]
@@ -2694,7 +2704,7 @@ dependencies = [
"orbclient",
"pcid",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"spin",
"static_assertions",
"virtio-core",
@@ -2711,7 +2721,7 @@ dependencies = [
"libredox",
"log",
"pcid",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"static_assertions",
"virtio-core",
]
@@ -2968,7 +2978,7 @@ dependencies = [
"plain",
"redox-scheme",
"redox_event",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"regex",
"scheme-utils",
"serde",
@@ -2981,18 +2991,18 @@ dependencies = [
[[package]]
name = "zerocopy"
version = "0.8.53"
version = "0.8.54"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75726053136156d419e285b9b7eddaaea9e3fea6ce32eed44a89901f0bd98de1"
checksum = "b7cbbc0a705a0fd05cc3676525980d2bf5a9bc4adac6d6475209a7887cf59d19"
dependencies = [
"zerocopy-derive",
]
[[package]]
name = "zerocopy-derive"
version = "0.8.53"
version = "0.8.54"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4714fd92cf900833d49538023a9b3915155210801d1c1169eba513b2addefd71"
checksum = "e2e817b7b52d0c7358d3246da9d69935ebb18116b2b102b4230dac079b4862f5"
dependencies = [
"proc-macro2",
"quote",
@@ -3006,7 +3016,7 @@ dependencies = [
"daemon",
"libredox",
"redox-scheme",
"redox_syscall 0.9.0+rb0.3.0",
"redox_syscall 0.9.0+rb0.3.1",
"scheme-utils",
]
+2 -1
View File
@@ -47,6 +47,7 @@ members = [
"drivers/input/ps2d",
"drivers/input/usbhidd",
"drivers/thermald",
"drivers/net/driver-network",
"drivers/net/e1000d",
@@ -152,4 +153,4 @@ libredox = { path = "../libredox" }
redox-scheme = { path = "../redox-scheme" }
[patch."https://gitlab.redox-os.org/redox-os/relibc.git"]
#redox-ioctl = { path = "../../relibc/source/redox-ioctl" }
redox-ioctl = { path = "../relibc/redox-ioctl" }
+8 -1
View File
@@ -48,7 +48,14 @@ fn daemon(daemon: SchemeDaemon) -> anyhow::Result<()> {
let pid = libredox::call::getpid()?;
let hw_file = Fd::open("/scheme/audiohw", flag::O_WRONLY | flag::O_CLOEXEC, 0)?;
let hw_file = match Fd::open("/scheme/audiohw", flag::O_WRONLY | flag::O_CLOEXEC, 0) {
Ok(fd) => fd,
Err(err) if err.errno() == syscall::ENODEV => {
eprintln!("audiod: no audio hardware detected");
return Ok(());
}
Err(err) => return Err(err).context("failed to open /scheme/audiohw"),
};
let socket = Socket::create().context("failed to create scheme")?;
+11 -5
View File
@@ -25,7 +25,7 @@ dependencies = [
"log",
"plain",
"redox-initfs",
"redox-path",
"redox-path 0.3.1",
"redox-rt",
"redox-scheme",
"redox_syscall",
@@ -76,7 +76,7 @@ checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
[[package]]
name = "libredox"
version = "0.1.18+rb0.3.0"
version = "0.1.18+rb0.3.1"
dependencies = [
"bitflags",
"libc",
@@ -145,6 +145,12 @@ version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "436d45c2b6a5b159d43da708e62b25be3a4a3d5550d654b72216ade4c4bfd717"
[[package]]
name = "redox-path"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54ec1b67c01c63545205ea6d218b336751399f0d8974c1a635c28604bedb81bc"
[[package]]
name = "redox-rt"
version = "0.1.0"
@@ -155,13 +161,13 @@ dependencies = [
"ioslice",
"libredox",
"plain",
"redox-path",
"redox-path 0.4.0",
"redox_syscall",
]
[[package]]
name = "redox-scheme"
version = "0.11.2+rb0.3.0"
version = "0.11.2+rb0.3.1"
dependencies = [
"libredox",
"redox_syscall",
@@ -169,7 +175,7 @@ dependencies = [
[[package]]
name = "redox_syscall"
version = "0.9.0+rb0.3.0"
version = "0.9.0+rb0.3.1"
dependencies = [
"bitflags",
]
+53 -39
View File
@@ -6,10 +6,11 @@ use core::str::FromStr;
use hashbrown::HashMap;
use redox_scheme::Socket;
use syscall::CallFlags;
use libredox::protocol::O_CLOEXEC;
use syscall::data::{GlobalSchemes, KernelSchemeInfo};
use syscall::flag::{O_CLOEXEC, O_RDONLY, O_STAT};
use syscall::{EINTR, Error};
use syscall::flag::{O_DIRECTORY, O_RDONLY, O_STAT};
use syscall::CallFlags;
use syscall::{Error, EINTR};
use redox_rt::proc::*;
@@ -26,7 +27,7 @@ impl log::Log for Logger {
let line = record.line().unwrap_or(0);
let level = record.level();
let msg = record.args();
let _ = libredox::call::write(
let _ = syscall::write(
1,
alloc::format!("[{file}:{line} {level}] {msg}\n").as_bytes(),
);
@@ -53,6 +54,8 @@ pub fn main() -> ! {
FdGuard::new(*(base_ptr as *const usize))
};
let cur_context_idx = scheme_creation_cap.as_raw_fd() + 1;
let mut kernel_schemes = KernelSchemeMap::new(kernel_scheme_infos);
let auth = kernel_schemes
@@ -60,8 +63,8 @@ pub fn main() -> ! {
.remove(&GlobalSchemes::Proc)
.expect("failed to get proc fd");
let this_thr_fd = auth
.dup(b"cur-context")
let this_thr_fd = syscall::dup_into(auth.as_raw_fd(), cur_context_idx, b"cur-context")
.map(FdGuard::new)
.expect("failed to open open_via_dup")
.to_upper()
.unwrap();
@@ -70,13 +73,13 @@ pub fn main() -> ! {
let mut env_bytes = [0_u8; 4096];
let mut envs = {
let fd = FdGuard::new(
libredox::call::openat(
redox_rt::sys::openat(
kernel_schemes
.get(GlobalSchemes::Sys)
.expect("failed to get sys fd")
.as_raw_fd(),
"env",
(O_RDONLY | O_CLOEXEC) as i32,
O_RDONLY | O_CLOEXEC,
0,
)
.expect("bootstrap: failed to open env"),
@@ -205,12 +208,16 @@ pub fn main() -> ! {
// from this point, this_thr_fd is no longer valid
const CWD: &[u8] = b"/scheme/initfs";
let cwd_fd = FdGuard::new(
libredox::call::openat(initns_fd.as_raw_fd(), "/scheme/initfs", O_STAT as i32, 0)
.expect("failed to open cwd fd"),
)
.to_upper()
.unwrap();
let initfs_root_fd = initns_fd
.openat_into_upper("/scheme/initfs", O_DIRECTORY, 0)
.expect("failed to open initfs root fd");
let cwd_fd = initfs_root_fd
.openat_into_upper("", O_STAT, 0)
.expect("failed to open cwd fd");
let filetable_binary_fd = init_thr_fd
.dup_into_upper(b"filetable-binary")
.expect("faild to create filetable-binary fd");
let extrainfo = ExtraInfo {
cwd: Some(CWD),
sigprocmask: 0,
@@ -220,18 +227,18 @@ pub fn main() -> ! {
proc_fd: init_proc_fd.as_raw_fd(),
ns_fd: Some(initns_fd.take()),
cwd_fd: Some(cwd_fd.as_raw_fd()),
filetable_fd: Some(filetable_binary_fd.as_raw_fd()),
same_process: true,
};
let path = "/scheme/initfs/bin/init";
let exe_path = "/scheme/initfs/bin/init";
let exe_reference = "bin/init";
let image_file = FdGuard::new(
libredox::call::openat(extrainfo.ns_fd.unwrap(), path, (O_RDONLY | O_CLOEXEC) as i32, 0)
.expect("failed to open init"),
)
.to_upper()
.unwrap();
let image_file = initfs_root_fd
.openat_into_upper(exe_reference, O_RDONLY | O_CLOEXEC, 0)
.expect("failed to open init");
let exe_path = alloc::format!("/scheme/initfs{}", path);
drop(initfs_root_fd);
let FexecResult::Interp {
path: interp_path,
@@ -246,26 +253,37 @@ pub fn main() -> ! {
&extrainfo,
None,
)
.map_err(|e| {
let _ = libredox::call::write(1, alloc::format!("fexec_impl failed: {}\n", e).as_bytes());
e
.unwrap_or_else(|e| {
panic!("fexec_impl error: {:?}", e);
})
.expect("failed to execute init");
.unwrap_or_else(|| panic!("fexec_impl returned None (no interpreter)"))
else {
panic!("fexec_impl returned unexpected variant");
};
// According to elf(5), PT_INTERP requires that the interpreter path be
// null-terminated. Violating this should therefore give the "format error" ENOEXEC.
let interp_cstr = CStr::from_bytes_with_nul(&interp_path).expect("interpreter not valid C str");
let interp_file = FdGuard::new(
libredox::call::openat(
let interp_path = interp_cstr.to_str().expect("interpreter not UTF-8");
let root_fd = FdGuard::new(
redox_rt::sys::openat_into_upper(
extrainfo.ns_fd.unwrap(), // initns, not initfs!
interp_cstr.to_str().expect("interpreter not UTF-8"),
(O_RDONLY | O_CLOEXEC) as i32,
interp_path,
O_RDONLY | O_CLOEXEC,
0,
)
.expect("failed to open dynamic linker"),
.expect("failed to open root fd"),
)
.to_upper()
.unwrap();
let redox_path = redox_path::RedoxPath::from_absolute(interp_path)
.expect("interpreter path is not a Scheme-rooted path");
let (_, reference) = redox_path
.as_parts()
.expect("redox_path is not scheme root path");
let interp_file = root_fd
.openat_into_upper(reference.as_ref(), O_RDONLY | O_CLOEXEC, 0)
.expect("failed to open dynamic linker");
fexec_impl(
interp_file,
@@ -292,13 +310,13 @@ pub(crate) fn spawn(
inner: impl FnOnce(FdGuard, Socket, FdGuard, KernelSchemeMap) -> !,
) -> (FdGuard, FdGuard, KernelSchemeMap, FdGuard) {
let read = FdGuard::new(
libredox::call::openat(
redox_rt::sys::openat(
kernel_schemes
.get(GlobalSchemes::Pipe)
.expect("failed to get pipe fd")
.as_raw_fd(),
"",
O_CLOEXEC as i32,
O_CLOEXEC,
0,
)
.expect("failed to open sync read pipe"),
@@ -306,7 +324,7 @@ pub(crate) fn spawn(
// The write pipe will not inherit O_CLOEXEC, but is closed by the daemon later.
let write = FdGuard::new(
libredox::call::dup(read.as_raw_fd(), b"write").expect("failed to open sync write pipe"),
redox_rt::sys::dup(read.as_raw_fd(), b"write").expect("failed to open sync write pipe"),
);
match fork_impl(&ForkArgs::Init {
@@ -318,15 +336,11 @@ pub(crate) fn spawn(
}
// Continue serving the scheme as the child.
Ok(0) => {
let _ = libredox::call::write(1, b"SP:0\n");
drop(read);
let _ = libredox::call::write(1, b"SP:1\n");
let socket = Socket::create_inner(scheme_creation_cap.as_raw_fd(), nonblock)
.expect("failed to open proc scheme socket");
let _ = libredox::call::write(1, b"SP:2\n");
drop(scheme_creation_cap);
let _ = libredox::call::write(1, b"SP:3\n");
inner(write, socket, auth, kernel_schemes)
}
@@ -342,7 +356,7 @@ pub(crate) fn spawn(
)
};
loop {
match syscall::call_ro(
match redox_rt::sys::sys_call_ro(
read.as_raw_fd(),
fd_bytes,
CallFlags::FD | CallFlags::FD_UPPER,
+1 -1
View File
@@ -123,7 +123,7 @@ impl SchemeSync for InitFsScheme {
) -> Result<OpenResult> {
if !matches!(
self.handles.get(&dirfd).ok_or(Error::new(EBADF))?,
Handle::SchemeRoot
Handle::SchemeRoot | Handle::Node(_)
) {
return Err(Error::new(EACCES));
}
+84 -30
View File
@@ -46,20 +46,20 @@ enum VirtualId {
}
pub fn run(write_fd: FdGuard, socket: Socket, auth: FdGuard, event: FdGuard) -> ! {
let _ = libredox::call::write(1, b"PM:0\n");
// TODO?
let socket_ident = socket.inner().raw();
let _ = libredox::call::write(1, b"PM:1\n");
redox_rt::proc::register_external_fd(socket.inner().raw())
.expect("failed to register socket fd with userspace filetable");
let queue = RawEventQueue::new(event.as_raw_fd()).expect("failed to create event queue");
let _ = libredox::call::write(1, b"PM:2\n");
redox_rt::proc::register_external_fd(queue.0.as_raw_fd())
.expect("failed to register event queue fd with userspace filetable");
drop(event);
let _ = libredox::call::write(1, b"PM:3\n");
queue
.subscribe(socket.inner().raw(), socket_ident, EventFlags::EVENT_READ)
.expect("failed to listen to scheme socket events");
let _ = libredox::call::write(1, b"PM:4\n");
let mut scheme = ProcScheme::new(auth, &queue);
@@ -68,7 +68,6 @@ pub fn run(write_fd: FdGuard, socket: Socket, auth: FdGuard, event: FdGuard) ->
let cap_fd = socket
.create_this_scheme_fd(0, new_id, 0, 0)
.expect("failed to issue procmgr root fd");
let _ = libredox::call::write(1, b"PM:5\n");
log::debug!("process manager started");
let _ = syscall::call_wo(
@@ -543,6 +542,20 @@ enum Handle {
SchemeRoot,
}
// Red Bear diagnostic (2026-07-15): name a Handle variant for the boot-crash
// trace. randd's thr_fd resolves to procmgr (scheme 18) handle #8, which
// on_dup rejects with EBADF; this shows what kind #8 actually is.
fn handle_kind_str(h: &Handle) -> &'static str {
match h {
Handle::Init => "Init",
Handle::Proc(_) => "Proc",
Handle::Thread(_) => "Thread",
Handle::Ps(_) => "Ps",
Handle::ProcCredsCapability => "ProcCredsCapability",
Handle::SchemeRoot => "SchemeRoot",
}
}
#[derive(Clone, Copy, Debug)]
enum WaitpidTarget {
SingleProc(ProcessId),
@@ -617,12 +630,18 @@ impl<'a> ProcScheme<'a> {
let fd = FdGuard::new(fd_out);
// TODO: Use global thread id etc. rather than reusing fd for identifier?
self.queue
if let Err(e) = self
.queue
.subscribe(fd_out, fd_out, EventFlags::EVENT_READ)
.expect("TODO");
let status_hndl = fd
{
return Response::new(Err(e), req);
}
let status_hndl = match fd
.dup(alloc::format!("auth-{}-status", self.auth.as_raw_fd()).as_bytes())
.expect("TODO");
{
Ok(h) => h,
Err(e) => return Response::new(Err(e), req),
};
let thread = Rc::new(RefCell::new(Thread {
fd,
@@ -697,8 +716,7 @@ impl<'a> ProcScheme<'a> {
let thread_ident = new_ctxt_fd.as_raw_fd();
self.queue
.subscribe(thread_ident, thread_ident, EventFlags::EVENT_READ)
.expect("TODO");
.subscribe(thread_ident, thread_ident, EventFlags::EVENT_READ)?;
let thread = Rc::new(RefCell::new(Thread {
fd: new_ctxt_fd,
@@ -773,8 +791,7 @@ impl<'a> ProcScheme<'a> {
let ident = ctxt_fd.as_raw_fd();
self.queue
.subscribe(ident, ident, EventFlags::EVENT_READ)
.expect("TODO");
.subscribe(ident, ident, EventFlags::EVENT_READ)?;
let thread = Rc::new(RefCell::new(Thread {
fd: ctxt_fd,
@@ -873,20 +890,45 @@ impl<'a> ProcScheme<'a> {
}
fn on_dup(&mut self, old_id: usize, buf: &[u8]) -> Result<OpenResult> {
log::trace!("Dup request");
{
let kind = self.handles.get(old_id).map(handle_kind_str);
let _ = syscall::write(
1,
alloc::format!(
"PROCMGR on_dup id={} kind={:?} buf={:?}\n",
old_id,
kind,
core::str::from_utf8(buf).unwrap_or("<bin>")
)
.as_bytes(),
);
}
match self.handles[old_id] {
Handle::Proc(pid) => match buf {
b"fork" => {
log::trace!("Forking {pid:?}");
let child_pid = self.fork(pid)?;
let number = self.handles.insert(Handle::Proc(child_pid));
let _ = syscall::write(
1,
alloc::format!("PROCMGR fork pid={:?} -> Proc handle={}\n", child_pid, number)
.as_bytes(),
);
Ok(OpenResult::ThisScheme {
number: self.handles.insert(Handle::Proc(child_pid)),
number,
flags: NewFdFlags::empty(),
})
}
b"new-thread" => {
let thread = self.new_thread(pid)?;
let number = self.handles.insert(Handle::Thread(Rc::downgrade(&thread)));
let _ = syscall::write(
1,
alloc::format!("PROCMGR new-thread pid={:?} -> Thread handle={}\n", pid, number)
.as_bytes(),
);
Ok(OpenResult::ThisScheme {
number: self.handles.insert(Handle::Thread(Rc::downgrade(&thread))),
number,
flags: NewFdFlags::empty(),
})
}
@@ -897,9 +939,18 @@ impl<'a> ProcScheme<'a> {
.ok_or(Error::new(EINVAL))?;
let process = self.processes.get(&pid).ok_or(Error::new(EBADFD))?.borrow();
let thread = Rc::downgrade(process.threads.get(idx).ok_or(Error::new(ENOENT))?);
let number = self.handles.insert(Handle::Thread(thread));
let _ = syscall::write(
1,
alloc::format!(
"PROCMGR thread-{} pid={:?} -> Thread handle={}\n",
idx, pid, number
)
.as_bytes(),
);
return Ok(OpenResult::ThisScheme {
number: self.handles.insert(Handle::Thread(thread)),
number,
flags: NewFdFlags::empty(),
});
}
@@ -1708,7 +1759,9 @@ impl<'a> ProcScheme<'a> {
false, // stop_or_continue
awoken,
) {
log::error!("failed to send SIGCHLD to parent PID {ppid:?}: {err}");
// EPERM on SIGCHLD to PID 1 is a known kernel limitation.
// The procmgr continues correctly after this; downgrade to debug.
log::debug!("failed to send SIGCHLD to parent PID {ppid:?}: {err}");
}
if let Some(init_rc) = self.processes.get(&INIT_PID) {
@@ -2107,10 +2160,9 @@ impl<'a> ProcScheme<'a> {
Ordering::Relaxed,
);
}
thread
let _ = thread
.status_hndl
.write(&(ContextVerb::Unstop as usize).to_ne_bytes())
.expect("TODO");
.write(&(ContextVerb::Unstop as usize).to_ne_bytes());
}
// POSIX XSI allows but does not reqiure SIGCHLD to be sent when SIGCONT occurs.
return SendResult::SucceededSigcont {
@@ -2185,10 +2237,9 @@ impl<'a> ProcScheme<'a> {
if sig == SIGKILL {
for thread in &target_proc.threads {
let thread = thread.borrow();
thread
let _ = thread
.status_hndl
.write(&(ContextVerb::ForceKill as usize).to_ne_bytes())
.expect("TODO");
.write(&(ContextVerb::ForceKill as usize).to_ne_bytes());
}
*killed_self |= is_self;
@@ -2211,10 +2262,9 @@ impl<'a> ProcScheme<'a> {
let _was_new = tctl.word[sig_group].fetch_or(bit, Ordering::Release);
if (tctl.word[sig_group].load(Ordering::Relaxed) >> 32) & bit != 0 {
*killed_self |= is_self;
thread
let _ = thread
.status_hndl
.write(&(ContextVerb::Interrupt as usize).to_ne_bytes())
.expect("TODO");
.write(&(ContextVerb::Interrupt as usize).to_ne_bytes());
}
}
KillTarget::Proc(proc) => {
@@ -2271,10 +2321,9 @@ impl<'a> ProcScheme<'a> {
if (tctl.word[sig_group].load(Ordering::Relaxed) >> 32) & (1 << sig_idx)
!= 0
{
thread
let _ = thread
.status_hndl
.write(&(ContextVerb::Interrupt as usize).to_ne_bytes())
.expect("TODO");
.write(&(ContextVerb::Interrupt as usize).to_ne_bytes());
*killed_self |= is_self;
break;
}
@@ -2468,6 +2517,11 @@ impl<'a> ProcScheme<'a> {
Ok(())
}
fn on_close(&mut self, id: usize) {
let kind = self.handles.get(id).map(handle_kind_str);
let _ = syscall::write(
1,
alloc::format!("PROCMGR on_close id={} kind={:?}\n", id, kind).as_bytes(),
);
if self.handles.try_remove(id).is_none() {
log::error!("on_close for nonexistent handle, id={id}");
}
+3 -18
View File
@@ -35,10 +35,6 @@ mod offsets {
}
}
fn dbg(msg: &[u8]) {
let _ = libredox::call::write(1, msg);
}
#[unsafe(no_mangle)]
pub unsafe extern "C" fn start() -> ! {
let (text_start, text_end) = offsets::text();
@@ -46,18 +42,14 @@ pub unsafe extern "C" fn start() -> ! {
let (data_start, data_end) = offsets::data_and_bss();
let debug_fd = syscall::UPPER_FDTBL_TAG + syscall::data::GlobalSchemes::Debug as usize;
let _ = libredox::call::openat(debug_fd, "", syscall::O_RDONLY as i32, 0);
let _ = libredox::call::openat(debug_fd, "", syscall::O_WRONLY as i32, 0);
let _ = libredox::call::openat(debug_fd, "", syscall::O_WRONLY as i32, 0);
dbg(b"BS:0\n");
let _ = syscall::openat_into(debug_fd, 0, "", syscall::O_RDONLY, 0);
let _ = syscall::openat_into(debug_fd, 1, "", syscall::O_WRONLY, 0);
let _ = syscall::openat_into(debug_fd, 2, "", syscall::O_WRONLY, 0);
unsafe {
let _ = syscall::mprotect(4096, 4096, MapFlags::PROT_READ | MapFlags::MAP_PRIVATE)
.expect("mprotect failed for initfs header page");
dbg(b"BS:1\n");
let _ = syscall::mprotect(
text_start,
text_end - text_start,
@@ -65,8 +57,6 @@ pub unsafe extern "C" fn start() -> ! {
)
.expect("mprotect failed for .text");
dbg(b"BS:2\n");
let _ = syscall::mprotect(
rodata_start,
rodata_end - rodata_start,
@@ -74,8 +64,6 @@ pub unsafe extern "C" fn start() -> ! {
)
.expect("mprotect failed for .rodata");
dbg(b"BS:3\n");
let _ = syscall::mprotect(
data_start,
data_end - data_start,
@@ -83,8 +71,6 @@ pub unsafe extern "C" fn start() -> ! {
)
.expect("mprotect failed for .data/.bss");
dbg(b"BS:4\n");
let _ = syscall::mprotect(
data_end,
crate::arch::STACK_START - data_end,
@@ -93,6 +79,5 @@ pub unsafe extern "C" fn start() -> ! {
.expect("mprotect failed for rest of memory");
}
dbg(b"BS:5\n");
crate::exec::main();
}
+11 -3
View File
@@ -106,12 +106,20 @@ impl SchemeDaemon {
/// Notify the process that the scheme daemon is ready to accept requests.
pub fn ready_with_fd(self, cap_fd: Fd) -> syscall::Result<()> {
syscall::call_wo(
let raw_fd = cap_fd.into_raw();
eprintln!(
"daemon: ready_with_fd write_pipe={} cap_fd={}",
self.write_pipe.as_raw_fd(),
raw_fd
);
let res = syscall::call_wo(
self.write_pipe.as_raw_fd() as usize,
&cap_fd.into_raw().to_ne_bytes(),
&raw_fd.to_ne_bytes(),
syscall::CallFlags::FD,
&[],
)?;
);
eprintln!("daemon: ready_with_fd call_wo result={:?}", res);
res?;
Ok(())
}
+140 -1
View File
@@ -286,7 +286,11 @@ impl AmlSymbols {
match self.init(pci_fd) {
Ok(()) => (),
Err(err) => {
log::error!("failed to initialize AML context: {}", err);
if pci_fd.is_none() {
log::debug!("AML init deferred until PCI registration: {}", err);
} else {
log::error!("failed to initialize AML context: {}", err);
}
}
}
}
@@ -442,6 +446,62 @@ impl AcpiContext {
.flatten()
}
pub fn evaluate_acpi_method(
&mut self,
path: &str,
method: &str,
args: &[u64],
) -> Result<Vec<u64>, AmlEvalError> {
let full_path = format!("{path}.{method}");
let aml_name = AmlName::from_str(&full_path).map_err(|_| AmlEvalError::DeserializationError)?;
let args = args
.iter()
.copied()
.map(AmlSerdeValue::Integer)
.collect::<Vec<_>>();
match self.aml_eval(aml_name, args)? {
AmlSerdeValue::Integer(value) => Ok(vec![value]),
AmlSerdeValue::Package { contents } => contents
.into_iter()
.map(|value| match value {
AmlSerdeValue::Integer(value) => Ok(value),
_ => Err(AmlEvalError::DeserializationError),
})
.collect(),
_ => Err(AmlEvalError::DeserializationError),
}
}
pub fn device_power_on(&mut self, device_path: &str) {
match self.evaluate_acpi_method(device_path, "_PS0", &[]) {
Ok(values) => {
log::debug!("{}._PS0 => {:?}", device_path, values);
}
Err(error) => {
log::warn!("Failed to power on {} with _PS0: {:?}", device_path, error);
}
}
}
pub fn device_power_off(&mut self, device_path: &str) {
match self.evaluate_acpi_method(device_path, "_PS3", &[]) {
Ok(values) => {
log::debug!("{}._PS3 => {:?}", device_path, values);
}
Err(error) => {
log::warn!("Failed to power off {} with _PS3: {:?}", device_path, error);
}
}
}
pub fn device_get_performance(&mut self, device_path: &str) -> Result<u64, AmlEvalError> {
self.evaluate_acpi_method(device_path, "_PPC", &[])?
.into_iter()
.next()
.ok_or(AmlEvalError::DeserializationError)
}
pub fn init(
rxsdt_physaddrs: impl Iterator<Item = u64>,
ec: Vec<(RegionSpace, Box<dyn RegionHandler>)>,
@@ -1247,6 +1307,85 @@ impl AcpiContext {
Err(e) => Err(AmlEvalError::from(e)),
}
}
/// Suspend-to-RAM (S3 sleep state)
/// See ACPI 6.1 spec for SLP_TYPa/SLP_TYPb encoding
pub fn suspend_to_ram(&self) {
log::info!("ACPI: attempting suspend-to-RAM (S3)");
let fadt = match self.fadt.as_ref() {
Some(f) => f,
None => { log::error!("ACPI S3: missing FADT"); return; }
};
let pm1a = fadt.pm1a_control_block as u16;
if pm1a == 0 {
log::error!("ACPI S3: PM1a port is zero");
return;
}
let aml_symbols = self.aml_symbols.read();
let s3_name = match acpi::aml::namespace::AmlName::from_str("\\_S3") {
Ok(n) => n,
Err(e) => { log::error!("ACPI S3: \\_S3 name error: {:?}", e); return; }
};
let s3 = match &aml_symbols.aml_context {
Some(ctx) => match ctx.namespace.lock().get(s3_name) {
Ok(s) => s,
Err(e) => { log::error!("ACPI S3: \\_S3 not found: {:?}", e); return; }
},
None => { log::error!("ACPI S3: AML context missing"); return; }
};
use std::ops::Deref;
let pkg = match s3.deref() {
acpi::aml::object::Object::Package(p) => p,
_ => { log::error!("ACPI S3: \\_S3 not a package"); return; }
};
let slp_typa = match pkg[0].deref() {
acpi::aml::object::Object::Integer(i) => *i as u16,
_ => { log::error!("ACPI S3: SLP_TYPa not integer"); return; }
};
let val = (1u16 << 13) | (slp_typa & 0x1FFF);
log::info!("ACPI S3: writing PM1a=0x{:04X} val=0x{:04X}", pm1a, val);
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
{ Pio::<u16>::new(pm1a).write(val); }
}
/// Query ACPI battery via \\_SB_.BAT0._BST
/// Returns (remaining_capacity_mAh, present_voltage_mV) if available
pub fn read_battery_status(&self) -> Option<(u32, u32)> {
let aml_symbols = self.aml_symbols.read();
let ctx = aml_symbols.aml_context.as_ref()?;
let mut ns = ctx.namespace.lock();
let bst_name = acpi::aml::namespace::AmlName::from_str("\\_SB_.BAT0._BST").ok()?;
let bst = ns.get(bst_name).ok()?;
use std::ops::Deref;
match bst.deref() {
acpi::aml::object::Object::Package(p) if p.len() >= 4 => {
let cap = match p[1].deref() { acpi::aml::object::Object::Integer(i) => *i as u32, _ => return None };
let volt = match p[2].deref() { acpi::aml::object::Object::Integer(i) => *i as u32, _ => return None };
Some((cap, volt))
}
_ => { log::warn!("ACPI: _BST not a valid battery package"); None }
}
}
/// Query ACPI battery info via \\_SB_.BAT0._BIF
/// Returns (design_capacity_mAh, last_full_capacity_mAh, design_voltage_mV) if available
pub fn read_battery_info(&self) -> Option<(u32, u32, u32)> {
let aml_symbols = self.aml_symbols.read();
let ctx = aml_symbols.aml_context.as_ref()?;
let mut ns = ctx.namespace.lock();
let bif_name = acpi::aml::namespace::AmlName::from_str("\\_SB_.BAT0._BIF").ok()?;
let bif = ns.get(bif_name).ok()?;
use std::ops::Deref;
match bif.deref() {
acpi::aml::object::Object::Package(p) if p.len() >= 13 => {
let design = match p[1].deref() { acpi::aml::object::Object::Integer(i) => *i as u32, _ => return None };
let last = match p[2].deref() { acpi::aml::object::Object::Integer(i) => *i as u32, _ => return None };
let volt = match p[4].deref() { acpi::aml::object::Object::Integer(i) => *i as u32, _ => return None };
Some((design, last, volt))
}
_ => { log::warn!("ACPI: _BIF not a valid battery package"); None }
}
}
}
fn power_object_path(name: &str, method: &str) -> String {
+7 -3
View File
@@ -503,10 +503,14 @@ impl<'sdt> Iterator for DmarRawIter<'sdt> {
let len_bytes = <[u8; 2]>::try_from(type_bytes)
.expect("expected a 2-byte slice to be convertible to [u8; 2]");
let ty = u16::from_ne_bytes(type_bytes);
let len = u16::from_ne_bytes(len_bytes);
let len = u16::from_ne_bytes(len_bytes) as usize;
if len < 4 {
return None;
}
let ty = u16::from_ne_bytes(type_bytes);
let len = usize::try_from(len).expect("expected u16 to fit within usize");
if len > remainder.len() {
log::warn!("DMAR remapping structure length was smaller than the remaining length of the table.");
+101 -25
View File
@@ -3,6 +3,7 @@ use std::os::unix::io::AsRawFd;
use std::usize;
use event::{user_data, EventQueue};
use log::error;
use pcid_interface::PciFunctionHandle;
use redox_scheme::scheme::register_sync_scheme;
use redox_scheme::Socket;
@@ -22,13 +23,28 @@ fn daemon(daemon: daemon::Daemon, pcid_handle: PciFunctionHandle) -> ! {
let mut name = pci_config.func.name();
name.push_str("_ac97");
let bar0 = pci_config.func.bars[0].expect_port();
let bar1 = pci_config.func.bars[1].expect_port();
let bar0 = match pci_config.func.bars[0].try_port() {
Ok(port) => port,
Err(err) => {
error!("ac97d: invalid BAR0: {err}");
std::process::exit(1);
}
};
let bar1 = match pci_config.func.bars[1].try_port() {
Ok(port) => port,
Err(err) => {
error!("ac97d: invalid BAR1: {err}");
std::process::exit(1);
}
};
let irq = pci_config
.func
.legacy_interrupt_line
.expect("ac97d: no legacy interrupts supported");
.unwrap_or_else(|| {
error!("ac97d: no legacy interrupts supported");
std::process::exit(1);
});
println!(" + ac97 {}", pci_config.func.display());
@@ -40,13 +56,35 @@ fn daemon(daemon: daemon::Daemon, pcid_handle: PciFunctionHandle) -> ! {
common::file_level(),
);
common::acquire_port_io_rights().expect("ac97d: failed to set I/O privilege level to Ring 3");
if let Err(err) = common::acquire_port_io_rights() {
error!("ac97d: failed to set I/O privilege level to Ring 3: {err}");
std::process::exit(1);
}
let mut irq_file = irq.irq_handle("ac97d");
let mut irq_file = match irq.try_irq_handle("ac97d") {
Ok(file) => file,
Err(err) => {
error!("ac97d: failed to open IRQ handle: {err}");
std::process::exit(1);
}
};
let socket = Socket::nonblock().expect("ac97d: failed to create socket");
let mut device =
unsafe { device::Ac97::new(bar0, bar1).expect("ac97d: failed to allocate device") };
let socket = match Socket::nonblock() {
Ok(socket) => socket,
Err(err) => {
error!("ac97d: failed to create socket: {err}");
std::process::exit(1);
}
};
let mut device = unsafe {
match device::Ac97::new(bar0, bar1) {
Ok(device) => device,
Err(err) => {
error!("ac97d: failed to allocate device: {err}");
std::process::exit(1);
}
}
};
let mut readiness_based = ReadinessBased::new(&socket, 16);
user_data! {
@@ -56,49 +94,81 @@ fn daemon(daemon: daemon::Daemon, pcid_handle: PciFunctionHandle) -> ! {
}
}
let event_queue = EventQueue::<Source>::new().expect("ac97d: Could not create event queue.");
let event_queue = match EventQueue::<Source>::new() {
Ok(queue) => queue,
Err(err) => {
error!("ac97d: could not create event queue: {err}");
std::process::exit(1);
}
};
event_queue
.subscribe(
irq_file.as_raw_fd() as usize,
Source::Irq,
event::EventFlags::READ,
)
.unwrap();
.unwrap_or_else(|err| {
error!("ac97d: failed to subscribe IRQ fd: {err}");
std::process::exit(1);
});
event_queue
.subscribe(
socket.inner().raw(),
Source::Scheme,
event::EventFlags::READ,
)
.unwrap();
.unwrap_or_else(|err| {
error!("ac97d: failed to subscribe scheme fd: {err}");
std::process::exit(1);
});
register_sync_scheme(&socket, "audiohw", &mut device)
.expect("ac97d: failed to register audiohw scheme to namespace");
register_sync_scheme(&socket, "audiohw", &mut device).unwrap_or_else(|err| {
error!("ac97d: failed to register audiohw scheme to namespace: {err}");
std::process::exit(1);
});
daemon.ready();
libredox::call::setrens(0, 0).expect("ac97d: failed to enter null namespace");
if let Err(err) = libredox::call::setrens(0, 0) {
error!("ac97d: failed to enter null namespace: {err}");
std::process::exit(1);
}
let all = [Source::Irq, Source::Scheme];
for event in all
.into_iter()
.chain(event_queue.map(|e| e.expect("ac97d: failed to get next event").user_data))
{
for event in all.into_iter().chain(event_queue.map(|e| match e {
Ok(event) => event.user_data,
Err(err) => {
error!("ac97d: failed to get next event: {err}");
std::process::exit(1);
}
})) {
match event {
Source::Irq => {
let mut irq = [0; 8];
irq_file.read(&mut irq).unwrap();
if let Err(err) = irq_file.read(&mut irq) {
error!("ac97d: failed to read IRQ file: {err}");
std::process::exit(1);
}
if !device.irq() {
continue;
}
irq_file.write(&mut irq).unwrap();
if let Err(err) = irq_file.write(&mut irq) {
error!("ac97d: failed to acknowledge IRQ: {err}");
std::process::exit(1);
}
readiness_based
.poll_all_requests(&mut device)
.expect("ac97d: failed to poll requests");
.unwrap_or_else(|err| {
error!("ac97d: failed to poll requests: {err}");
std::process::exit(1);
});
readiness_based
.write_responses()
.expect("ac97d: failed to write to socket");
.unwrap_or_else(|err| {
error!("ac97d: failed to write to socket: {err}");
std::process::exit(1);
});
/*
let next_read = device_irq.next_read();
@@ -110,10 +180,16 @@ fn daemon(daemon: daemon::Daemon, pcid_handle: PciFunctionHandle) -> ! {
Source::Scheme => {
readiness_based
.read_and_process_requests(&mut device)
.expect("ac97d: failed to read from socket");
.unwrap_or_else(|err| {
error!("ac97d: failed to read from socket: {err}");
std::process::exit(1);
});
readiness_based
.write_responses()
.expect("ac97d: failed to write to socket");
.unwrap_or_else(|err| {
error!("ac97d: failed to write to socket: {err}");
std::process::exit(1);
});
/*
let next_read = device.borrow().next_read();
@@ -125,7 +201,7 @@ fn daemon(daemon: daemon::Daemon, pcid_handle: PciFunctionHandle) -> ! {
}
}
std::process::exit(0);
std::process::exit(1);
}
#[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
+33 -6
View File
@@ -6,7 +6,7 @@ use std::os::unix::io::AsRawFd;
use std::usize;
use event::{user_data, EventQueue};
use pcid_interface::irq_helpers::pci_allocate_interrupt_vector;
use pcid_interface::irq_helpers::try_pci_allocate_interrupt_vector;
use pcid_interface::PciFunctionHandle;
pub mod hda;
@@ -38,9 +38,19 @@ fn daemon(daemon: daemon::Daemon, mut pcid_handle: PciFunctionHandle) -> ! {
log::info!("IHDA {}", pci_config.func.display());
if let Err(err) = pci_config.func.bars[0].try_mem() {
log::error!("ihdad: invalid BAR0: {err}");
std::process::exit(1);
}
let address = unsafe { pcid_handle.map_bar(0) }.ptr.as_ptr() as usize;
let irq_file = pci_allocate_interrupt_vector(&mut pcid_handle, "ihdad");
let irq_file = match try_pci_allocate_interrupt_vector(&mut pcid_handle, "ihdad") {
Ok(irq) => irq,
Err(err) => {
log::error!("ihdad: failed to allocate interrupt vector: {err}");
std::process::exit(1);
}
};
{
let vend_prod: u32 = ((pci_config.func.full_device_id.vendor_id as u32) << 16)
@@ -53,11 +63,28 @@ fn daemon(daemon: daemon::Daemon, mut pcid_handle: PciFunctionHandle) -> ! {
}
}
let event_queue =
EventQueue::<Source>::new().expect("ihdad: Could not create event queue.");
let socket = Socket::nonblock().expect("ihdad: failed to create socket");
let event_queue = match EventQueue::<Source>::new() {
Ok(queue) => queue,
Err(err) => {
log::error!("ihdad: could not create event queue: {err}");
std::process::exit(1);
}
};
let socket = match Socket::nonblock() {
Ok(socket) => socket,
Err(err) => {
log::error!("ihdad: failed to create socket: {err}");
std::process::exit(1);
}
};
let mut device = unsafe {
hda::IntelHDA::new(address, vend_prod).expect("ihdad: failed to allocate device")
match hda::IntelHDA::new(address, vend_prod) {
Ok(device) => device,
Err(err) => {
log::error!("ihdad: failed to allocate device: {err}");
std::process::exit(1);
}
}
};
let mut readiness_based = ReadinessBased::new(&socket, 16);
+2
View File
@@ -44,6 +44,7 @@ pub fn setup_logging(
Ok(b) => {
logger = logger.with_output(b.with_filter(file_level).flush_on_newline(true).build())
}
Err(error) if error.raw_os_error() == Some(19) => {}
Err(error) => eprintln!("Failed to create {logfile_base}.log: {}", error),
}
@@ -61,6 +62,7 @@ pub fn setup_logging(
.build(),
)
}
Err(error) if error.raw_os_error() == Some(19) => {}
Err(error) => eprintln!("Failed to create {logfile_base}.ansi.log: {}", error),
}
+21
View File
@@ -51,5 +51,26 @@ ids = { 0x8086 = [
0x56B3, # Pro A60
0x56C0, # GPU Flex 170
0x56C1, # GPU Flex 140
# Alder Lake-S Desktop
0x4680, 0x4682, 0x4688, 0x468A, 0x468B,
0x4690, 0x4692, 0x4693,
# Alder Lake-P Mobile
0x46A0, 0x46A1, 0x46A2, 0x46A3, 0x46A6,
0x46A8, 0x46AA, 0x462A, 0x4626, 0x4628,
0x46B0, 0x46B1, 0x46B2, 0x46B3,
0x46C0, 0x46C1, 0x46C2, 0x46C3,
# Alder Lake-N Low-Power
0x46D0, 0x46D1, 0x46D2, 0x46D3, 0x46D4,
# Raptor Lake-S Desktop
0xA780, 0xA781, 0xA782, 0xA783,
0xA788, 0xA789, 0xA78A, 0xA78B,
# Raptor Lake-P Mobile
0xA720, 0xA7A0, 0xA7A8, 0xA7AA, 0xA7AB,
# Raptor Lake-U Mobile
0xA721, 0xA7A1, 0xA7A9, 0xA7AC, 0xA7AD,
# Meteor Lake
0x7D40, 0x7D45, 0x7D55, 0x7D60, 0x7DD5,
# Arrow Lake-H
0x7D51, 0x7DD1,
] }
command = ["ihdgd"]
-3
View File
@@ -37,9 +37,6 @@ fn daemon(daemon: daemon::Daemon) -> ! {
//TODO: launch pcid based on backend information?
// Must launch after acpid but before probe calls /scheme/acpi/symbols
#[allow(deprecated, reason = "we can't yet move this to init")]
daemon::Daemon::spawn(process::Command::new("pcid"));
daemon.ready();
//TODO: HWD is meant to locate PCI/XHCI/etc devices in ACPI and DeviceTree definitions and start their drivers
+3 -6
View File
@@ -29,9 +29,6 @@ vendor = 0x1AF4
device = 0x1001
command = ["/scheme/initfs/lib/drivers/virtio-blkd"]
[[drivers]]
name = "virtio-gpu"
class = 3
vendor = 0x1AF4
device = 0x1050
command = ["/scheme/initfs/lib/drivers/virtio-gpud"]
# Red Bear full-image graphics hands display-class GPUs to the root filesystem
# DRM/KMS stack. Do not claim QEMU virtio-gpu in initfs, or the later root
# pcid-spawner cannot pass the PCI function to /usr/bin/redox-drm.
+164 -29
View File
@@ -97,6 +97,14 @@ enum KeyboardCommandData {
const DEFAULT_TIMEOUT: u64 = 50_000;
// Reset timeout in microseconds
const RESET_TIMEOUT: u64 = 1_000_000;
// Maximum bytes to drain during flush (Linux: I8042_BUFFER_SIZE)
const FLUSH_LIMIT: usize = 4096;
// Controller self-test pass value (Linux: I8042_RET_CTL_TEST)
const SELFTEST_PASS: u8 = 0x55;
// Controller self-test retries (Linux: 5 attempts)
const SELFTEST_RETRIES: usize = 5;
// AUX port test pass value (Linux returns 0x00 on success)
const AUX_TEST_PASS: u8 = 0x00;
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub struct Ps2 {
@@ -263,6 +271,30 @@ impl Ps2 {
self.write(command as u8)
}
pub fn set_leds(&mut self, caps: bool, num: bool, scroll: bool) {
let mut led_byte = 0u8;
if scroll { led_byte |= 1; }
if num { led_byte |= 2; }
if caps { led_byte |= 4; }
if let Err(err) = self.keyboard_command_inner(0xED) {
log::debug!("ps2d: LED command 0xED not supported: {:?}", err);
return;
}
match self.read_timeout(DEFAULT_TIMEOUT) {
Ok(0xFA) => {
if let Err(err) = self.write(led_byte) {
log::debug!("ps2d: failed to send LED byte {:02X}: {:?}", led_byte, err);
}
}
Ok(val) => {
log::debug!("ps2d: LED command ACK expected 0xFA, got {:02X}", val);
}
Err(err) => {
log::debug!("ps2d: LED command ACK timeout: {:?}", err);
}
}
}
pub fn next(&mut self) -> Option<(bool, u8)> {
let status = self.status();
if status.contains(StatusFlags::OUTPUT_FULL) {
@@ -273,6 +305,50 @@ impl Ps2 {
}
}
/// Drain all pending bytes from the controller output buffer.
/// Borrowed from Linux i8042_flush(): stale firmware/BIOS bytes can be
/// misinterpreted as device responses during initialization.
fn flush(&mut self) -> usize {
let mut count = 0;
while self.status().contains(StatusFlags::OUTPUT_FULL) {
if count >= FLUSH_LIMIT {
warn!("flush: exceeded limit, controller may be stuck");
break;
}
let data = self.data.read();
trace!("flush: discarded {:02X}", data);
count += 1;
}
if count > 0 {
debug!("flushed {} stale bytes from controller", count);
}
count
}
/// Test the AUX (mouse) port via controller command 0xA9.
/// Borrowed from Linux: verifies electrical connectivity before
/// attempting to talk to the mouse. Returns true if the port passed.
fn test_aux_port(&mut self) -> bool {
if let Err(err) = self.command(Command::TestSecond) {
warn!("aux port test command failed: {:?}", err);
return false;
}
match self.read() {
Ok(AUX_TEST_PASS) => {
debug!("aux port test passed");
true
}
Ok(val) => {
warn!("aux port test failed: {:02X}", val);
false
}
Err(err) => {
warn!("aux port test read timeout: {:?}", err);
false
}
}
}
pub fn init_keyboard(&mut self) -> Result<(), Error> {
let mut b;
@@ -310,66 +386,125 @@ impl Ps2 {
}
pub fn init(&mut self) -> Result<(), Error> {
// Linux i8042_controller_check(): verify controller is present by
// flushing any stale data. A stuck output buffer means no controller.
self.flush();
// Bare-metal controllers may be slow after firmware handoff.
// Give the controller a moment to finish POST before sending commands.
std::thread::sleep(std::time::Duration::from_millis(50));
{
// Disable devices
self.command(Command::DisableFirst)?;
self.command(Command::DisableSecond)?;
// Disable both ports first — use retry because the controller
// may still be settling or temporarily unresponsive.
// Failure here is non-fatal: we continue and attempt the rest
// of initialization. A truly absent controller will fail later
// at self-test or keyboard reset.
if let Err(err) = self.retry(
format_args!("disable first port"),
3,
|x| x.command(Command::DisableFirst),
) {
warn!("disable first port failed: {:?}", err);
}
if let Err(err) = self.retry(
format_args!("disable second port"),
3,
|x| x.command(Command::DisableSecond),
) {
warn!("disable second port failed: {:?}", err);
}
}
// Disable clocks, disable interrupts, and disable translate
// Flush again after disabling — firmware may have queued more bytes
self.flush();
// Linux i8042_controller_init() step 1: write a known-safe config
// (interrupts off, both ports disabled) so stale config can't cause
// spurious interrupts during the rest of init.
{
// Since the default config may have interrupts enabled, and the kernel may eat up
// our data in that case, we will write a config without reading the current one
let config = ConfigFlags::POST_PASSED
| ConfigFlags::FIRST_DISABLED
| ConfigFlags::SECOND_DISABLED;
self.set_config(config)?;
}
// The keyboard seems to still collect bytes even when we disable
// the port, so we must disable the keyboard too
// Linux i8042_controller_selftest(): retry up to 5 times with delay.
// "On some really fragile systems this does not take the first time."
{
let mut passed = false;
for attempt in 0..SELFTEST_RETRIES {
if let Err(err) = self.command(Command::TestController) {
warn!("self-test command failed (attempt {}): {:?}", attempt + 1, err);
continue;
}
match self.read() {
Ok(SELFTEST_PASS) => {
passed = true;
break;
}
Ok(val) => {
warn!(
"self-test unexpected value {:02X} (attempt {}/{})",
val,
attempt + 1,
SELFTEST_RETRIES
);
}
Err(err) => {
warn!("self-test read timeout (attempt {}): {:?}", attempt + 1, err);
}
}
// Linux: msleep(50) between retries
std::thread::sleep(std::time::Duration::from_millis(50));
}
if !passed {
// Linux on x86: "giving up on controller selftest, continuing anyway"
warn!("controller self-test did not pass after {} attempts, continuing", SELFTEST_RETRIES);
}
}
// Flush any bytes the self-test may have left behind
self.flush();
// Linux i8042_controller_init() step 2: set keyboard defaults
// (disable scanning so keyboard doesn't send scancodes during init)
self.retry(format_args!("keyboard defaults"), 4, |x| {
// Set defaults and disable scanning
let b = x.keyboard_command(KeyboardCommand::SetDefaultsDisable)?;
if b != 0xFA {
error!("keyboard failed to set defaults: {:02X}", b);
return Err(Error::CommandRetry);
}
Ok(b)
})?;
{
// Perform the self test
self.command(Command::TestController)?;
let r = self.read()?;
if r != 0x55 {
warn!("self test unexpected value: {:02X}", r);
}
}
// Initialize keyboard
if let Err(err) = self.init_keyboard() {
error!("failed to initialize keyboard: {:?}", err);
return Err(err);
}
// Enable second device
let enable_mouse = match self.command(Command::EnableSecond) {
Ok(()) => true,
Err(err) => {
error!("failed to initialize mouse: {:?}", err);
false
// Linux: test AUX port (command 0xA9) before enabling.
// Skips mouse init entirely if the port is not electrically present.
let aux_ok = self.test_aux_port();
// Enable second device (mouse) only if AUX port tested OK
let enable_mouse = if aux_ok {
match self.command(Command::EnableSecond) {
Ok(()) => true,
Err(err) => {
warn!("failed to enable aux port after test passed: {:?}", err);
false
}
}
} else {
info!("skipping mouse init: aux port test did not pass");
false
};
{
// Enable keyboard data reporting
// Use inner function to prevent retries
// Response is ignored since scanning is now on
if let Err(err) = self.keyboard_command_inner(KeyboardCommand::EnableReporting as u8) {
error!("failed to initialize keyboard reporting: {:?}", err);
//TODO: fix by using interrupts?
}
}
+4 -3
View File
@@ -11,7 +11,7 @@ use std::process;
use common::acquire_port_io_rights;
use event::{user_data, EventQueue};
use inputd::ProducerHandle;
use inputd::InputProducer;
use crate::state::Ps2d;
@@ -31,7 +31,8 @@ fn daemon(daemon: daemon::Daemon) -> ! {
acquire_port_io_rights().expect("ps2d: failed to get I/O permission");
let input = ProducerHandle::new().expect("ps2d: failed to open input producer");
let keyboard_input = InputProducer::new_named_or_fallback("ps2-keyboard").expect("ps2d: failed to open keyboard input");
let mouse_input = InputProducer::new_named_or_fallback("ps2-mouse").expect("ps2d: failed to open mouse input");
user_data! {
enum Source {
@@ -97,7 +98,7 @@ fn daemon(daemon: daemon::Daemon) -> ! {
"ps2d: registered producer handle, listening on serio/0 (keyboard) and serio/1 (mouse)"
);
let mut ps2d = Ps2d::new(input, time_file);
let mut ps2d = Ps2d::new(keyboard_input, mouse_input, time_file);
let mut data = [0; 256];
for event in event_queue.map(|e| e.expect("ps2d: failed to get next event").user_data) {
+14 -7
View File
@@ -1,8 +1,8 @@
use crate::controller::Ps2;
use std::time::Duration;
pub const RESET_RETRIES: usize = 10;
pub const RESET_TIMEOUT: Duration = Duration::from_millis(1000);
pub const RESET_RETRIES: usize = 3;
pub const RESET_TIMEOUT: Duration = Duration::from_millis(250);
pub const COMMAND_TIMEOUT: Duration = Duration::from_millis(100);
#[derive(Clone, Copy, Debug)]
@@ -61,6 +61,10 @@ impl MouseTx {
if data == 0xFA {
self.write_i += 1;
self.try_write(ps2)?;
} else if data == 0xFE {
// PS/2 RESEND: mouse asks us to resend the current command byte
log::debug!("mouse requested resend for byte {:02X}, resending", self.write.get(self.write_i).unwrap_or(&0));
self.try_write(ps2)?;
} else {
log::error!("unknown mouse response {:02X}", data);
return Err(());
@@ -260,7 +264,8 @@ impl MouseState {
MouseResult::Timeout(COMMAND_TIMEOUT)
} else {
log::warn!("unknown mouse response {:02X} after reset", data);
self.reset(ps2)
*self = MouseState::None;
MouseResult::None
}
}
MouseState::Bat => {
@@ -352,12 +357,14 @@ impl MouseState {
self.reset(ps2)
}
MouseState::Reset => {
log::warn!("timeout waiting for mouse reset");
self.reset(ps2)
log::debug!("timeout waiting for mouse reset, fast-failing");
*self = MouseState::None;
MouseResult::None
}
MouseState::Bat => {
log::warn!("timeout waiting for BAT completion");
self.reset(ps2)
log::debug!("timeout waiting for BAT completion, fast-failing");
*self = MouseState::None;
MouseResult::None
}
MouseState::IdentifyTouchpad { .. } => {
//TODO: retry?
+44 -13
View File
@@ -1,4 +1,4 @@
use inputd::ProducerHandle;
use inputd::InputProducer;
use log::{error, warn};
use orbclient::{ButtonEvent, KeyEvent, MouseEvent, MouseRelativeEvent, ScrollEvent};
use std::{
@@ -44,7 +44,8 @@ pub struct Ps2d {
ps2: Ps2,
vmmouse: bool,
vmmouse_relative: bool,
input: ProducerHandle,
keyboard_input: InputProducer,
mouse_input: InputProducer,
time_file: File,
extended: bool,
mouse_x: i32,
@@ -56,12 +57,18 @@ pub struct Ps2d {
mouse_timeout: Option<TimeSpec>,
packets: [u8; 4],
packet_i: usize,
caps_lock: bool,
num_lock: bool,
scroll_lock: bool,
leds_dirty: bool,
}
impl Ps2d {
pub fn new(input: ProducerHandle, time_file: File) -> Self {
pub fn new(keyboard_input: InputProducer, mouse_input: InputProducer, time_file: File) -> Self {
let mut ps2 = Ps2::new();
ps2.init().expect("failed to initialize");
if let Err(err) = ps2.init() {
log::error!("ps2d: controller init failed: {:?}", err);
}
// FIXME add an option for orbital to disable this when an app captures the mouse.
let vmmouse_relative = false;
@@ -77,7 +84,8 @@ impl Ps2d {
ps2,
vmmouse,
vmmouse_relative,
input,
keyboard_input,
mouse_input,
time_file,
extended: false,
mouse_x: 0,
@@ -89,6 +97,10 @@ impl Ps2d {
mouse_timeout: None,
packets: [0; 4],
packet_i: 0,
caps_lock: false,
num_lock: true,
scroll_lock: false,
leds_dirty: true,
};
if !this.vmmouse {
@@ -96,6 +108,12 @@ impl Ps2d {
this.handle_mouse(None);
}
// Flush initial LED state (Num Lock on by default)
if this.leds_dirty {
this.leds_dirty = false;
this.ps2.set_leds(this.caps_lock, this.num_lock, this.scroll_lock);
}
this
}
@@ -272,8 +290,21 @@ impl Ps2d {
}
};
if scancode != 0 && pressed {
match scancode {
orbclient::K_CAPS => { self.caps_lock = !self.caps_lock; self.leds_dirty = true; },
orbclient::K_NUM => { self.num_lock = !self.num_lock; self.leds_dirty = true; },
orbclient::K_SCROLL => { self.scroll_lock = !self.scroll_lock; self.leds_dirty = true; },
_ => (),
}
}
if self.leds_dirty {
self.leds_dirty = false;
self.ps2.set_leds(self.caps_lock, self.num_lock, self.scroll_lock);
}
if scancode != 0 {
self.input
self.keyboard_input
.write_event(
KeyEvent {
character: '\0',
@@ -304,7 +335,7 @@ impl Ps2d {
if self.vmmouse_relative {
if dx != 0 || dy != 0 {
self.input
self.mouse_input
.write_event(
MouseRelativeEvent {
dx: dx as i32,
@@ -320,14 +351,14 @@ impl Ps2d {
if x != self.mouse_x || y != self.mouse_y {
self.mouse_x = x;
self.mouse_y = y;
self.input
self.mouse_input
.write_event(MouseEvent { x, y }.to_event())
.expect("ps2d: failed to write mouse event");
}
};
if dz != 0 {
self.input
self.mouse_input
.write_event(
ScrollEvent {
x: 0,
@@ -348,7 +379,7 @@ impl Ps2d {
self.mouse_left = left;
self.mouse_middle = middle;
self.mouse_right = right;
self.input
self.mouse_input
.write_event(
ButtonEvent {
left,
@@ -441,13 +472,13 @@ impl Ps2d {
}
if dx != 0 || dy != 0 {
self.input
self.mouse_input
.write_event(MouseRelativeEvent { dx, dy }.to_event())
.expect("ps2d: failed to write mouse event");
}
if dz != 0 {
self.input
self.mouse_input
.write_event(ScrollEvent { x: 0, y: dz }.to_event())
.expect("ps2d: failed to write scroll event");
}
@@ -462,7 +493,7 @@ impl Ps2d {
self.mouse_left = left;
self.mouse_middle = middle;
self.mouse_right = right;
self.input
self.mouse_input
.write_event(
ButtonEvent {
left,
+275 -17
View File
@@ -1,5 +1,5 @@
use std::fs::{File, OpenOptions};
use std::io::{self, Read, Write};
use std::io::{self, ErrorKind, Read, Write};
use std::mem::size_of;
use std::os::fd::{AsFd, AsRawFd, BorrowedFd, FromRawFd, RawFd};
use std::os::unix::fs::OpenOptionsExt;
@@ -31,6 +31,24 @@ unsafe fn any_as_u8_slice_mut<T: Sized>(p: &mut T) -> &mut [u8] {
slice::from_raw_parts_mut((p as *mut T) as *mut u8, size_of::<T>())
}
fn validate_input_name(kind: &str, name: &str) -> io::Result<()> {
if name.is_empty() {
return Err(io::Error::new(
io::ErrorKind::InvalidInput,
format!("input {kind} name must not be empty"),
));
}
if name.contains('/') {
return Err(io::Error::new(
io::ErrorKind::InvalidInput,
format!("input {kind} name must not contain '/'"),
));
}
Ok(())
}
pub struct ConsumerHandle(File);
pub enum ConsumerHandleEvent<'a> {
@@ -64,25 +82,53 @@ impl ConsumerHandle {
let fd = self.0.as_raw_fd();
let written = libredox::call::fpath(fd as usize, &mut buffer)?;
assert!(written <= buffer.len());
if written > buffer.len() {
return Err(io::Error::new(
io::ErrorKind::InvalidData,
"inputd: display path exceeded buffer size",
));
}
let mut display_path = PathBuf::from(
std::str::from_utf8(&buffer[..written])
.expect("init: display path UTF-8 check failed")
.to_owned(),
);
display_path.set_file_name(format!(
"v2/{}",
display_path.file_name().unwrap().to_str().unwrap()
));
let display_path = display_path.to_str().unwrap();
let path_str = std::str::from_utf8(&buffer[..written]).map_err(|e| {
io::Error::new(
io::ErrorKind::InvalidData,
format!("inputd: display path is not valid UTF-8: {e}"),
)
})?;
let mut display_path = PathBuf::from(path_str.to_owned());
let file_name = display_path
.file_name()
.and_then(|n| n.to_str())
.ok_or_else(|| {
io::Error::new(
io::ErrorKind::InvalidData,
format!(
"inputd: display path has no valid file name: {}",
display_path.display()
),
)
})?;
display_path.set_file_name(format!("v2/{file_name}"));
let display_path_str = display_path.to_str().ok_or_else(|| {
io::Error::new(
io::ErrorKind::InvalidData,
format!(
"inputd: constructed display path is not valid UTF-8: {}",
display_path.display()
),
)
})?;
let display_file =
libredox::call::open(display_path, (O_CLOEXEC | O_NONBLOCK | O_RDWR) as _, 0)
libredox::call::open(display_path_str, (O_CLOEXEC | O_NONBLOCK | O_RDWR) as _, 0)
.map(|socket| unsafe { File::from_raw_fd(socket as RawFd) })
.unwrap_or_else(|err| {
panic!("failed to open display {}: {}", display_path, err);
});
.map_err(|err| {
io::Error::new(
io::ErrorKind::Other,
format!("inputd: failed to open display {display_path_str}: {err}"),
)
})?;
Ok(display_file)
}
@@ -152,8 +198,12 @@ impl DisplayHandle {
if nread == 0 {
Ok(None)
} else if nread != size_of::<VtEvent>() {
Err(io::Error::new(
io::ErrorKind::InvalidData,
format!("inputd: partial vt event read: got {nread}, expected {}", size_of::<VtEvent>()),
))
} else {
assert_eq!(nread, size_of::<VtEvent>());
Ok(Some(event))
}
}
@@ -197,6 +247,160 @@ pub struct VtEvent {
pub vt: usize,
}
#[derive(Debug, Clone, Copy)]
#[repr(C)]
pub struct HotplugEventHeader {
pub kind: u32,
pub device_id: u32,
pub name_len: u32,
pub _reserved: u32,
}
#[derive(Debug, Clone)]
pub struct HotplugEvent {
pub kind: u32,
pub device_id: u32,
pub name: String,
}
/// Handle for opening a named producer on the input scheme.
/// Opens /scheme/input/producer/{name}
pub struct NamedProducerHandle {
fd: File,
}
impl NamedProducerHandle {
pub fn new(name: &str) -> io::Result<Self> {
validate_input_name("producer", name)?;
let path = format!("/scheme/input/producer/{name}");
File::open(path).map(|fd| Self { fd })
}
pub fn write_event(&mut self, event: &orbclient::Event) -> io::Result<()> {
self.fd.write(unsafe { any_as_u8_slice(event) })?;
Ok(())
}
}
pub struct DeviceConsumerHandle {
fd: File,
}
impl DeviceConsumerHandle {
pub fn new(device_name: &str) -> io::Result<Self> {
validate_input_name("device", device_name)?;
let fd = OpenOptions::new()
.read(true)
.custom_flags(O_NONBLOCK as i32)
.open(format!("/scheme/input/{device_name}"))?;
Ok(Self { fd })
}
pub fn event_handle(&self) -> BorrowedFd<'_> {
self.fd.as_fd()
}
pub fn read_event(&mut self) -> io::Result<Option<orbclient::Event>> {
let mut raw = [0_u8; size_of::<orbclient::Event>()];
match self.fd.read(&mut raw) {
Ok(0) => Ok(None),
Ok(read) => {
assert_eq!(read, raw.len());
Ok(Some(unsafe {
core::ptr::read_unaligned(raw.as_ptr().cast::<orbclient::Event>())
}))
}
Err(err) if err.kind() == ErrorKind::WouldBlock => Ok(None),
Err(err) => Err(err),
}
}
}
pub struct HotplugHandle {
fd: File,
partial: Vec<u8>,
}
impl HotplugHandle {
pub fn new() -> io::Result<Self> {
let fd = OpenOptions::new()
.read(true)
.custom_flags(O_NONBLOCK as i32)
.open("/scheme/input/events")?;
Ok(Self {
fd,
partial: Vec::new(),
})
}
pub fn event_handle(&self) -> BorrowedFd<'_> {
self.fd.as_fd()
}
pub fn read_event(&mut self) -> io::Result<Option<HotplugEvent>> {
let mut buf = [0_u8; 1024];
loop {
if let Some(event) = Self::try_parse_event(&mut self.partial)? {
return Ok(Some(event));
}
match self.fd.read(&mut buf) {
Ok(0) => return Ok(None),
Ok(read) => self.partial.extend_from_slice(&buf[..read]),
Err(err) if err.kind() == ErrorKind::WouldBlock => return Ok(None),
Err(err) => return Err(err),
}
}
}
fn try_parse_event(partial: &mut Vec<u8>) -> io::Result<Option<HotplugEvent>> {
if partial.len() < size_of::<HotplugEventHeader>() {
return Ok(None);
}
let header =
unsafe { core::ptr::read_unaligned(partial.as_ptr().cast::<HotplugEventHeader>()) };
let name_len = usize::try_from(header.name_len).map_err(|_| {
io::Error::new(
io::ErrorKind::InvalidData,
"invalid input hotplug name length",
)
})?;
let total_len = size_of::<HotplugEventHeader>()
.checked_add(name_len)
.ok_or_else(|| {
io::Error::new(io::ErrorKind::InvalidData, "input hotplug event too large")
})?;
if partial.len() < total_len {
return Ok(None);
}
let name = std::str::from_utf8(&partial[size_of::<HotplugEventHeader>()..total_len])
.map_err(|_| {
io::Error::new(
io::ErrorKind::InvalidData,
"input hotplug name is not UTF-8",
)
})?
.to_owned();
partial.drain(..total_len);
Ok(Some(HotplugEvent {
kind: header.kind,
device_id: header.device_id,
name,
}))
}
}
pub struct ProducerHandle(File);
impl ProducerHandle {
@@ -210,4 +414,58 @@ impl ProducerHandle {
"write_event: short write ({} != {})", written, std::mem::size_of::<orbclient::Event>());
Ok(())
}
pub fn query_keymap_char(&self, scancode: u8, shift: bool, altgr: bool) -> Option<char> {
use std::io::Read;
let path = format!("/scheme/keymap/translate/{}/{}/{}", scancode, shift as u8, altgr as u8);
let mut f = match std::fs::File::open(&path) {
Ok(f) => f,
Err(_) => return None,
};
let mut buf = [0u8; 4];
match f.read(&mut buf) {
Ok(n) if n > 0 => {
let s = std::str::from_utf8(&buf[..n]).ok()?;
s.chars().next()
}
_ => None,
}
}
pub fn send_led_state(caps: bool, num: bool, scroll: bool) -> io::Result<()> {
let led_byte = (caps as u8) | ((num as u8) << 1) | ((scroll as u8) << 2);
let path = format!("/scheme/input/control/leds/{}", led_byte);
std::fs::write(&path, &[])?;
Ok(())
}
}
/// Convenience wrapper that tries a named producer first,
/// falling back to the legacy anonymous producer on failure.
pub enum InputProducer {
Named(NamedProducerHandle),
Legacy(ProducerHandle),
}
impl InputProducer {
/// Open a named producer (`/scheme/input/producer/{name}`).
/// Falls back to the legacy anonymous producer on failure.
pub fn new_named_or_fallback(name: &str) -> io::Result<Self> {
match NamedProducerHandle::new(name) {
Ok(named) => Ok(InputProducer::Named(named)),
Err(_) => ProducerHandle::new().map(InputProducer::Legacy),
}
}
/// Open the legacy anonymous producer directly.
pub fn new_legacy() -> io::Result<Self> {
ProducerHandle::new().map(InputProducer::Legacy)
}
pub fn write_event(&mut self, event: orbclient::Event) -> io::Result<()> {
match self {
InputProducer::Named(h) => h.write_event(&event),
InputProducer::Legacy(h) => h.write_event(event),
}
}
}
+4 -5
View File
@@ -3,7 +3,7 @@ use std::{cmp, mem, ptr, slice, thread, time};
use driver_network::NetworkAdapter;
use syscall::error::Result;
use syscall::error::{Error, Result, EIO};
use common::dma::Dma;
@@ -207,11 +207,10 @@ impl NetworkAdapter for Intel8254x {
}
fn dma_array<T, const N: usize>() -> Result<[Dma<T>; N]> {
Ok((0..N)
let vec: Vec<Dma<T>> = (0..N)
.map(|_| Ok(unsafe { Dma::zeroed()?.assume_init() }))
.collect::<Result<Vec<_>>>()?
.try_into()
.unwrap_or_else(|_| unreachable!()))
.collect::<Result<Vec<_>>>()?;
vec.try_into().map_err(|_| Error::new(EIO))
}
impl Intel8254x {
pub unsafe fn new(base: usize) -> Result<Self> {
+11 -9
View File
@@ -3,6 +3,7 @@ use std::os::unix::io::AsRawFd;
use driver_network::NetworkScheme;
use event::{user_data, EventQueue};
use pcid_interface::irq_helpers::pci_allocate_interrupt_vector;
use pcid_interface::PciFunctionHandle;
pub mod device;
@@ -25,14 +26,11 @@ fn daemon(daemon: daemon::Daemon, mut pcid_handle: PciFunctionHandle) -> ! {
common::file_level(),
);
let irq = pci_config
.func
.legacy_interrupt_line
.expect("e1000d: no legacy interrupts supported");
let irq_vector = pci_allocate_interrupt_vector(&mut pcid_handle, "e1000d");
log::info!("E1000 {}", pci_config.func.display());
let mut irq_file = irq.irq_handle("e1000d");
let irq_file = irq_vector.irq_handle();
let address = unsafe { pcid_handle.map_bar(0) }.ptr.as_ptr() as usize;
@@ -53,9 +51,11 @@ fn daemon(daemon: daemon::Daemon, mut pcid_handle: PciFunctionHandle) -> ! {
let event_queue = EventQueue::<Source>::new().expect("e1000d: failed to create event queue");
let irq_fd = irq_vector.irq_handle().as_raw_fd();
event_queue
.subscribe(
irq_file.as_raw_fd() as usize,
irq_fd as usize,
Source::Irq,
event::EventFlags::READ,
)
@@ -70,15 +70,17 @@ fn daemon(daemon: daemon::Daemon, mut pcid_handle: PciFunctionHandle) -> ! {
libredox::call::setrens(0, 0).expect("e1000d: failed to enter null namespace");
scheme.tick().unwrap();
scheme.tick().expect("e1000d: tick failed");
let mut irq_file = irq_vector.irq_handle();
for event in event_queue.map(|e| e.expect("e1000d: failed to get event")) {
match event.user_data {
Source::Irq => {
let mut irq = [0; 8];
irq_file.read(&mut irq).unwrap();
irq_file.read(&mut irq).expect("e1000d: IRQ read failed");
if unsafe { scheme.adapter().irq() } {
irq_file.write(&mut irq).unwrap();
irq_file.write(&mut irq).expect("e1000d: IRQ ack failed");
scheme.tick().expect("e1000d: failed to handle IRQ")
}
+1
View File
@@ -7,6 +7,7 @@ edition = "2021"
[dependencies]
bitflags.workspace = true
libredox.workspace = true
log.workspace = true
redox_event.workspace = true
redox_syscall.workspace = true
+35 -32
View File
@@ -3,7 +3,7 @@ use std::time::{Duration, Instant};
use std::{cmp, mem, ptr, slice, thread};
use driver_network::NetworkAdapter;
use syscall::error::Result;
use syscall::error::{Error, Result, EIO};
use common::dma::Dma;
@@ -45,7 +45,12 @@ impl NetworkAdapter for Intel8259x {
if (status & IXGBE_RXDADV_STAT_DD) != 0 {
if (status & IXGBE_RXDADV_STAT_EOP) == 0 {
panic!("increase buffer size or decrease MTU")
log::error!("ixgbed: received fragmented packet, skipping descriptor");
desc.read.pkt_addr = self.receive_buffer[self.receive_index].physical() as u64;
desc.read.hdr_addr = 0;
self.write_reg(IXGBE_RDT(0), self.receive_index as u32);
self.receive_index = wrap_ring(self.receive_index, self.receive_ring.len());
return Ok(None);
}
let data = unsafe {
@@ -132,13 +137,25 @@ impl Intel8259x {
.map(|_| Ok(unsafe { Dma::zeroed()?.assume_init() }))
.collect::<Result<Vec<_>>>()?
.try_into()
.unwrap_or_else(|_| unreachable!()),
.map_err(|v: Vec<_>| {
log::error!(
"ixgbed: internal error: DMA buffer array conversion failed (got {} items, expected 32)",
v.len()
);
Error::new(EIO)
})?,
receive_ring: unsafe { Dma::zeroed()?.assume_init() },
transmit_buffer: (0..32)
.map(|_| Ok(unsafe { Dma::zeroed()?.assume_init() }))
.collect::<Result<Vec<_>>>()?
.try_into()
.unwrap_or_else(|_| unreachable!()),
.map_err(|v: Vec<_>| {
log::error!(
"ixgbed: internal error: DMA buffer array conversion failed (got {} items, expected 32)",
v.len()
);
Error::new(EIO)
})?,
receive_index: 0,
transmit_ring: unsafe { Dma::zeroed()?.assume_init() },
transmit_ring_free: 32,
@@ -166,7 +183,7 @@ impl Intel8259x {
if (status & IXGBE_RXDADV_STAT_DD) != 0 {
if (status & IXGBE_RXDADV_STAT_EOP) == 0 {
panic!("increase buffer size or decrease MTU")
log::error!("ixgbed: received fragmented packet, buffer too small");
}
return unsafe { desc.wb.upper.length as usize };
@@ -205,13 +222,8 @@ impl Intel8259x {
self.mac_address = mac;
}
/// Returns the register at `self.base` + `register`.
///
/// # Panics
///
/// Panics if `self.base` + `register` does not belong to the mapped memory of the PCIe device.
fn read_reg(&self, register: u32) -> u32 {
assert!(
debug_assert!(
register as usize <= self.size - 4 as usize,
"MMIO access out of bounds"
);
@@ -219,13 +231,8 @@ impl Intel8259x {
unsafe { ptr::read_volatile((self.base + register as usize) as *mut u32) }
}
/// Sets the register at `self.base` + `register`.
///
/// # Panics
///
/// Panics if `self.base` + `register` does not belong to the mapped memory of the PCIe device.
fn write_reg(&self, register: u32, data: u32) -> u32 {
assert!(
debug_assert!(
register as usize <= self.size - 4 as usize,
"MMIO access out of bounds"
);
@@ -279,7 +286,7 @@ impl Intel8259x {
let mac = self.get_mac_addr();
println!(
log::info!(
" - MAC: {:>02X}:{:>02X}:{:>02X}:{:>02X}:{:>02X}:{:>02X}",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]
);
@@ -438,13 +445,11 @@ impl Intel8259x {
}
/// Sets the rx queues` descriptors and enables the queues.
///
/// # Panics
/// Panics if length of `self.receive_ring` is not a power of 2.
fn start_rx_queue(&mut self, queue_id: u16) {
if self.receive_ring.len() & (self.receive_ring.len() - 1) != 0 {
panic!("number of receive queue entries must be a power of 2");
}
debug_assert!(
self.receive_ring.len() & (self.receive_ring.len() - 1) == 0,
"number of receive queue entries must be a power of 2"
);
for i in 0..self.receive_ring.len() {
self.receive_ring[i].read.pkt_addr = self.receive_buffer[i].physical() as u64;
@@ -466,13 +471,11 @@ impl Intel8259x {
}
/// Enables the tx queues.
///
/// # Panics
/// Panics if length of `self.transmit_ring` is not a power of 2.
fn start_tx_queue(&mut self, queue_id: u16) {
if self.transmit_ring.len() & (self.transmit_ring.len() - 1) != 0 {
panic!("number of receive queue entries must be a power of 2");
}
debug_assert!(
self.transmit_ring.len() & (self.transmit_ring.len() - 1) == 0,
"number of transmit queue entries must be a power of 2"
);
for i in 0..self.transmit_ring.len() {
self.transmit_ring[i].read.buffer_addr = self.transmit_buffer[i].physical() as u64;
@@ -506,14 +509,14 @@ impl Intel8259x {
/// Waits for the link to come up.
fn wait_for_link(&self) {
println!(" - waiting for link");
log::info!(" - waiting for link");
let time = Instant::now();
let mut speed = self.get_link_speed();
while speed == 0 && time.elapsed().as_secs() < 10 {
thread::sleep(Duration::from_millis(100));
speed = self.get_link_speed();
}
println!(" - link speed is {} Mbit/s", self.get_link_speed());
log::info!(" - link speed is {} Mbit/s", self.get_link_speed());
}
/// Enables or disables promisc mode of this device.
+1 -1
View File
@@ -215,7 +215,7 @@ impl Rtl8139 {
.map(|_| Ok(Dma::zeroed()?.assume_init()))
.collect::<Result<Vec<_>>>()?
.try_into()
.unwrap_or_else(|_| unreachable!()),
.map_err(|_| Error::new(EIO))?,
transmit_i: 0,
mac_address: [0; 6],
};
+2 -2
View File
@@ -177,7 +177,7 @@ impl Rtl8168 {
.map(|_| Ok(Dma::zeroed()?.assume_init()))
.collect::<Result<Vec<_>>>()?
.try_into()
.unwrap_or_else(|_| unreachable!()),
.map_err(|_| Error::new(EIO))?,
receive_ring: Dma::zeroed()?.assume_init(),
receive_i: 0,
@@ -185,7 +185,7 @@ impl Rtl8168 {
.map(|_| Ok(Dma::zeroed()?.assume_init()))
.collect::<Result<Vec<_>>>()?
.try_into()
.unwrap_or_else(|_| unreachable!()),
.map_err(|_| Error::new(EIO))?,
transmit_ring: Dma::zeroed()?.assume_init(),
transmit_i: 0,
transmit_buffer_h: [Dma::zeroed()?.assume_init()],
+10 -5
View File
@@ -27,11 +27,16 @@ impl<'a> VirtioNet<'a> {
// Populate all of the `rx_queue` with buffers to maximize performence.
let mut rx_buffers = vec![];
for i in 0..(rx.descriptor_len() as usize) {
rx_buffers.push(unsafe {
Dma::<[u8]>::zeroed_slice(MAX_BUFFER_LEN)
.unwrap()
.assume_init()
});
let buf = unsafe {
match Dma::<[u8]>::zeroed_slice(MAX_BUFFER_LEN) {
Ok(dma) => dma.assume_init(),
Err(err) => {
log::error!("virtio-netd: failed to allocate rx buffer: {err}");
continue;
}
}
};
rx_buffers.push(buf);
let chain = ChainBuilder::new()
.chain(Buffer::new_unsized(&rx_buffers[i]).flags(DescriptorFlags::WRITE_ONLY))
+8 -3
View File
@@ -75,11 +75,12 @@ fn main() -> Result<()> {
}
};
let full_device_id = handle.config().func.full_device_id;
let func = handle.config().func;
let full_device_id = func.full_device_id;
log::debug!(
"pcid-spawner enumerated: PCI {} {}",
handle.config().func.addr,
func.addr,
full_device_id.display()
);
@@ -88,7 +89,7 @@ fn main() -> Result<()> {
.iter()
.find(|driver| driver.match_function(&full_device_id))
else {
log::debug!("no driver for {}, continuing", handle.config().func.addr);
log::debug!("no driver for {}, continuing", func.addr);
continue;
};
@@ -112,6 +113,10 @@ fn main() -> Result<()> {
let channel_fd = handle.into_inner_fd();
command.env("PCID_CLIENT_CHANNEL", channel_fd.to_string());
command.env("PCID_SEGMENT", format!("{:04x}", func.addr.segment()));
command.env("PCID_BUS", format!("{:02x}", func.addr.bus()));
command.env("PCID_DEVICE", format!("{:02x}", func.addr.device()));
command.env("PCID_FUNCTION", format!("{}", func.addr.function()));
#[allow(deprecated, reason = "we can't yet move this to init")]
daemon::Daemon::spawn(command);
+69 -20
View File
@@ -152,20 +152,22 @@ impl Mcfg {
fn with<T>(
f: impl FnOnce(PcieAllocs<'_>, Vec<InterruptMap>, [u32; 4]) -> io::Result<T>,
) -> io::Result<T> {
let table_dir = fs::read_dir("/scheme/acpi/tables")?;
let table_dir = match fs::read_dir("/scheme/acpi/tables") {
Ok(dir) => dir,
Err(e) => {
log::debug!("pcid: cannot read /scheme/acpi/tables: {e} (acpid running?)");
return Err(e);
}
};
// TODO: validate/print MCFG?
let mut found_tables: Vec<String> = Vec::new();
for table_direntry in table_dir {
let table_path = table_direntry?.path();
// Every directory entry has to have a filename unless
// the filesystem (or in this case acpid) misbehaves.
// If it misbehaves we have worse problems than pcid
// crashing. `as_encoded_bytes()` returns some superset
// of ASCII, so directly comparing it with an ASCII name
// is fine.
let table_filename = table_path.file_name().unwrap().as_encoded_bytes();
found_tables.push(String::from_utf8_lossy(table_filename).into_owned());
if table_filename.get(0..4) == Some(&MCFG_NAME) {
let bytes = fs::read(table_path)?.into_boxed_slice();
match Mcfg::parse(&*bytes) {
@@ -174,6 +176,7 @@ impl Mcfg {
return f(allocs, Vec::new(), [u32::MAX, u32::MAX, u32::MAX, u32::MAX]);
}
None => {
log::warn!("pcid: MCFG table found but failed to parse ({} bytes)", bytes.len());
return Err(io::Error::new(
io::ErrorKind::InvalidData,
"couldn't find mcfg table",
@@ -183,6 +186,12 @@ impl Mcfg {
}
}
log::debug!(
"pcid: MCFG not found among {} ACPI table(s): {:?}",
found_tables.len(),
found_tables
);
Err(io::Error::new(
io::ErrorKind::NotFound,
"couldn't find mcfg table",
@@ -219,6 +228,24 @@ pub struct Pcie {
pub interrupt_map_mask: [u32; 4],
fallback: Pci,
}
/// Validate an MCFG allocation entry address (cross-referenced with Linux
/// `acpi_mcfg_valid_entry` in arch/x86/pci/mmconfig-shared.c).
///
/// - Addresses below 4 GiB are valid for legacy PCIe ECAM.
/// - Addresses at or above 4 GiB require the MCFG table revision >= 1, matching
/// the ACPI 4.0+ rule that 64-bit ECAM addresses are only valid when the
/// firmware signals support via the revision field.
fn validate_mcfg_addr(addr: u64) -> Result<(), String> {
const FOUR_GIB: u64 = 0x1_0000_0000;
if addr < FOUR_GIB {
return Ok(());
}
Err(format!("address {addr:#018x} >= 4 GiB requires MCFG revision >= 1 (ACPI 4.0+); entry skipped"))
}
struct Alloc {
seg: u16,
start_bus: u8,
@@ -239,9 +266,11 @@ impl Pcie {
Ok(pcie) => pcie,
Err(fdt_error) => {
log::warn!(
"Couldn't retrieve PCIe info, perhaps the kernel is not compiled with \
acpi or device tree support? Using the PCI 3.0 configuration space \
instead. ACPI error: {:?} FDT error: {:?}",
"PCIe (ECAM/MCFG) not available: {}. \
Device tree ECAM also not found: {}. \
Falling back to PCI 3.0 config space (I/O ports 0xCF8/0xCFC). \
For PCI Express support, use QEMU Q35 machine type (-machine q35) \
or ensure your platform firmware provides an MCFG ACPI table.",
acpi_error,
fdt_error
);
@@ -266,24 +295,44 @@ impl Pcie {
.0
.iter()
.filter_map(|desc| {
if desc.seg_group_num != 0 {
let seg = desc.seg_group_num;
let start = desc.start_bus;
let end = desc.end_bus;
log::warn!(
"pcid: skipping MCFG entry at seg={seg} bus {start}..={end}: multi-segment not yet implemented",
);
return None;
}
if let Err(reason) = validate_mcfg_addr(desc.base_addr) {
let addr = desc.base_addr;
let seg = desc.seg_group_num;
let start = desc.start_bus;
let end = desc.end_bus;
log::warn!(
"pcid: skipping MCFG entry at {addr:#018x} (seg={seg} bus {start}..={end}): {reason}",
);
return None;
}
let seg = desc.seg_group_num;
let start = desc.start_bus;
let end = desc.end_bus;
Some(Alloc {
seg: desc.seg_group_num,
start_bus: desc.start_bus,
end_bus: desc.end_bus,
seg,
start_bus: start,
end_bus: end,
mem: PhysBorrowed::map(
desc.base_addr.try_into().ok()?,
BYTES_PER_BUS
* (usize::from(desc.end_bus) - usize::from(desc.start_bus) + 1),
* (usize::from(end) - usize::from(start) + 1),
Prot::RW,
MemoryType::Uncacheable,
)
.inspect_err(|err| {
log::error!(
"failed to map seg {} bus {}..={}: {}",
{ desc.seg_group_num },
{ desc.start_bus },
{ desc.end_bus },
err
"failed to map seg {seg} bus {start}..={end}: {err}",
)
})
.ok()?,
+24
View File
@@ -52,4 +52,28 @@ impl PciBar {
PciBar::None => panic!("expected BAR to exist"),
}
}
pub fn try_mem(&self) -> Result<(usize, usize), &'static str> {
match *self {
PciBar::Memory32 { addr, size } => Ok((addr as usize, size as usize)),
PciBar::Memory64 { addr, size } => Ok((
addr.try_into()
.expect("conversion from 64bit BAR to usize failed"),
size.try_into()
.expect("conversion from 64bit BAR size to usize failed"),
)),
PciBar::Port(_) => Err("expected memory BAR, found port BAR"),
PciBar::None => Err("expected BAR to exist"),
}
}
pub fn try_port(&self) -> Result<u16, &'static str> {
match *self {
PciBar::Port(port) => Ok(port),
PciBar::Memory32 { .. } | PciBar::Memory64 { .. } => {
Err("expected port BAR, found memory BAR")
}
PciBar::None => Err("expected BAR to exist"),
}
}
}
@@ -332,3 +332,27 @@ pub fn pci_allocate_interrupt_vector(
panic!("{driver}: no interrupts supported at all")
}
}
pub fn try_pci_allocate_interrupt_vector(
pcid_handle: &mut crate::driver_interface::PciFunctionHandle,
driver: &str,
) -> io::Result<InterruptVector> {
let features = pcid_handle.fetch_all_features();
let has_msi = features.iter().any(|feature| feature.is_msi());
let has_msix = features.iter().any(|feature| feature.is_msix());
if has_msix || has_msi {
Ok(pci_allocate_interrupt_vector(pcid_handle, driver))
} else if let Some(irq) = pcid_handle.config().func.legacy_interrupt_line {
Ok(InterruptVector {
irq_handle: irq.try_irq_handle(driver)?,
vector: 0,
kind: InterruptVectorKind::Legacy,
})
} else {
Err(io::Error::new(
io::ErrorKind::NotFound,
format!("{driver}: no interrupts supported at all"),
))
}
}
+51 -1
View File
@@ -50,6 +50,29 @@ impl LegacyInterruptLine {
.unwrap_or_else(|err| panic!("{driver}: failed to open IRQ file: {err}"))
}
}
/// Non-panicking version of `irq_handle`.
pub fn try_irq_handle(self, _driver: &str) -> io::Result<File> {
if let Some((phandle, addr, cells)) = self.phandled {
let path = match cells {
1 => format!("/scheme/irq/phandle-{}/{}", phandle, addr[0]),
2 => format!("/scheme/irq/phandle-{}/{},{}", phandle, addr[0], addr[1]),
3 => format!(
"/scheme/irq/phandle-{}/{},{},{}",
phandle, addr[0], addr[1], addr[2]
),
_ => {
return Err(io::Error::new(
io::ErrorKind::InvalidInput,
format!("unexpected IRQ cells count: {cells}"),
))
}
};
File::create(path)
} else {
File::open(format!("/scheme/irq/{}", self.irq))
}
}
}
impl fmt::Display for LegacyInterruptLine {
@@ -312,7 +335,7 @@ fn recv<T: DeserializeOwned>(r: &mut File) -> T {
}
impl PciFunctionHandle {
fn connect_default() -> Self {
pub fn connect_default() -> Self {
let channel_fd = match env::var("PCID_CLIENT_CHANNEL") {
Ok(channel_fd) => channel_fd,
Err(err) => {
@@ -485,6 +508,33 @@ impl PciFunctionHandle {
})
}
}
pub unsafe fn try_map_bar(&mut self, bir: u8) -> Result<&MappedBar, String> {
let mapped_bar = &mut self.mapped_bars[bir as usize];
if mapped_bar.is_none() {
let (bar, bar_size) = self.config.func.bars[bir as usize]
.try_mem()
.map_err(|e| e.to_string())?;
let ptr = unsafe {
common::physmap(
bar,
bar_size,
common::Prot::RW,
common::MemoryType::Uncacheable,
)
}
.map_err(|e| format!("physmap failed: {e}"))?;
let ptr = NonNull::new(ptr.cast::<u8>())
.ok_or_else(|| "physmap returned null".to_string())?;
mapped_bar.insert(MappedBar {
ptr,
bar_size,
});
}
Ok(mapped_bar.as_ref().expect("BAR was just mapped"))
}
}
pub fn pci_daemon<F: FnOnce(Daemon, PciFunctionHandle) -> !>(f: F) -> ! {
+44 -3
View File
@@ -21,6 +21,7 @@ enum Handle {
TopLevel { entries: Vec<String> },
Access,
Device,
Config { addr: PciAddress },
Channel { addr: PciAddress, st: ChannelState },
SchemeRoot,
}
@@ -30,14 +31,20 @@ struct HandleWrapper {
}
impl Handle {
fn is_file(&self) -> bool {
matches!(self, Self::Access | Self::Channel { .. })
matches!(
self,
Self::Access | Self::Config { .. } | Self::Channel { .. }
)
}
fn is_dir(&self) -> bool {
!self.is_file()
}
// TODO: capability rather than root
fn requires_root(&self) -> bool {
matches!(self, Self::Access | Self::Channel { .. })
matches!(
self,
Self::Access | Self::Config { .. } | Self::Channel { .. }
)
}
fn is_scheme_root(&self) -> bool {
matches!(self, Self::SchemeRoot)
@@ -132,6 +139,7 @@ impl SchemeSync for PciScheme {
let (len, mode) = match handle.inner {
Handle::TopLevel { ref entries } => (entries.len(), MODE_DIR | 0o755),
Handle::Device => (DEVICE_CONTENTS.len(), MODE_DIR | 0o755),
Handle::Config { .. } => (256, MODE_CHR | 0o600),
Handle::Access | Handle::Channel { .. } => (0, MODE_CHR | 0o600),
Handle::SchemeRoot => return Err(Error::new(EBADF)),
};
@@ -156,6 +164,18 @@ impl SchemeSync for PciScheme {
match handle.inner {
Handle::TopLevel { .. } => Err(Error::new(EISDIR)),
Handle::Device => Err(Error::new(EISDIR)),
Handle::Config { addr } => {
let offset = _offset as u16;
let dword_offset = offset & !0x3;
let byte_offset = (offset & 0x3) as usize;
let bytes_to_read = buf.len().min(4 - byte_offset);
let dword = unsafe { self.pcie.read(addr, dword_offset) };
let bytes = dword.to_le_bytes();
buf[..bytes_to_read]
.copy_from_slice(&bytes[byte_offset..byte_offset + bytes_to_read]);
Ok(bytes_to_read)
}
Handle::Channel {
addr: _,
ref mut st,
@@ -193,7 +213,9 @@ impl SchemeSync for PciScheme {
return Ok(buf);
}
Handle::Device => DEVICE_CONTENTS,
Handle::Access | Handle::Channel { .. } => return Err(Error::new(ENOTDIR)),
Handle::Access | Handle::Config { .. } | Handle::Channel { .. } => {
return Err(Error::new(ENOTDIR));
}
Handle::SchemeRoot => return Err(Error::new(EBADF)),
};
@@ -223,6 +245,20 @@ impl SchemeSync for PciScheme {
}
match handle.inner {
Handle::Config { addr } => {
let offset = _offset as u16;
let dword_offset = offset & !0x3;
let byte_offset = (offset & 0x3) as usize;
let bytes_to_write = buf.len().min(4 - byte_offset);
let mut dword = unsafe { self.pcie.read(addr, dword_offset) };
let mut bytes = dword.to_le_bytes();
bytes[byte_offset..byte_offset + bytes_to_write]
.copy_from_slice(&buf[..bytes_to_write]);
dword = u32::from_le_bytes(bytes);
unsafe { self.pcie.write(addr, dword_offset, dword) };
Ok(buf.len())
}
Handle::Channel { addr, ref mut st } => {
Self::write_channel(&self.pcie, &mut self.tree, addr, st, buf)
}
@@ -316,6 +352,10 @@ impl SchemeSync for PciScheme {
func.enabled = false;
}
}
Some(HandleWrapper {
inner: Handle::Config { .. },
..
}) => {}
_ => {}
}
}
@@ -341,6 +381,7 @@ impl PciScheme {
let path = &after[1..];
match path {
"config" => Handle::Config { addr },
"channel" => {
if func.enabled {
return Err(Error::new(ENOLCK));
+12
View File
@@ -0,0 +1,12 @@
[package]
name = "thermald"
version = "0.1.0"
edition = "2021"
[dependencies]
log.workspace = true
anyhow.workspace = true
common = { path = "../common" }
[lints]
workspace = true
+30
View File
@@ -0,0 +1,30 @@
use anyhow::{Context, Result};
use std::{thread, time};
fn read_temp() -> Option<f32> {
for zone in 0..4 {
let path = format!("/scheme/acpi/thermal_zone/{}/temperature", zone);
if let Ok(data) = std::fs::read_to_string(&path) {
if let Ok(mv) = data.trim().parse::<u32>() {
return Some(mv as f32 / 1000.0);
}
}
}
None
}
fn main() -> Result<()> {
common::setup_logging("system", "thermald", "thermald",
common::output_level(), common::file_level());
log::info!("thermald: started");
loop {
if let Some(temp) = read_temp() {
if temp > 85.0 {
log::error!("thermald: CRITICAL {:.1}C", temp);
} else if temp > 70.0 {
log::warn!("thermald: WARNING {:.1}C", temp);
}
}
thread::sleep(time::Duration::from_secs(5));
}
}
+106 -21
View File
@@ -199,16 +199,28 @@ fn daemon(daemon: daemon::Daemon, mut pcid_handle: PciFunctionHandle) -> ! {
let mut name = pci_config.func.name();
name.push_str("_vbox");
let bar0 = pci_config.func.bars[0].expect_port();
let bar0 = match pci_config.func.bars[0].try_port() {
Ok(port) => port,
Err(err) => {
eprintln!("vboxd: invalid BAR0: {err}");
std::process::exit(1);
}
};
let irq = pci_config
.func
.legacy_interrupt_line
.expect("vboxd: no legacy interrupts supported");
.unwrap_or_else(|| {
eprintln!("vboxd: no legacy interrupts supported");
std::process::exit(1);
});
println!(" + VirtualBox {}", pci_config.func.display());
common::acquire_port_io_rights().expect("vboxd: failed to get I/O permission");
if let Err(err) = common::acquire_port_io_rights() {
eprintln!("vboxd: failed to get I/O permission: {err}");
std::process::exit(1);
}
let mut width = 0;
let mut height = 0;
@@ -233,25 +245,55 @@ fn daemon(daemon: daemon::Daemon, mut pcid_handle: PciFunctionHandle) -> ! {
}
}
let mut irq_file = irq.irq_handle("vboxd");
let mut irq_file = match irq.try_irq_handle("vboxd") {
Ok(file) => file,
Err(err) => {
eprintln!("vboxd: failed to open IRQ handle: {err}");
std::process::exit(1);
}
};
let address = unsafe { pcid_handle.map_bar(1) }.ptr.as_ptr();
let address = match unsafe { pcid_handle.try_map_bar(1) } {
Ok(bar) => bar.ptr.as_ptr(),
Err(err) => {
eprintln!("vboxd: failed to map BAR1: {err}");
std::process::exit(1);
}
};
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
{
let mut port = common::io::Pio::<u32>::new(bar0 as u16);
let vmmdev = unsafe { &mut *(address as *mut VboxVmmDev) };
let mut guest_info = VboxGuestInfo::new().expect("vboxd: failed to map GuestInfo");
let mut guest_info = match VboxGuestInfo::new() {
Ok(value) => value,
Err(err) => {
eprintln!("vboxd: failed to map GuestInfo: {err}");
std::process::exit(1);
}
};
guest_info.version.write(VBOX_VMMDEV_VERSION);
guest_info.ostype.write(0x100);
port.write(guest_info.physical() as u32);
let mut guest_caps = VboxGuestCaps::new().expect("vboxd: failed to map GuestCaps");
let mut guest_caps = match VboxGuestCaps::new() {
Ok(value) => value,
Err(err) => {
eprintln!("vboxd: failed to map GuestCaps: {err}");
std::process::exit(1);
}
};
guest_caps.caps.write(1 << 2);
port.write(guest_caps.physical() as u32);
let mut set_mouse = VboxSetMouse::new().expect("vboxd: failed to map SetMouse");
let mut set_mouse = match VboxSetMouse::new() {
Ok(value) => value,
Err(err) => {
eprintln!("vboxd: failed to map SetMouse: {err}");
std::process::exit(1);
}
};
set_mouse.features.write(1 << 4 | 1);
port.write(set_mouse.physical() as u32);
@@ -265,34 +307,71 @@ fn daemon(daemon: daemon::Daemon, mut pcid_handle: PciFunctionHandle) -> ! {
}
}
let event_queue =
EventQueue::<Source>::new().expect("vboxd: Could not create event queue.");
let event_queue = match EventQueue::<Source>::new() {
Ok(queue) => queue,
Err(err) => {
eprintln!("vboxd: could not create event queue: {err}");
std::process::exit(1);
}
};
event_queue
.subscribe(
irq_file.as_raw_fd() as usize,
Source::Irq,
event::EventFlags::READ,
)
.unwrap();
.unwrap_or_else(|err| {
eprintln!("vboxd: failed to subscribe IRQ fd: {err}");
std::process::exit(1);
});
daemon.ready();
libredox::call::setrens(0, 0).expect("vboxd: failed to enter null namespace");
if let Err(err) = libredox::call::setrens(0, 0) {
eprintln!("vboxd: failed to enter null namespace: {err}");
std::process::exit(1);
}
let mut bga = crate::bga::Bga::new();
let get_mouse = VboxGetMouse::new().expect("vboxd: failed to map GetMouse");
let display_change = VboxDisplayChange::new().expect("vboxd: failed to map DisplayChange");
let ack_events = VboxAckEvents::new().expect("vboxd: failed to map AckEvents");
let get_mouse = match VboxGetMouse::new() {
Ok(value) => value,
Err(err) => {
eprintln!("vboxd: failed to map GetMouse: {err}");
std::process::exit(1);
}
};
let display_change = match VboxDisplayChange::new() {
Ok(value) => value,
Err(err) => {
eprintln!("vboxd: failed to map DisplayChange: {err}");
std::process::exit(1);
}
};
let ack_events = match VboxAckEvents::new() {
Ok(value) => value,
Err(err) => {
eprintln!("vboxd: failed to map AckEvents: {err}");
std::process::exit(1);
}
};
for Source::Irq in iter::once(Source::Irq)
.chain(event_queue.map(|e| e.expect("vboxd: failed to get next event").user_data))
{
for Source::Irq in iter::once(Source::Irq).chain(event_queue.map(|e| match e {
Ok(event) => event.user_data,
Err(err) => {
eprintln!("vboxd: failed to get next event: {err}");
std::process::exit(1);
}
})) {
let mut irq = [0; 8];
if irq_file.read(&mut irq).unwrap() >= irq.len() {
match irq_file.read(&mut irq) {
Ok(read) if read >= irq.len() => {
let host_events = vmmdev.host_events.read();
if host_events != 0 {
port.write(ack_events.physical() as u32);
irq_file.write(&irq).unwrap();
if let Err(err) = irq_file.write(&irq) {
eprintln!("vboxd: failed to acknowledge IRQ: {err}");
std::process::exit(1);
}
if host_events & VBOX_EVENT_DISPLAY == VBOX_EVENT_DISPLAY {
port.write(display_change.physical() as u32);
@@ -326,8 +405,14 @@ fn daemon(daemon: daemon::Daemon, mut pcid_handle: PciFunctionHandle) -> ! {
}
}
}
Ok(_) => {}
Err(err) => {
eprintln!("vboxd: failed to read IRQ file: {err}");
std::process::exit(1);
}
}
}
}
std::process::exit(0);
std::process::exit(1);
}
+8 -2
View File
@@ -11,7 +11,10 @@ pub fn enable_msix(pcid_handle: &mut PciFunctionHandle) -> Result<File, Error> {
// Extended message signaled interrupts.
let msix_info = match pcid_handle.feature_info(PciFeature::MsiX) {
PciFeatureInfo::MsiX(capability) => capability,
_ => unreachable!(),
_ => {
log::warn!("virtio_core::enable_msix: expected MSI-X feature info");
return Err(Error::Probe("unexpected PCI feature info for MSI-X"));
}
};
let mut info = unsafe { msix_info.map_and_mask_all(pcid_handle) };
@@ -21,7 +24,10 @@ pub fn enable_msix(pcid_handle: &mut PciFunctionHandle) -> Result<File, Error> {
let interrupt_handle = {
let table_entry_pointer = info.table_entry_pointer(MSIX_PRIMARY_VECTOR as usize);
let destination_id = read_bsp_apic_id().expect("virtio_core: `read_bsp_apic_id()` failed");
let destination_id = read_bsp_apic_id().map_err(|e| {
log::warn!("virtio_core::enable_msix: read_bsp_apic_id failed: {e}");
Error::Probe("read_bsp_apic_id failed")
})?;
let (msg_addr_and_data, interrupt_handle) =
allocate_single_interrupt_vector_for_msi(destination_id);
table_entry_pointer.write_addr_and_data(msg_addr_and_data);
+27 -19
View File
@@ -31,16 +31,16 @@ pub const MSIX_PRIMARY_VECTOR: u16 = 0;
/// before starting the device.
/// * Finally start the device (via [`StandardTransport::run_device`]). At this point, the device
/// is alive.
///
/// ## Panics
/// This function panics if the device is not a virtio device.
pub fn probe_device(pcid_handle: &mut PciFunctionHandle) -> Result<Device, Error> {
let pci_config = pcid_handle.config();
assert_eq!(
pci_config.func.full_device_id.vendor_id, 6900,
"virtio_core::probe_device: not a virtio device"
);
if pci_config.func.full_device_id.vendor_id != 6900 {
log::warn!(
"virtio_core::probe_device: skipping non-virtio device (vendor ID {:#06x})",
pci_config.func.full_device_id.vendor_id
);
return Err(Error::Probe("not a virtio device"));
}
let mut common_addr = None;
let mut notify_addr = None;
@@ -55,7 +55,9 @@ pub fn probe_device(pcid_handle: &mut PciFunctionHandle) -> Result<Device, Error
_ => continue,
}
let (addr, _) = pci_config.func.bars[capability.bar as usize].expect_mem();
let (addr, _) = pci_config.func.bars[capability.bar as usize]
.try_mem()
.map_err(|_| Error::Probe("BAR is not memory-mapped"))?;
let address = unsafe {
let addr = addr + capability.offset as usize;
@@ -100,19 +102,23 @@ pub fn probe_device(pcid_handle: &mut PciFunctionHandle) -> Result<Device, Error
device_addr = Some(address);
}
_ => unreachable!(),
_ => continue,
}
}
let common_addr = common_addr.expect("virtio common capability missing");
let device_addr = device_addr.expect("virtio device capability missing");
let (notify_addr, notify_multiplier) = notify_addr.expect("virtio notify capability missing");
let common_addr = common_addr.ok_or(Error::InCapable(CfgType::Common))?;
let device_addr = device_addr.ok_or(Error::InCapable(CfgType::Device))?;
let (notify_addr, notify_multiplier) =
notify_addr.ok_or(Error::InCapable(CfgType::Notify))?;
// FIXME this is explicitly allowed by the virtio specification to happen
assert!(
notify_multiplier != 0,
"virtio-core::device_probe: device uses the same Queue Notify addresses for all queues"
);
// The virtio specification explicitly allows a zero notify_off_multiplier,
// meaning all queues share the same notification address. Handle gracefully.
if notify_multiplier == 0 {
log::warn!(
"virtio_core::probe_device: device uses the same Queue Notify address for all queues"
);
return Err(Error::Probe("zero notify_off_multiplier"));
}
let common = unsafe { &mut *(common_addr as *mut CommonCfg) };
let device_space = unsafe { &mut *(device_addr as *mut u8) };
@@ -128,8 +134,10 @@ pub fn probe_device(pcid_handle: &mut PciFunctionHandle) -> Result<Device, Error
let all_pci_features = pcid_handle.fetch_all_features();
let has_msix = all_pci_features.iter().any(|feature| feature.is_msix());
// According to the virtio specification, the device REQUIRED to support MSI-X.
assert!(has_msix, "virtio: device does not support MSI-X");
if !has_msix {
log::warn!("virtio_core::probe_device: device does not support MSI-X");
return Err(Error::Probe("device does not support MSI-X"));
}
let irq_handle = crate::arch::enable_msix(pcid_handle)?;
log::debug!("virtio: using standard PCI transport");
@@ -197,9 +197,9 @@ impl ChainBuilder {
}
pub fn build(mut self) -> Vec<Buffer> {
let last_buffer = self.buffers.last_mut().expect("virtio-core: empty chain");
last_buffer.flags.remove(DescriptorFlags::NEXT);
if let Some(last_buffer) = self.buffers.last_mut() {
last_buffer.flags.remove(DescriptorFlags::NEXT);
}
self.buffers
}
}
+27 -9
View File
@@ -19,6 +19,8 @@ pub enum Error {
SyscallError(#[from] libredox::error::Error),
#[error("the device is incapable of {0:?}")]
InCapable(CfgType),
#[error("virtio probe: {0}")]
Probe(&'static str),
}
/// Returns the queue part sizes in bytes.
@@ -59,14 +61,23 @@ pub fn spawn_irq_thread(irq_handle: &File, queue: &Arc<Queue<'static>>) {
let queue_copy = queue.clone();
std::thread::spawn(move || {
let event_queue = RawEventQueue::new().unwrap();
let event_queue = match RawEventQueue::new() {
Ok(eq) => eq,
Err(err) => {
log::error!("virtio-core: failed to create event queue for IRQ thread: {err}");
return;
}
};
event_queue
.subscribe(irq_fd as usize, 0, event::EventFlags::READ)
.unwrap();
if let Err(err) = event_queue.subscribe(irq_fd as usize, 0, event::EventFlags::READ) {
log::error!("virtio-core: failed to subscribe to IRQ fd: {err}");
return;
}
for _ in event_queue.map(Result::unwrap) {
// Wake up the tasks waiting on the queue.
for event_result in event_queue.map(|res| res) {
if event_result.is_err() {
break;
}
for (_, task) in queue_copy.waker.lock().unwrap().iter() {
task.wake_by_ref();
}
@@ -604,7 +615,9 @@ impl Transport for StandardTransport<'_> {
// Re-read device status to ensure the `FEATURES_OK` bit is still set: otherwise,
// the device does not support our subset of features and the device is unusable.
let confirm = common.device_status.get();
assert!((confirm & DeviceStatusFlags::FEATURES_OK) == DeviceStatusFlags::FEATURES_OK);
if (confirm & DeviceStatusFlags::FEATURES_OK) != DeviceStatusFlags::FEATURES_OK {
log::error!("virtio-core: device rejected feature set (FEATURES_OK cleared after negotiation)");
}
}
fn setup_config_notify(&self, vector: u16) {
@@ -640,7 +653,10 @@ impl Transport for StandardTransport<'_> {
// Set the MSI-X vector.
common.queue_msix_vector.set(vector);
assert!(common.queue_msix_vector.get() == vector);
if common.queue_msix_vector.get() != vector {
log::error!("virtio-core: MSI-X vector {vector:#x} was not accepted by device for queue {queue_index}");
return Err(Error::SyscallError(libredox::error::Error::new(libredox::errno::EIO)));
}
// Enable the queue.
common.queue_enable.set(1);
@@ -685,7 +701,9 @@ impl Transport for StandardTransport<'_> {
// Set the MSI-X vector.
common.queue_msix_vector.set(queue.vector);
assert!(common.queue_msix_vector.get() == queue.vector);
if common.queue_msix_vector.get() != queue.vector {
log::error!("virtio-core: MSI-X vector {:#x} was not accepted during reinit for queue {}", queue.vector, queue.queue_index);
}
// Enable the queue.
common.queue_enable.set(1);
+3
View File
@@ -0,0 +1,3 @@
[unit]
description = "Boot essential services target"
requires_weak = ["00_base.target"]
+3
View File
@@ -0,0 +1,3 @@
[unit]
description = "Boot late stage target"
requires_weak = ["05_boot_essential.target"]
+8
View File
@@ -0,0 +1,8 @@
[unit]
description = "D-Bus system bus"
requires_weak = ["12_boot_late.target", "00_ipcd.service"]
[service]
cmd = "dbus-daemon"
args = ["--system", "--nopidfile"]
type = "oneshot_async"
+8
View File
@@ -0,0 +1,8 @@
[unit]
description = "seatd seat management"
requires_weak = ["12_dbus.service"]
[service]
cmd = "/usr/bin/seatd"
args = ["-l", "info"]
type = "oneshot_async"
+8
View File
@@ -0,0 +1,8 @@
[unit]
description = "Activate console VT"
requires_weak = ["00_base.target"]
[service]
cmd = "inputd"
args = ["-A", "2"]
type = "oneshot_async"
+8
View File
@@ -0,0 +1,8 @@
[unit]
description = "Console getty on VT2"
requires_weak = ["29_activate_console.service"]
[service]
cmd = "getty"
args = ["2"]
type = "oneshot_async"
+7
View File
@@ -0,0 +1,7 @@
[unit]
description = "CPU Thermal Monitor"
requires_weak = ["00_base.target"]
[service]
cmd = "thermald"
type = "oneshot_async"
+8
View File
@@ -0,0 +1,8 @@
[unit]
description = "Debug console on VT3"
requires_weak = ["29_activate_console.service"]
[service]
cmd = "getty"
args = ["3"]
type = "oneshot_async"
+8
View File
@@ -0,0 +1,8 @@
[unit]
description = "DRM/KMS Display Driver"
requires_weak = ["20_graphics.target", "40_hwd.service", "40_pcid-spawner-initfs.service"]
condition_architecture = ["x86", "x86_64"]
[service]
cmd = "redox-drm"
type = "notify"
+2
View File
@@ -3,8 +3,10 @@ description = "Initfs drivers"
requires_weak = [
"10_lived.service",
"20_graphics.target",
"40_pcid.service",
"40_ps2d.service",
"40_bcm2835-sdhcid.service",
"40_hwd.service",
"40_pcid-spawner-initfs.service",
"41_acpid.service",
]
+1 -1
View File
@@ -1,6 +1,6 @@
[unit]
description = "Hardware manager"
requires_weak = ["10_inputd.service", "10_lived.service", "20_graphics.target"]
requires_weak = ["10_inputd.service", "10_lived.service", "20_graphics.target", "40_pcid.service", "41_acpid.service"]
[service]
cmd = "hwd"
+1 -1
View File
@@ -1,6 +1,6 @@
[unit]
description = "PCI driver spawner"
requires_weak = ["10_inputd.service", "20_graphics.target", "40_hwd.service"]
requires_weak = ["10_inputd.service", "20_graphics.target", "40_pcid.service"]
[service]
cmd = "pcid-spawner"
+7
View File
@@ -0,0 +1,7 @@
[unit]
description = "PCI daemon"
requires_weak = ["41_acpid.service"]
[service]
cmd = "pcid"
type = "notify"
+8
View File
@@ -0,0 +1,8 @@
[unit]
description = "ACPI daemon"
default_dependencies = false
[service]
cmd = "acpid"
inherit_envs = ["RSDP_ADDR", "RSDP_SIZE"]
type = "notify"
+8
View File
@@ -0,0 +1,8 @@
[unit]
description = "USB Mass Storage Driver"
requires_weak = ["40_drivers.target"]
condition_architecture = ["x86", "x86_64"]
[service]
cmd = "usbscsid"
type = "notify"
+27
View File
@@ -0,0 +1,27 @@
pub fn status_ok(msg: &str) {
eprintln!("[ OK ] {msg}");
}
pub fn status_fail(msg: &str) {
eprintln!("[ FAILED ] {msg}");
}
pub fn status_skip(msg: &str) {
eprintln!("[ SKIP ] {msg}");
}
pub fn init_error(msg: &str) {
eprintln!("init: {msg}");
}
pub fn init_warn(msg: &str) {
eprintln!("init: {msg}");
}
pub fn init_info(msg: &str) {
eprintln!("init: {msg}");
}
pub fn init_debug(msg: &str) {
eprintln!("init: {msg}");
}
+25 -23
View File
@@ -8,11 +8,14 @@ use libredox::flag::{O_RDONLY, O_WRONLY};
use crate::scheduler::Scheduler;
use crate::unit::{UnitId, UnitStore};
mod color;
mod scheduler;
mod script;
mod service;
mod unit;
use crate::color::{init_error, init_warn, status_fail, status_ok};
fn switch_stdio(stdio: &str) -> io::Result<()> {
let stdin = libredox::Fd::open(stdio, O_RDONLY, 0)?;
let stdout = libredox::Fd::open(stdio, O_WRONLY, 0)?;
@@ -49,11 +52,7 @@ impl InitConfig {
}
fn switch_root(unit_store: &mut UnitStore, config: &mut InitConfig, prefix: &Path, etcdir: &Path) {
eprintln!(
"init: switchroot to {} {}",
prefix.display(),
etcdir.display()
);
status_ok(&format!("switchroot to {} {}", prefix.display(), etcdir.display()));
config
.envs
@@ -79,10 +78,7 @@ fn switch_root(unit_store: &mut UnitStore, config: &mut InitConfig, prefix: &Pat
continue;
}
let Some((key, value)) = env.split_once('=') else {
eprintln!(
"init: failed to parse env line from {}: {env:?}",
file.display(),
);
init_warn(&format!("failed to parse env line from {}: {:?}", file.display(), env));
continue;
};
config
@@ -91,23 +87,18 @@ fn switch_root(unit_store: &mut UnitStore, config: &mut InitConfig, prefix: &Pat
}
}
Err(err) => {
eprintln!(
"init: failed to read environment from {}: {err}",
file.display(),
);
init_error(&format!("failed to read environment from {}: {}", file.display(), err));
}
}
}
}
Err(err) => {
eprintln!(
"init: failed to read environments from {}: {err}",
init_error(&format!("failed to read environments from {}: {}",
env_dirs
.iter()
.map(|dir| dir.display().to_string())
.collect::<Vec<_>>()
.join(", ")
);
.join(", "), err));
}
}
}
@@ -134,7 +125,7 @@ fn main() {
.schedule_start_and_report_errors(&mut unit_store, UnitId("00_logd.service".to_owned()));
scheduler.step(&mut unit_store, &mut init_config);
if let Err(err) = switch_stdio("/scheme/log") {
eprintln!("init: failed to switch stdio to '/scheme/log': {err}");
init_error(&format!("failed to switch stdio to '/scheme/log': {}", err));
}
let runtime_target = UnitId("00_runtime.target".to_owned());
@@ -158,15 +149,13 @@ fn main() {
let entries = match config::config_for_dirs(&unit_store.config_dirs) {
Ok(entries) => entries,
Err(err) => {
eprintln!(
"init: failed to read configs from {}: {err}",
init_error(&format!("failed to read configs from {}: {}",
unit_store
.config_dirs
.iter()
.map(|dir| dir.display().to_string())
.collect::<Vec<_>>()
.join(", ")
);
.join(", "), err));
return;
}
};
@@ -210,7 +199,20 @@ fn main() {
}
loop {
// Process any pending jobs whose dependencies may now be satisfied.
scheduler.step(&mut unit_store, &mut init_config);
// Block on waitpid so the loop only runs when a child state
// changes (exit, signal, stop). The previous WNOHANG busy-loop
// produced RB_OPEN_DIAG spam from relibc because each loop
// iteration re-attempted the /scheme/debug/no-preserve trace
// open before any real work had a chance to schedule. Blocking
// here is the correct idle behaviour: the kernel wakes us up
// when there is something to do.
let mut status = 0;
libredox::call::waitpid(0, &mut status, 0).unwrap();
match libredox::call::waitpid(0, &mut status, 0) {
Ok(_pid) => {}
Err(err) => init_error(&format!("waitpid error: {}", err)),
}
}
}
+11 -12
View File
@@ -2,6 +2,7 @@ use std::collections::{BTreeMap, VecDeque};
use std::io::Write;
use crate::InitConfig;
use crate::color::{init_debug, init_error, init_info, status_ok, status_skip};
use crate::unit::{Unit, UnitId, UnitKind, UnitStore};
pub struct Scheduler {
@@ -32,7 +33,7 @@ impl Scheduler {
let mut errors = vec![];
self.schedule_start(unit_store, unit_id, &mut errors);
for error in errors {
eprintln!("init: {error}");
init_error(&format!("{}", error));
}
}
@@ -68,6 +69,7 @@ impl Scheduler {
match job.kind {
JobKind::Start => {
let unit = unit_store.unit_mut(&job.unit);
eprintln!("init: DBG job={}", job.unit.0);
let mut blocked = false;
for dep in &unit.info.requires_weak {
@@ -107,31 +109,28 @@ fn run(unit: &mut Unit, config: &mut InitConfig) {
UnitKind::LegacyScript { script } => {
for cmd in script.clone() {
if config.log_debug {
eprintln!("init: running: {cmd:?}");
init_debug(&format!("running: {cmd:?}"));
}
cmd.run(config);
}
}
UnitKind::Service { service } => {
let desc = unit.info.description.as_ref().unwrap_or(&unit.id.0);
if config.skip_cmd.contains(&service.cmd) {
eprintln!("Skipping '{} {}'", service.cmd, service.args.join(" "));
status_skip(&format!("Skipping {} ({})", desc, service.cmd));
return;
}
if config.log_debug {
eprintln!(
"Starting {} ({})",
unit.info.description.as_ref().unwrap_or(&unit.id.0),
service.cmd,
);
init_info(&format!("Starting {} ({})", desc, service.cmd));
} else {
status_ok(&format!("Started {}", desc));
}
service.spawn(&config.envs);
}
UnitKind::Target {} => {
if config.log_debug {
eprintln!(
"Reached target {}",
unit.info.description.as_ref().unwrap_or(&unit.id.0),
);
init_info(&format!("Reached target {}",
unit.info.description.as_ref().unwrap_or(&unit.id.0)));
}
}
}
+72 -20
View File
@@ -1,13 +1,15 @@
use std::collections::{BTreeMap, BTreeSet};
use std::ffi::OsString;
use std::io::Read;
use std::os::fd::{AsRawFd, OwnedFd};
use std::fs::File;
use std::io::{self, Read, Write};
use std::os::fd::{AsRawFd, FromRawFd, OwnedFd};
use std::os::unix::process::CommandExt;
use std::process::Command;
use std::{env, io};
use std::env;
use serde::Deserialize;
use crate::color::{init_error, init_warn, status_fail};
use crate::script::subst_env;
#[derive(Clone, Debug, Deserialize)]
@@ -34,8 +36,28 @@ pub enum ServiceType {
OneshotAsync,
}
fn create_pipe() -> io::Result<(File, OwnedFd)> {
let mut fds = [0i32; 2];
// Use libc::pipe2() which goes through relibc's FILETABLE-managed path
// (FdGuard::open → SYS_OPENAT_INTO), keeping the userspace file table in
// sync with the kernel's file table. Using raw syscall::openat()
// (SYS_OPENAT) here would bypass the FILETABLE and create phantom fds
// that later cause EEXIST collisions when relibc's own pipe2() (called
// during Command::spawn fork+exec) tries to insert at a position the
// FILETABLE incorrectly thinks is free.
let ret = unsafe { libc::pipe2(fds.as_mut_ptr(), libc::O_CLOEXEC) };
if ret != 0 {
return Err(io::Error::last_os_error());
}
let rd = unsafe { File::from_raw_fd(fds[0]) };
let wr = unsafe { OwnedFd::from_raw_fd(fds[1]) };
Ok((rd, wr))
}
impl Service {
pub fn spawn(&self, base_envs: &BTreeMap<String, OsString>) {
eprintln!("init: service {} type={:?}", self.cmd, self.type_);
let _ = io::stderr().flush();
let mut command = Command::new(&self.cmd);
command.args(self.args.iter().map(|arg| subst_env(arg)));
command.env_clear();
@@ -46,30 +68,54 @@ impl Service {
}
command.envs(base_envs).envs(&self.envs);
let (mut read_pipe, write_pipe) = io::pipe().unwrap();
let (mut read_pipe, write_pipe) = create_pipe()
.unwrap_or_else(|e| panic!("pipe() failed in service.spawn for {}: {}", self.cmd, e));
eprintln!("init: {} pipe created read_pipe={}", self.cmd, read_pipe.as_raw_fd());
let _ = io::stderr().flush();
unsafe { pass_fd(&mut command, "INIT_NOTIFY", write_pipe.into()) };
eprintln!("init: {} pass_fd done", self.cmd);
let _ = io::stderr().flush();
let mut child = match command.spawn() {
Ok(child) => child,
Ok(child) => {
eprintln!("init: {} spawned pid=??", self.cmd);
let _ = io::stderr().flush();
child
},
Err(err) => {
eprintln!("init: failed to execute {:?}: {}", command, err);
status_fail(&format!("failed to execute {:?}: {}", command, err));
return;
}
};
eprintln!("init: {} entering match type={:?}", self.cmd, self.type_);
let _ = io::stderr().flush();
match &self.type_ {
ServiceType::Notify => match read_pipe.read_exact(&mut [0]) {
Ok(()) => {}
Err(err) if err.kind() == io::ErrorKind::UnexpectedEof => {
eprintln!("init: {command:?} exited without notifying readiness");
ServiceType::Notify => {
eprintln!("init: {} is Notify, waiting for byte", self.cmd);
let _ = io::stderr().flush();
match read_pipe.read_exact(&mut [0]) {
Ok(()) => {}
Err(err) if err.kind() == io::ErrorKind::UnexpectedEof => {
init_warn(&format!("{:?} exited without notifying readiness", command));
}
Err(err) => {
init_error(&format!("failed to wait for {:?}: {}", command, err));
}
}
Err(err) => {
eprintln!("init: failed to wait for {command:?}: {err}");
}
},
}
ServiceType::Scheme(scheme) => {
eprintln!("init: SCHEME {} waiting for fd on read_pipe={}", self.cmd, read_pipe.as_raw_fd());
let _ = io::stderr().flush();
init_warn(&format!(
"init: waiting for scheme fd from {:?}, read_pipe={}",
command,
read_pipe.as_raw_fd()
));
let mut new_fd = usize::MAX;
loop {
eprintln!("init: calling call_ro for {}", self.cmd);
let _ = io::stderr().flush();
match syscall::call_ro(
read_pipe.as_raw_fd() as usize,
unsafe { plain::as_mut_bytes(&mut new_fd) },
@@ -80,16 +126,22 @@ impl Service {
errno: syscall::EINTR,
}) => continue,
Ok(0) => {
eprintln!("init: {command:?} exited without notifying readiness");
init_warn(&format!("{:?} exited without notifying readiness", command));
return;
}
Ok(1) => break,
Ok(1) => {
init_warn(&format!(
"init: received scheme fd {} from {:?}, registering as {}",
new_fd, command, scheme
));
break;
}
Ok(n) => {
eprintln!("init: incorrect amount of fds {n} returned");
init_error(&format!("incorrect amount of fds {} returned", n));
return;
}
Err(err) => {
eprintln!("init: failed to wait for {command:?}: {err}");
init_error(&format!("failed to wait for {:?}: {}", command, err));
return;
}
}
@@ -104,11 +156,11 @@ impl Service {
match child.wait() {
Ok(exit_status) => {
if !exit_status.success() {
eprintln!("init: {command:?} failed with {exit_status}");
status_fail(&format!("{:?} failed with {}", command, exit_status));
}
}
Err(err) => {
eprintln!("init: failed to wait for {:?}: {}", command, err)
init_error(&format!("failed to wait for {:?}: {}", command, err))
}
}
}
View File
+29 -21
View File
@@ -180,7 +180,7 @@ pub struct Socket {
options: HashSet<i32>,
flags: usize,
state: State,
awaiting: VecDeque<usize>,
awaiting: VecDeque<(usize, ucred)>,
connection: Option<Connection>,
issued_token: Option<u64>,
ucred: ucred,
@@ -245,6 +245,7 @@ impl Socket {
&mut self,
primary_id: usize,
awaiting_client_id: usize,
client_ucred: ucred,
ctx: &CallerCtx,
) -> Result<Self> {
if !self.is_listening() {
@@ -254,15 +255,19 @@ impl Socket {
);
return Err(Error::new(EINVAL));
}
Ok(Self::new(
Ok(Self {
primary_id,
self.path.clone(),
State::Established,
self.options.clone(),
self.flags,
Some(Connection::new(awaiting_client_id)),
ctx,
))
path: self.path.clone(),
state: State::Established,
options: self.options.clone(),
flags: self.flags,
awaiting: VecDeque::new(),
connection: Some(Connection::new(awaiting_client_id)),
issued_token: None,
ucred: client_ucred,
sndbuf: self.sndbuf,
rcvbuf: self.rcvbuf,
})
}
fn establish(&mut self, new_socket: &mut Self, peer: usize) -> Result<()> {
@@ -290,7 +295,7 @@ impl Socket {
Ok(())
}
fn connect(&mut self, other: &mut Socket) -> Result<()> {
fn connect(&mut self, other: &mut Socket, client_ucred: ucred) -> Result<()> {
match self.state {
State::Unbound | State::Bound => {
// If the socket is unbound or bound, wait for the listener to start listening.
@@ -306,12 +311,12 @@ impl Socket {
}
_ => return Err(Error::new(ECONNREFUSED)),
}
self.connect_unchecked(other);
self.connect_unchecked(other, client_ucred);
Ok(())
}
fn connect_unchecked(&mut self, other: &mut Socket) {
self.awaiting.push_back(other.primary_id);
fn connect_unchecked(&mut self, other: &mut Socket, client_ucred: ucred) {
self.awaiting.push_back((other.primary_id, client_ucred));
other.state = State::Connecting;
other.connection = Some(Connection::new(self.primary_id));
}
@@ -499,7 +504,7 @@ impl<'sock> UdsStreamScheme<'sock> {
};
match verb {
SocketCall::Bind => self.handle_bind(id, &payload),
SocketCall::Connect => self.handle_connect(id, &payload),
SocketCall::Connect => self.handle_connect(id, &payload, ctx),
SocketCall::SetSockOpt => self.handle_setsockopt(
id,
*metadata.get(1).ok_or(Error::new(EINVAL))? as i32,
@@ -592,7 +597,7 @@ impl<'sock> UdsStreamScheme<'sock> {
// and changes its own state to `Established`.
//
// After these three phases, the socket connection is considered established.
fn handle_connect(&mut self, id: usize, token_buf: &[u8]) -> Result<usize> {
fn handle_connect(&mut self, id: usize, token_buf: &[u8], ctx: &CallerCtx) -> Result<usize> {
let token = read_num::<u64>(token_buf)?;
let (listener_id, connecting_res) = {
let listener_rc = self
@@ -637,7 +642,8 @@ impl<'sock> UdsStreamScheme<'sock> {
}
// Phase 2: listener is now listening
listener.connect(&mut client)?;
let client_ucred = ucred { pid: ctx.pid as _, uid: ctx.uid as _, gid: ctx.gid as _ };
listener.connect(&mut client, client_ucred)?;
(listener_id, connecting_res)
};
@@ -886,6 +892,7 @@ impl<'sock> UdsStreamScheme<'sock> {
&mut self,
listener_socket: &mut Socket,
client_id: usize,
client_ucred: ucred,
ctx: &CallerCtx,
) -> Result<Option<OpenResult>> {
let (new_id, new) = {
@@ -893,7 +900,7 @@ impl<'sock> UdsStreamScheme<'sock> {
return Ok(None); // Client socket has been closed, nothing to accept
};
let new_id = self.next_id;
let mut new = listener_socket.accept(new_id, client_id, ctx)?;
let mut new = listener_socket.accept(new_id, client_id, client_ucred, ctx)?;
let mut client_socket = client_rc.borrow_mut();
client_socket.establish(&mut new, listener_socket.primary_id)?;
@@ -925,14 +932,14 @@ impl<'sock> UdsStreamScheme<'sock> {
}
loop {
// Try to accept a waiting connection
let Some(client_id) = socket.awaiting.pop_front() else {
let Some((client_id, client_ucred)) = socket.awaiting.pop_front() else {
if flags & O_NONBLOCK == O_NONBLOCK {
return Err(Error::new(EAGAIN));
} else {
return Err(Error::new(EWOULDBLOCK));
}
};
return match self.accept_connection(socket, client_id, ctx) {
return match self.accept_connection(socket, client_id, client_ucred, ctx) {
Ok(conn) => Ok(conn),
Err(Error { errno: EAGAIN }) => continue,
Err(e) => Err(e),
@@ -1004,7 +1011,8 @@ impl<'sock> UdsStreamScheme<'sock> {
);
return Err(Error::new(EPIPE));
}
socket.connect_unchecked(&mut new);
let pair_ucred = ucred { pid: ctx.pid as _, uid: ctx.uid as _, gid: ctx.gid as _ };
socket.connect_unchecked(&mut new, pair_ucred);
}
// smoltcp sends writeable whenever a listener gets a
@@ -1199,7 +1207,7 @@ impl<'sock> UdsStreamScheme<'sock> {
}
// Notify all waiting clients about listener closure
for client_id in &socket.awaiting {
for (client_id, _) in &socket.awaiting {
if let Ok(client_rc) = self.get_socket(*client_id) {
{
let mut client = client_rc.borrow_mut();
+8 -2
View File
@@ -11,9 +11,15 @@ fn daemon(daemon: daemon::SchemeDaemon) -> ! {
let mut scheme = LogScheme::new(&socket);
let handler = Blocking::new(&socket, 16);
let _ = daemon.ready_sync_scheme(&socket, &mut scheme);
match daemon.ready_sync_scheme(&socket, &mut scheme) {
Ok(()) => eprintln!("logd: ready_sync_scheme succeeded"),
Err(err) => eprintln!("logd: ready_sync_scheme failed: {err}"),
}
libredox::call::setrens(0, 0).expect("logd: failed to enter null namespace");
match libredox::call::setrens(0, 0) {
Ok(_) => {}
Err(err) => eprintln!("logd: warning: failed to enter null namespace: {err}"),
}
handler
.process_requests_blocking(scheme)
+16
View File
@@ -41,14 +41,30 @@ impl<'sock> LogScheme<'sock> {
let mut kernel_sys_log = std::fs::File::open("/scheme/sys/log").unwrap();
let _ = std::fs::create_dir_all("/var/log");
let persistent_log: Option<File> = OpenOptions::new()
.create(true)
.append(true)
.open("/var/log/system.log")
.ok();
let (output_tx, output_rx) = mpsc::channel::<OutputCmd>();
std::thread::spawn(move || {
let mut files: Vec<File> = vec![];
let mut logs = VecDeque::new();
let mut persistent = persistent_log;
if let Some(ref mut f) = persistent {
let _ = f.write(b"--- logd started ---
");
}
for cmd in output_rx {
match cmd {
OutputCmd::Log(line) => {
if let Some(ref mut f) = persistent {
let _ = f.write(&line);
let _ = f.flush();
}
for file in &mut files {
let _ = file.write(&line);
let _ = file.flush();
+9
View File
@@ -0,0 +1,9 @@
pub const ITR_LOW_LATENCY: u32 = 64; pub const ITR_BULK: u32 = 256; pub const ITR_DEFAULT: u32 = 800;
#[derive(Clone,Copy,PartialEq)] pub enum ItrState { LowLatency, Moderate, Bulk }
pub struct ItrTracker { state: ItrState, current_itr: u32, packets_since_update: u32 }
impl ItrTracker { pub const fn new() -> Self { Self { state: ItrState::LowLatency, current_itr: ITR_LOW_LATENCY, packets_since_update: 0 } }
pub fn record_packet(&mut self, bytes: usize) { self.packets_since_update += 1; let _ = bytes; }
pub fn update(&mut self) -> u32 { let new_state = if self.packets_since_update < 8 { ItrState::LowLatency } else if self.packets_since_update < 64 { ItrState::Moderate } else { ItrState::Bulk };
if new_state != self.state { self.state = new_state; self.current_itr = match self.state { ItrState::LowLatency => ITR_LOW_LATENCY, ItrState::Moderate => ITR_DEFAULT, ItrState::Bulk => ITR_BULK }; }
self.packets_since_update = 0; self.current_itr }
pub fn current_itr(&self) -> u32 { self.current_itr } }
+5
View File
@@ -0,0 +1,5 @@
#[derive(Clone,Copy,PartialEq,Debug)] pub enum ChipVersion { Rtl8168b, Rtl8168c, Rtl8168cp, Rtl8168d, Rtl8168dp, Rtl8168e, Rtl8168evl, Rtl8168f, Rtl8168g, Rtl8168h, Rtl8168ep, Unknown }
pub fn identify_chip(rev: u8, mac0: u32, _m1: u32, _m2: u32, _m3: u32, _m4: u32) -> ChipVersion { match ((mac0>>20)&0x7, rev) { (0,_)=>ChipVersion::Rtl8168b, (1,0x00..=0x01)=>ChipVersion::Rtl8168c, (1,0x02)=>ChipVersion::Rtl8168cp, (2,_)=>ChipVersion::Rtl8168d, (3,r) if r<=0x02=>ChipVersion::Rtl8168e, (3,_)=>ChipVersion::Rtl8168evl, (4,_)=>ChipVersion::Rtl8168f, (5,_)=>ChipVersion::Rtl8168g, (6,_)=>ChipVersion::Rtl8168h, (7,_)=>ChipVersion::Rtl8168ep, _=>ChipVersion::Unknown } }
pub mod phy_regs { pub const BMCR: u32 = 0x00; pub const BMSR: u32 = 0x01; pub const BMCR_RESET: u16 = 1<<15; pub const BMCR_AUTONEG_ENABLE: u16 = 1<<12; pub const BMSR_LINK_STATUS: u16 = 1<<2; }
pub fn phy_link_up(read: &dyn Fn(u32)->u16) -> bool { read(phy_regs::BMSR) & phy_regs::BMSR_LINK_STATUS != 0 }
pub fn phy_reset(write: &dyn Fn(u32,u16), read: &dyn Fn(u32)->u16) -> bool { write(phy_regs::BMCR, phy_regs::BMCR_RESET); for _ in 0..500 { if read(phy_regs::BMCR) & phy_regs::BMCR_RESET == 0 { return true; } } false }
+12
View File
@@ -0,0 +1,12 @@
use core::sync::atomic::{AtomicU32, Ordering};
pub const NCQ_MAX_DEPTH: usize = 32;
pub struct NcqState { pub sactive: AtomicU32, pub pending: AtomicU32 }
impl NcqState { pub const fn new() -> Self { Self { sactive: AtomicU32::new(0), pending: AtomicU32::new(0) } }
pub fn allocate_tag(&self) -> Option<u32> { let active = self.pending.load(Ordering::Acquire); let free = !active; if free == 0 { return None; } let tag = free.trailing_zeros(); let mask = 1u32 << tag; self.pending.fetch_or(mask, Ordering::AcqRel); self.sactive.fetch_or(mask, Ordering::AcqRel); Some(tag) }
pub fn complete_tag(&self, tag: u32) { let mask = 1u32 << tag; self.sactive.fetch_and(!mask, Ordering::AcqRel); self.pending.fetch_and(!mask, Ordering::AcqRel); }
pub fn has_pending(&self) -> bool { self.pending.load(Ordering::Acquire) != 0 } }
pub fn build_ncq_read_fis(tag: u32, lba: u64, sector_count: u16) -> [u32; 5] { let mut f = [0u32;5]; f[0]=0x0000_8027; f[1]=0x0060|((sector_count as u32&0xFF)<<24); f[2]=(lba as u32&0xFF)|(((lba>>8) as u32&0xFF)<<8); let mid=((lba>>16)as u32&0xFF)|((tag&0x1F)<<3); f[3]=mid|(((lba>>24)as u32&0xFF)<<8)|(((lba>>32)as u32&0xFF)<<16)|(((lba>>40)as u32&0xFF)<<24); f[4]=(((sector_count>>8)as u32&0xFF)<<16)|(((sector_count>>8)as u32&0xFF)<<24); f }
pub fn build_ncq_write_fis(tag: u32, lba: u64, sector_count: u16) -> [u32; 5] { let mut f = build_ncq_read_fis(tag,lba,sector_count); f[1]=(f[1]&!0xFF00)|0x6100; f }
pub fn process_ncq_completions(old_sactive: u32, new_sactive: u32, ncq: &NcqState, completed: &mut [u32;NCQ_MAX_DEPTH]) -> usize { let mask = old_sactive & !new_sactive; if mask == 0 { return 0; } let mut count = 0; let mut m = mask; while m != 0 { let tag = m.trailing_zeros(); ncq.complete_tag(tag); completed[count]=tag; count+=1; m&=m-1; } count }
pub fn drive_supports_ncq(id: &[u16;256]) -> bool { id.get(76).map_or(false, |w| w&(1<<8)!=0) }
pub fn ncq_queue_depth(id: &[u16;256]) -> u32 { id.get(75).map_or(1, |w| { let d = (w&0x1F) as u32; if d>0 {(d+1).min(NCQ_MAX_DEPTH as u32)} else {1} }) }