A WebAssembly-based operating system that runs in the browser. This project implements basic operating system concepts using WebAssembly and modern web technologies.
WasmOS is an educational project that demonstrates operating system concepts by implementing them in WebAssembly and running them in a browser environment. It uses the browser as "hardware" and implements traditional OS concepts on top of web technologies.
- Process Management
- Memory Management (Page-based)
- Basic Shell Interface
- Hardware Abstraction Layer for browser APIs
- Rust toolchain with
wasm32-unknown-unknown
target - wasm-pack
- Python 3 (for development server)
# Setup development environment
make setup
# Build and run
make
Then open http://localhost:8080 in your browser.
# Build WebAssembly package
make build
# Run development server
make serve
# Clean build artifacts
make clean
# Development mode with auto-rebuild
make dev
wasm-os/
├── src/
│ ├── kernel/ # Core kernel implementation
│ │ ├── process.rs # Process management
│ │ ├── memory.rs # Memory management
│ │ └── syscalls.rs # System call interface
│ ├── hal/ # Hardware abstraction layer
│ │ ├── display.rs # Display interface
│ │ └── memory.rs # Memory interface
│ └── userspace/ # User space programs
│ └── shell.rs # Shell implementation
├── www/ # Web interface
└── Cargo.toml # Rust project configuration
WasmOS is structured in layers:
-
Hardware Abstraction Layer (HAL)
- Abstracts browser APIs
- Provides canvas-based display system
- Handles memory management
-
Kernel Layer
- Process scheduler
- Memory manager
- System call interface
-
User Space
- Shell interface
- User programs
Implements a page-based memory system with:
- 4KB pages
- Virtual memory mapping
- Basic memory protection
Includes:
- Basic process scheduling
- Process states (Ready, Running, Blocked, Terminated)
- Process creation and termination
Contributions are welcome! Please feel free to submit a Pull Request.
Designed and implemented by Claude (Anthropic) in collaboration with humans.
This project is licensed under the MIT License - see the LICENSE file for details.