Skip to content

Running and Testing

NtinosTheGamer2324 edited this page Dec 11, 2025 · 2 revisions

Running and Testing

Guide to running and testing ModuOS.

Quick Run

run.bat

This launches ModuOS in QEMU with default settings.

QEMU Options

Basic Command

qemu-system-x86_64 -cdrom dist/AMD64/kernel.iso

Recommended Settings

qemu-system-x86_64 \
    -M pc-i440fx-6.2 \
    -m 1024M \
    -smp 2 \
    -serial file:com1.log \
    -serial file:com2.log \
    -drive file=dist/AMD64/kernel.iso,format=raw,media=cdrom \
    -drive id=disk,file=disk.img,if=none,format=raw \
    -device ahci,id=ahci \
    -device ide-hd,drive=disk,bus=ahci.0 \
    -boot d

Options Explained:

  • -M pc-i440fx-6.2: Machine type (i440FX chipset)
  • -m 1024M: 1GB RAM
  • -smp 2: 2 CPU cores
  • -serial file:com1.log: Redirect COM1 to log file
  • -drive: Disk configuration
  • -boot d: Boot from CD-ROM

Testing Features

Memory Management

Z:\> memtest

File System

Z:\> dir
Z:\> cat /ModuOS/System64/mdsys.sqr

Process Management

Z:\> ps
Z:\> exec /Apps/sh.sqr

System Information

Z:\> zsfetch

Log Files

COM1 (com1.log)

Kernel debug output:

  • Boot sequence
  • Driver initialization
  • Memory allocation
  • File system operations

COM2 (com2.log)

Additional system logs:

  • Process scheduling
  • Interrupt handling
  • Error messages

Common Test Scenarios

Test 1: Boot Sequence

  1. Launch QEMU
  2. Verify GRUB appears
  3. Select ModuOS
  4. Wait for shell prompt

Expected: Shell prompt Z:\> appears

Test 2: File Operations

Z:\> dir
Z:\> cat /ModuOS/System64/pcname.txt

Expected: Files listed, content displayed

Test 3: Applications

Z:\> zsfetch
Z:\> memtest

Expected: Programs run without errors

Test 4: Games

Z:\> game

Expected: Game menu appears

Debugging

GDB Setup

# Terminal 1: Start QEMU with debugging
qemu-system-x86_64 -cdrom dist/AMD64/kernel.iso -s -S

# Terminal 2: Connect GDB
gdb dist/AMD64/mdsys.sqr
(gdb) target remote localhost:1234
(gdb) break kernel_main
(gdb) continue

QEMU Monitor

Press Ctrl+Alt+2 to access QEMU monitor.

Useful Commands:

  • info registers: Show CPU registers
  • info mem: Show memory mappings
  • x/10i $rip: Disassemble at current instruction

Performance Testing

Boot Time

Measure time from GRUB to shell prompt.

Expected: ~1-2 seconds in QEMU

Memory Usage

Z:\> zsfetch

Check reported memory usage.

Next Steps

Clone this wiki locally