Commit Graph

20 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 200ba82e57 initfs: Actually use Length newtype 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 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 c611054bbd initfs: Move archive-common package into initfs-tools 2026-02-17 20:54:10 +01:00
bjorn3 d5ff91f248 Support mmap in initfs 2025-12-12 21:45:10 +01: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