Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RTQOS - A Bootable Operating System with RTQ Language

RTQOS is a real, bootable operating system written in C and Assembly that runs in VMware, QEMU, or bare metal. It features the RTQ programming language - an ultra-simple, natural-language-like programming language perfect for beginners.

Features

  • Bootable OS: Real operating system that boots from ISO
  • VGA Text Mode: 80x25 color terminal with scrolling
  • PS/2 Keyboard: Full keyboard input support
  • File System: In-memory hierarchical file system
  • Shell: Interactive command-line interface
  • RTQ Language: Easy-to-learn programming language with .rtq files

Building RTQOS

Prerequisites

You'll need a cross-compiler toolchain for i686-elf and GRUB tools.

On Linux (Ubuntu/Debian):

sudo apt-get install build-essential nasm grub-pc-bin xorriso mtools

Then build the i686-elf cross-compiler or download a pre-built one.

Installing i686-elf-gcc

On Windows with WSL or Linux, you can build from source:

# Download binutils and gcc sources
# Follow the OSDev wiki guide: https://wiki.osdev.org/GCC_Cross-Compiler

Or use a package manager that provides it:

# Some distros have cross-compilers in repos
sudo apt-get install gcc-i686-elf

Building the OS

# Make the build script executable
chmod +x build.sh

# Build the ISO
./build.sh

# Or use make directly
make

This will create rtqos.iso - your bootable OS image!

Running RTQOS

In QEMU (Recommended for Testing)

# Run directly
make run

# Or manually
qemu-system-i386 -cdrom rtqos.iso

In VMware

  1. Open VMware Workstation/Player
  2. Create a new Virtual Machine
  3. Select "Other" for OS type
  4. Choose "Other" (32-bit)
  5. Use rtqos.iso as the CD/DVD image
  6. Start the VM

On Real Hardware (Advanced)

Burn rtqos.iso to a CD/DVD or create a bootable USB and boot from it.

Using RTQOS

Shell Commands

Once booted, you'll see a shell prompt. Available commands:

  • help - Show all commands
  • clear - Clear the screen
  • ls - List files and directories
  • cd <dir> - Change directory
  • mkdir <dir> - Create directory
  • touch <file> - Create file
  • rm <file> - Remove file
  • cat <file> - Display file contents
  • edit <file> - Edit a file (type EOF on new line to finish)
  • run <file.rtq> - Execute RTQ program
  • rtq - Start RTQ REPL
  • shutdown - Halt the system

RTQ Language

RTQ is designed to be the easiest programming language ever! It uses natural English-like syntax.

RTQ Syntax Examples

Hello World (hello.rtq):

say "Hello, World!"

Variables:

x = 10
name = "Alice"
say x
say name

User Input:

ask "What's your name?" into username
say "Hi " + username

Simple Calculator:

x = 10
y = 20
result = x + y
say result

Math Operations:

a = 5
b = 3
sum = a + b
diff = a - b
prod = a * b
quot = a / b
say sum

Creating and Running RTQ Programs

# Create a new RTQ program
rtqos:/$ touch myprogram.rtq

# Edit it
rtqos:/$ edit myprogram.rtq
# Type your RTQ code
# Type EOF on a new line when done

# Run it
rtqos:/$ run myprogram.rtq

Interactive REPL

rtqos:/$ rtq
rtq> say "Hello from REPL!"
Hello from REPL!
rtq> x = 42
rtq> say x
42
rtq> exit
rtqos:/$

Sample Programs

The OS comes with sample programs in /programs/:

  • hello.rtq - Hello World example
  • calc.rtq - Simple calculator

Try them:

rtqos:/$ cd programs
rtqos:/programs$ ls
rtqos:/programs$ run hello.rtq
rtqos:/programs$ run calc.rtq

RTQ Language Reference

Keywords

  • say - Output text or variables
  • ask - Get user input
  • into - Store input into variable

Operators

  • + - Addition
  • - - Subtraction
  • * - Multiplication
  • / - Division
  • = - Assignment

Comments

// This is a comment

Project Structure

rtqos/
├── boot/
│   ├── boot.s          # Assembly bootloader
│   └── grub.cfg        # GRUB configuration
├── kernel/
│   ├── kernel.c        # Main kernel
│   ├── vga.c/h         # VGA text mode driver
│   ├── keyboard.c/h    # PS/2 keyboard driver
│   ├── string.c/h      # String utilities
│   └── memory.c/h      # Memory allocator
├── fs/
│   └── filesystem.c/h  # In-memory file system
├── shell/
│   └── shell.c/h       # Command shell
├── rtq/
│   └── rtq_interpreter.c/h  # RTQ language
├── linker.ld           # Linker script
├── Makefile            # Build configuration
└── build.sh            # Build script

Technical Details

  • Architecture: x86 (32-bit, i386)
  • Bootloader: Multiboot-compliant for GRUB
  • Display: VGA text mode (80x25, 16 colors)
  • Memory: 1 MB heap with custom allocator
  • File System: In-memory, hierarchical
  • Max Files: 128 files
  • Max File Size: 64 KB per file

Troubleshooting

Build fails with "i686-elf-gcc not found"

  • Install a cross-compiler toolchain for i686-elf

ISO doesn't boot in VMware

  • Ensure VM is set to "Other (32-bit)" OS type
  • Check ISO is attached to CD/DVD drive
  • Enable legacy BIOS mode if using UEFI

Keyboard not working

  • Ensure VM is using PS/2 keyboard (not USB)
  • Try QEMU to verify functionality

License

This is a demonstration project. Feel free to use and modify!

Credits

Created as a demonstration of OS development with a custom programming language.


Welcome to RTQOS - Where Operating Systems Meet Simplicity!

About

i386 Multiboot-compliant OS with custom shell, RTQ interpreter, VGA text mode, PS/2 keyboard driver, and hierarchical filesystem.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages