RustForge

foundry

Foundry OS: the operating system built on the Rustbelt kernel

authorTyler Fowler <tyler@localhost>2026-10-30 01:22:29 -0700
commitd3ec4b344a41d623c6f909fe43716fbde2f1b46e
parenta68bfbf1da7677ae27d09f13dd6510071933c3ad
treebrowse files at this commit
Stage 7: Rustbelt shell

- /bin/sh as a ring-3 program: raw-mode line editor (Backspace, history),
  builtins (cd pwd echo help exit cls/clear ver alias drives history jobs wait),
  run / run --trace / start / &, PATH over each drive's bin, multi-stage
  pipes, < > >>, DOS aliases (dir type del md copy), drive letters
- new programs: ls cat wc grep mkdir rm touch cp sleep (echo removed)
- kernel: ioctl raw tty, uname, mounts, wait WNOHANG, O_APPEND, process
  memory freed on reap (frame free list), strace-style trace output,
  console \x08 / \x0c, ELF loader rejects shared pages with mixed flags
- fixes: pc-keyboard Oem7 -> Oem5 so the | key works; user link.ld aligns
  before .data so .bss never lands on the .rodata page
- boot runs the shell (respawned on exit); old demos behind --features demos;
  headless boot runs a scripted shell session as the self-test
- tests/shell.rs (parser, drives, scripted session, jobs, memory reuse)
- kernel named Rustbelt 0.7.0; README shell section; new boot.png
Mnotes/todo.txt+2 -2
Mreadme.txt+1 -0
Ascripts/selftest.sh+32 -0

3 files changed, 35 insertions, 2 deletions

@@ -1,2 +1,2 @@-Next stage: the shell (cd, ls, pwd, cat, run, start, pipes, > redirection).-Later: ext2, exFAT, btrfs.+Done: the shell (cd, ls, cat, run, start, pipes, redirection, drive letters).+Next: more file systems -- ext2, exFAT, btrfs.
@@ -1,2 +1,3 @@ Hello from the FAT32 disk! This file lives on a virtio-blk disk, in a GPT partition, in a FAT32 file system -- read through the kernel's VFS.+In the Rustbelt shell this disk is drive D: -- try `cd D:` and `ls`.
@@ -0,0 +1,32 @@+# Rustbelt shell self-test: `cargo run --features headless` runs this with+# `sh /mnt/disk0/scripts/selftest.sh` (D:/scripts/selftest.sh) and scripts/run-headless.sh checks the output.+ver+drives+pwd+cd D:+ls+ls -l notes+type D:/readme.txt+cat d:notes/todo.txt | grep -i EXT | wc -l+dir bin | wc -l+echo first line > C:/tmp/out.txt+echo second line >> /tmp/out.txt+cat < /tmp/out.txt+md /tmp/work+copy D:/notes/todo.txt /tmp/work+touch /tmp/work/empty.txt+ls -l C:/tmp/work+del /tmp/work/todo.txt /tmp/work/empty.txt /tmp/work+grep "D:" readme.txt+alias ll="ls -l"+ll C:/tmp+run --trace cat D:/notes/todo.txt+start sleep 1+jobs+wait+run evil+nosuchprogram+cd Q:+cd C:/tmp+pwd+exit 0