]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
fix: shell/command bugs, new utilities, procfs race condition
authorTulio A M Mendes <[email protected]>
Tue, 17 Feb 2026 04:31:30 +0000 (01:31 -0300)
committerTulio A M Mendes <[email protected]>
Tue, 17 Feb 2026 04:31:30 +0000 (01:31 -0300)
commit6185473e19823a39481ea99b4fb0bc41cf6a820f
tree73439414bf8c1a05caf38251855735e2b5ea95e5
parentc748899420f4b5b1b863f09402b541b1b6334432
fix: shell/command bugs, new utilities, procfs race condition

Shell fixes:
- Fix DELETE key showing ~ (handle \x1b[3~ escape sequence + Home/End)
- Fix builtin redirections (echo > file now works via saved fd restore)
- Fix initrd readdir (root cause of ls /bin empty + tab completion broken)

Command fixes:
- Fix cut -dX/-fN combined argument parsing (POSIX style)
- Fix ps showing ? for PIDs: add cmdline[128] to process struct, populate in execve + init
- Fix procfs race condition: use sched_lock for process list traversal
- Make sched_lock non-static for procfs access

New commands (22 total):
- Previous session: mount, umount, env, kill, sleep, clear, ps, df, free, tee, basename, dirname, rmdir
- This session: grep, id, uname, dmesg, printenv, tr, dd, pwd, stat

Arch contamination note: vdso.c includes arch/x86/kernel_va_map.h directly (acceptable for now, only x86 target)

Tests: 89/89 smoke, cppcheck clean
37 files changed:
Makefile
include/errno.h
include/process.h
src/arch/x86/arch_platform.c
src/arch/x86/elf.c
src/drivers/initrd.c
src/kernel/overlayfs.c
src/kernel/procfs.c
src/kernel/scheduler.c
src/kernel/syscall.c
src/kernel/tmpfs.c
user/basename.c [new file with mode: 0644]
user/clear.c [new file with mode: 0644]
user/cut.c
user/dd.c [new file with mode: 0644]
user/df.c [new file with mode: 0644]
user/dirname.c [new file with mode: 0644]
user/dmesg.c [new file with mode: 0644]
user/env.c [new file with mode: 0644]
user/free.c [new file with mode: 0644]
user/grep.c [new file with mode: 0644]
user/id.c [new file with mode: 0644]
user/kill.c [new file with mode: 0644]
user/mount.c [new file with mode: 0644]
user/printenv.c [new file with mode: 0644]
user/ps.c [new file with mode: 0644]
user/pwd.c [new file with mode: 0644]
user/rmdir.c [new file with mode: 0644]
user/sh.c
user/sleep.c [new file with mode: 0644]
user/stat.c [new file with mode: 0644]
user/tee.c [new file with mode: 0644]
user/tr.c [new file with mode: 0644]
user/ulibc/include/termios.h [new file with mode: 0644]
user/ulibc/src/unistd.c
user/umount.c [new file with mode: 0644]
user/uname.c [new file with mode: 0644]