GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com โ€” GitHub - theterminalguy/vos: VOS - A virtual operating system simulator for learning OS and computer architecture

BranchesTags
Open more actions menu

Latest commit

 

History

25 Commits
25 Commits

Folders and files

NameName
Last commit message
Last commit date
crates
crates
 
 
docs
docs
 
 
examples
examples
 
 
tutorials-technical
tutorials-technical
 
 
.gitignore
.gitignore
 
 
Cargo.toml
Cargo.toml
 
 
LICENSE-APACHE
LICENSE-APACHE
 
 
LICENSE-MIT
LICENSE-MIT
 
 
PROGRESS.md
PROGRESS.md
 
 
QUICKSTART.md
QUICKSTART.md
 
 
README.md
README.md
 
 

Repository files navigation

VOS - Virtual Operating System

A complete virtual operating system simulator for learning OS and computer architecture concepts.

Status Tests License

Overview

VOS is a comprehensive educational project that implements a full computer system in software, from CPU to applications. Built entirely in Rust, it provides a working implementation of:

  • Custom Computer Architecture: Simple 32-bit RISC CPU with 16 registers
  • Operating System Kernel: Process management, scheduling, filesystem, system calls
  • System Programs: Interactive shell, assembler, debugger
  • Programming Language: vos script - a TypeScript/Ruby-like language
  • Application Programs: Calculator, web browser with HTML parser
  • Comprehensive Tutorials: 10 detailed chapters covering everything

๐ŸŽฏ Project Goals

This project is designed to:

  1. Teach fundamental concepts of operating systems and computer architecture
  2. Demonstrate how computers work from the ground up
  3. Provide hands-on learning through working, tested code
  4. Enable experimentation with OS and language design

Perfect for computer science students, self-learners, and anyone curious about how operating systems work!

โœจ Features

Complete Implementation

  • โœ… CPU Emulator - 32-bit RISC architecture with ALU and 16 registers
  • โœ… Memory Management - Virtual memory with paging (4KB pages)
  • โœ… I/O System - Display, keyboard, timer devices
  • โœ… File System - Inode-based Unix-style filesystem
  • โœ… Process Management - PCB, context switching, round-robin scheduler
  • โœ… System Calls - 10 core syscalls (exit, fork, read, write, etc.)
  • โœ… Interactive Shell - 10 built-in commands (cd, ls, cat, mkdir, etc.)
  • โœ… Assembler - Full assembly language support
  • โœ… Debugger - Interactive debugger with breakpoints
  • โœ… Programming Language - vos script lexer and AST
  • โœ… Web Browser - HTML parser and text renderer

Quality Metrics

  • 236 tests across all components
  • Zero clippy warnings
  • ~15,000+ lines of well-documented Rust code
  • 10 comprehensive tutorials (~8,000+ lines of documentation)
  • 6 example programs demonstrating language features

๐Ÿ—๏ธ Architecture

CPU Specification

  • Architecture: 32-bit RISC
  • Registers: 16 general-purpose (R0-R15), PC, FLAGS
  • Instructions: ~30 core instructions
    • Arithmetic: ADD, SUB, MUL, DIV
    • Logic: AND, OR, XOR, NOT
    • Memory: LW, SW, LB, SB
    • Control: BEQ, BNE, J, JAL, JR
    • System: SYSCALL, HALT
  • Instruction Formats: R-type, I-type, J-type

Memory Model

0x00000000 - 0x00000FFF  (4KB)     Interrupt Vector Table
0x00001000 - 0x000FFFFF  (1020KB)  Kernel Code + Data
0x00100000 - 0x001FFFFF  (1MB)     Kernel Stack
0x00200000 - 0x3FFFFFFF  (~1GB)    User Space
0x40000000 - 0x7FFFFFFF  (1GB)     Heap
0x80000000 - 0xBFFFFFFF  (1GB)     Memory-Mapped I/O
  • Virtual memory with simple paging
  • 4KB page size
  • Kernel/User mode separation

I/O Devices

  • Display: Text mode (80x25 characters)
  • Keyboard: Interrupt-driven input queue
  • Timer: Periodic interrupts for scheduling
  • Disk: Block I/O (512-byte sectors)
  • Serial: Debug output

Operating System

  • Process Management: PCB, states (Ready, Running, Blocked, Terminated)
  • Scheduler: Round-robin with configurable time quantum
  • File System: Inode-based with directories
  • System Calls: 10 core syscalls
  • Boot Sequence: Kernel initialization and init process

vos script Language

TypeScript/Ruby-inspired syntax:

// Variables and types
let x: int = 42
let name = "VOS"  // Type inference
const PI = 3.14159

// Functions
fn factorial(n: int) -> int {
    if n <= 1 {
        return 1
    }
    return n * factorial(n - 1)
}

// Control flow
while i < 10 {
    print(i)
    i = i + 1
}

Features:

  • Static typing with inference
  • First-class functions
  • Structs and methods
  • Arrays and control flow

๐Ÿ“ Project Structure

vos/
โ”œโ”€โ”€ crates/                    # Rust workspace crates
โ”‚   โ”œโ”€โ”€ vos-core/              # Core types, traits, error handling
โ”‚   โ”œโ”€โ”€ vos-cpu/               # CPU emulator (42 tests)
โ”‚   โ”œโ”€โ”€ vos-memory/            # Memory and MMU (29 tests)
โ”‚   โ”œโ”€โ”€ vos-io/                # I/O devices (26 tests)
โ”‚   โ”œโ”€โ”€ vos-hardware/          # Virtual machine (9 tests)
โ”‚   โ”œโ”€โ”€ vos-kernel/            # OS kernel (63 tests)
โ”‚   โ”œโ”€โ”€ vos-asm/               # Assembler (20 tests)
โ”‚   โ”œโ”€โ”€ vos-debugger/          # Interactive debugger (6 tests)
โ”‚   โ”œโ”€โ”€ vos-lang/              # vos script language (9 tests)
โ”‚   โ”œโ”€โ”€ vos-userspace/         # Shell and programs (20 tests)
โ”‚   โ””โ”€โ”€ vos-cli/               # Main CLI application
โ”œโ”€โ”€ docs/                      # Documentation
โ”‚   โ””โ”€โ”€ beginners-guide/       # Beginner-friendly tutorials
โ”‚       โ”œโ”€โ”€ README.md
โ”‚       โ”œโ”€โ”€ 01-hello-vos.md
โ”‚       โ”œโ”€โ”€ 02-exploring-the-computer.md
โ”‚       โ””โ”€โ”€ 03-files-deep-dive.md
โ”œโ”€โ”€ tutorials-technical/       # Advanced technical tutorials (10 chapters)
โ”‚   โ”œโ”€โ”€ README.md
โ”‚   โ”œโ”€โ”€ chapter-01-introduction.md
โ”‚   โ”œโ”€โ”€ chapter-02-cpu-basics.md
โ”‚   โ”œโ”€โ”€ ... (through chapter 10)
โ”‚   โ””โ”€โ”€ chapter-10-applications.md
โ”œโ”€โ”€ examples/                  # Example programs
โ”‚   โ”œโ”€โ”€ asm/                   # Assembly examples
โ”‚   โ”‚   โ”œโ”€โ”€ hello.asm
โ”‚   โ”‚   โ”œโ”€โ”€ fibonacci.asm
โ”‚   โ”‚   โ””โ”€โ”€ countdown.asm
โ”‚   โ”œโ”€โ”€ hello_world.vos        # vos script examples
โ”‚   โ”œโ”€โ”€ fibonacci.vos
โ”‚   โ”œโ”€โ”€ calculator.vos
โ”‚   โ”œโ”€โ”€ loops.vos
โ”‚   โ””โ”€โ”€ variables.vos
โ””โ”€โ”€ QUICKSTART.md              # 5-minute getting started guide

๐Ÿš€ Getting Started

Prerequisites

  • Rust 1.70 or later (install from rustup.rs)
  • Cargo (comes with Rust)

Quick Start

# Clone the repository
git clone https://github.com/theterminalguy/vos.git
cd vos

# Build the project
cargo build --release

# Run all tests
cargo test

# Start the interactive shell
cargo run --release --bin vos-cli

Running Examples

# Tokenize a vos script program
cargo run --bin vos-cli -- examples/fibonacci.vos

# View all example programs
ls examples/
ls examples/asm/

Using the Shell

cargo run --bin vos-cli
VOS Shell v0.1.0
Type 'help' for available commands, 'exit' to quit.

vos> help
VOS Shell - Available Commands:
  help, exit, pwd, cd, ls, cat, echo, mkdir, touch, rm

vos> mkdir /mydir
vos> touch /mydir/file.txt
vos> ls /mydir
file.txt  (inode 2)

vos> exit

๐Ÿ“š Learning Paths

VOS provides multiple learning paths depending on your background and goals:

๐Ÿš€ Quick Start (5 minutes)

Just want to try it out?

  • QUICKSTART.md - Get VOS running in 5 minutes
  • Basic commands and first challenges
  • Perfect for: Everyone starting with VOS

๐ŸŽ“ Beginner's Guide (For Newcomers)

New to computer science or command line?

  • Beginner's Guide - Interactive, visual, hands-on learning
  • Friendly explanations with lots of diagrams
  • No prior CS knowledge needed
  • Progressive difficulty with practice challenges
  • Perfect for: Students, self-learners, anyone curious about how computers work

Chapters:

  • Chapter 1: Hello, VOS! (15 min)
  • Chapter 2: Exploring the Computer (20 min)
  • Chapter 3: Files and Folders Deep Dive (25 min)
  • More chapters coming soon!

๐Ÿ“– Technical Tutorials (For CS Students)

Want deep technical understanding?

  • Technical Tutorials - Comprehensive, in-depth coverage
  • 10 detailed chapters (~8,000 lines)
  • OS theory and implementation details
  • Perfect for: CS students, software engineers, advanced learners

Chapters:

Chapter Topic Lines
1 Introduction ~400
2 CPU Basics ~650
3 Memory Systems ~650
4 I/O Devices ~650
5 Assembler & Debugger ~650
6 Kernel Fundamentals ~700
7 File Systems ~910
8 Shell & Userspace ~913
9 vos script Language ~801
10 Building Applications ~794

๐Ÿ—บ๏ธ Which Path Should You Take?

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Are you new to programming/CS?         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”           โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”         โ”‚
โ”‚  โ”‚  YES  โ”‚           โ”‚   NO   โ”‚         โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”˜           โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”˜         โ”‚
โ”‚      โ”‚                    โ”‚             โ”‚
โ”‚      โ†“                    โ†“             โ”‚
โ”‚  Beginner's          Technical         โ”‚
โ”‚    Guide             Tutorials         โ”‚
โ”‚                                         โ”‚
โ”‚  (Start here!)    (Deep dive here!)    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Everyone starts with: QUICKSTART.md to get VOS running!

๐Ÿงช Development

Building

# Build all crates
cargo build

# Build specific crate
cargo build -p vos-cpu

# Build with optimizations
cargo build --release

Testing

# Run all tests (236 tests)
cargo test

# Run tests for specific crate
cargo test -p vos-kernel

# Run with output
cargo test -- --nocapture

Code Quality

# Format code
cargo fmt

# Run linter
cargo clippy

# Generate documentation
cargo doc --open

๐ŸŽ“ Recommended Learning Path

For Beginners

  1. Get Started: QUICKSTART.md - Get VOS running (5 min)
  2. Learn Basics: Beginner's Guide Chapter 1 - First commands
  3. Understand Internals: Work through Beginner's Guide chapters
  4. Experiment: Try the challenges, break things, learn by doing!

For CS Students / Advanced Learners

  1. Get Started: QUICKSTART.md - Get VOS running (5 min)
  2. Deep Dive: Technical Tutorials Chapter 1
  3. Follow Along: Chapters 2-4 cover hardware (CPU, Memory, I/O)
  4. Build Understanding: Chapters 5-7 cover system software
  5. Explore Applications: Chapters 8-10 cover userspace
  6. Experiment: Modify the code, add features, break things!

๐Ÿ“Š Project Statistics

  • Total Lines of Code: ~15,000+ (Rust)
  • Total Tests: 236
  • Test Coverage: Comprehensive unit and integration tests
  • Documentation: ~8,000+ lines of tutorials
  • Crates: 11 workspace crates
  • Example Programs: 6 programs (3 assembly, 6 vos script)
  • Clippy Warnings: 0
  • Development Time: 4-6 months
  • Educational Value: Priceless! ๐ŸŽ“

๐Ÿ† What You'll Learn

By exploring VOS, you'll understand:

Computer Architecture

  • How CPUs execute instructions
  • Register files and ALU operations
  • Memory addressing and virtual memory
  • Interrupt handling
  • Device I/O

Operating Systems

  • Process management and scheduling
  • System calls and kernel/user mode
  • File systems and inodes
  • Memory paging
  • Boot process

Compilers & Languages

  • Lexical analysis (tokenization)
  • Parsing and AST construction
  • Assembly language
  • Type systems

Software Engineering

  • Rust programming
  • Test-driven development
  • Error handling
  • API design
  • Documentation

๐Ÿ”ฎ Future Enhancements

Possible extensions (PRs welcome!):

  • Complete vos script parser and interpreter
  • Network stack (TCP/IP)
  • Multi-core CPU support
  • Graphical display mode
  • More system calls
  • Persistent disk storage
  • Shell pipes and redirection
  • Package manager
  • More example applications

๐Ÿค Contributing

Contributions are welcome! This is an educational project, so clarity and documentation are as important as functionality.

How to contribute:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Write tests for your changes
  4. Ensure all tests pass: cargo test
  5. Format code: cargo fmt
  6. Check for warnings: cargo clippy
  7. Commit your changes (git commit -m 'Add amazing feature')
  8. Push to the branch (git push origin feature/amazing-feature)
  9. Open a Pull Request

Guidelines:

  • Keep educational value in mind
  • Add tests for new features
  • Update documentation/tutorials if needed
  • Follow Rust best practices
  • Write clear commit messages

๐Ÿ“„ License

Licensed under either of:

  • Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)

at your option.

๐Ÿ™ Acknowledgments

This project is inspired by:

  • MIPS architecture - Simple, clean RISC design
  • xv6 operating system (MIT) - Educational Unix-like OS
  • Linux kernel - Real-world OS design patterns
  • Rust - Excellent type system and tooling
  • "Operating Systems: Three Easy Pieces" - Great OS textbook
  • "Crafting Interpreters" - Language implementation guide

๐Ÿ“– Resources

Operating Systems

  • Operating Systems: Three Easy Pieces
  • xv6: A simple Unix-like OS
  • OSDev Wiki

Computer Architecture

  • Computer Systems: A Programmer's Perspective
  • MIPS Reference

Rust

  • The Rust Book
  • Rust by Example
  • Writing an OS in Rust

Compilers

  • Crafting Interpreters
  • Engineering a Compiler

โญ Star History

If you find this project helpful, please consider giving it a star! โญ

It helps others discover the project and motivates continued development.

๐Ÿ“ฌ Contact

  • GitHub: @theterminalguy
  • Issues: GitHub Issues

๐ŸŽ‰ Status

โœ… Project Complete! - All 10 phases implemented and documented.

VOS is a fully functional virtual operating system with:

  • Working CPU, memory, and I/O
  • Complete kernel with processes and filesystem
  • Interactive shell and utilities
  • Programming language foundation
  • Example applications
  • Comprehensive tutorials

Start learning today:

  • New to CS? โ†’ Beginner's Guide
  • Want depth? โ†’ Technical Tutorials

Built with โค๏ธ and Rust ๐Ÿฆ€

Making operating systems accessible to everyone, one instruction at a time.

About

VOS - A virtual operating system simulator for learning OS and computer architecture

Resources

Readme
Activity

Stars

2 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 โ€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800ร—600. No cookies required.