Skip to content

A UNIX-like Rust OS built for RISC-V, available on the web.

Notifications You must be signed in to change notification settings

andrewhinh/web-os

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Web OS

A UNIX-like Rust OS built for RISC-V, available on the web.

demo

Features include:

  • COW fork, mmap, and kernel threads.
  • Async kernel executor that handles UART/disk/network I/O cooperatively without blocking CPUs in addition to the preemptive user scheduler.
  • APLIC/MSI interrupts for per-hart message-signaled delivery, replacing PLIC.
  • Signals with interval timers, job control, and poll/select.
  • IPC including shared memory and AF_UNIX sockets.
  • Journaling filesystem with fsync, crash recovery, symlinks, and permissions.
  • TCP/UDP networking over virtio-net.
  • Framebuffer with UTF-8/ANSI support and keyboard/mouse input.
  • Web UI that streams the framebuffer via VNC over WebRTC.

Try out some commands:

sleep 30 &
jobs
fg %1
touch /tmp/a && ln -s /tmp/a /tmp/a.sym && ls /tmp
kv "p,1,hello" "p,2,world" "a"
kv "g,1"
wserver &
jobs
kill <pid>
test_fsync --journal

Development

Installation

Create an Open Relay TURN server account here for TURN server credentials.

npm i
prek install
fly auth login

Commands

cargo run --target riscv64gc-unknown-none-elf    # run kernel
mprocs                                           # run server and frontend

prek run --all-files                             # run hooks
act push --bind                                  # test CI
docker build -t web-os .                         # test kernel build
docker run --rm -p 8080:8080 web-os              # test kernel run

fly ips allocate-v4                              # allocate a dedicated IPv4 for WebRTC
fly secrets set ICE_PUBLIC_IPS=<dedicated-ipv4>
fly secrets set TURN_USERNAME=<username> TURN_CREDENTIAL=<credential>
fly redis create
fly secrets set UPSTASH_REDIS_REST_URL=<url> UPSTASH_REDIS_REST_TOKEN=<token>
fly deploy

Roadmap

Kernel

User-Space

App

  • stream kernel video to browser via VNC and WebRTC
  • add live metrics

Credit

About

A UNIX-like Rust OS built for RISC-V, available on the web.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published