Commit Graph

35 Commits

Author SHA1 Message Date
Red Bear OS 7d40dff006 base: fix round-8 deferred stubs in initfs, randd, ptyd
initfs/tools: buffer inode table writes in memory and flush with a
  single write_all_at instead of one syscall per inode header.

randd: build a proper entropy pool using SHA-256 that mixes hardware RNG
  (RDRAND/RNDRRS) with timing-derived entropy. The pool is re-seeded
  every 4096 reads and on every write. User-supplied entropy from writes
  is added to the pool rather than directly replacing the PRNG state.

ptyd: VLNEXT now properly quotes the next input byte — sets a flag that
  causes the next byte to bypass all control-character processing and be
  pushed directly to the line buffer. VDISCARD now flushes the cooked
  input buffer instead of being a silent no-op.
2026-07-27 09:16:33 +09:00
Red Bear OS 4ba511830f logd/ipcd/initfs: fix WARNING-level stubs and error handling
logd scheme.rs:
- Kernel log reader: don't break loop on 0-byte read. /scheme/sys/log
  presents a snapshot; breaking loses all future entries. Now polls
  with a 50ms sleep on drain, continuing to capture new kernel logs.
  Also slice buffer to actual bytes read to avoid processing stale data.
- read(): return EBADF instead of silent Ok(0) stub. Logd handles are
  write-only sinks; reading is not a valid operation.
- fcntl(): return ENOSYS instead of silent Ok(0). No fcntl operations
  are implemented for log handles.
- fsync(): remove TODO comment; behavior (Ok(())) is correct since the
  output channel guarantees FIFO delivery.

ipcd uds/stream.rs:
- events(): remove 'TODO: block on write buffer'. Backpressure is now
  applied at the scheme level.
- fevent(): filter EVENT_WRITE based on peer receive buffer fullness
  against sender's SO_SNDBUF. Prevents busy-spin when buffer is full.
- write_inner(): check backpressure before accepting data. Return
  EAGAIN (non-blocking) or EWOULDBLOCK (blocking) when peer buffer
  would exceed SO_SNDBUF limit. Only applies to established connections.
- handle_sendmsg(): same backpressure check for sendmsg path.

initfs tools/src/lib.rs:
- Replace hardcoded PAGE_SIZE=4096 constant with runtime detection via
  sysconf(_SC_PAGESIZE). Handles 16K/64K page ARM hardware correctly.
  Falls back to 4096 with logged warning if sysconf fails or returns
  an invalid value.
2026-07-27 08:23:43 +09: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
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
bjorn3 cdf45983fa initfs: Hard code creation time
This improves reproducibility of the initfs.
2026-04-26 12:16:30 +02: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
auronandace 557a3d1954 consolidate several dependencies into the workspace 2026-03-22 15:11:33 +00:00
auronandace 2f0f5160bb update clap for usbctl 2026-03-22 09:45:09 +00:00
Ribbon 90ea974ce0 Add missing Cargo package description and update drivers README 2026-03-16 10:39:15 -06:00
auronandace 5ffce47607 add clippy precedence lint 2026-02-20 13:43:48 +00: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 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
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 2d672b7cd9 Add anyhow to workspace 2026-01-29 10:47:45 -07:00
Jeremy Soller f740b61774 Use workspace dependencies for many common crates 2026-01-20 10:12:08 -07:00
bjorn3 d5ff91f248 Support mmap in initfs 2025-12-12 21:45:10 +01:00
Wildan Mubarok fde6dab626 Increase initfs in debug build 2025-08-01 06:00:53 +00:00
bjorn3 7655b09d33 Add initfs to the main workspace 2025-05-20 20:34:59 +02: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