# Running and Testing Guide to running and testing ModuOS. ## Quick Run ```bash run.bat ``` This launches ModuOS in QEMU with default settings. ## QEMU Options ### Basic Command ```bash qemu-system-x86_64 -cdrom dist/AMD64/kernel.iso ``` ### Recommended Settings ```bash 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 ``` # memtest ``` ### File System ``` # dir / # cat /ModuOS/System64/mdsys.sqr # dir $/mnt/vDrive0/ # dir $/dev ``` ### Process Management ``` # process_list # exec /Apps/sh.sqr ``` ### System Information ``` # 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 appears (e.g. `# user@pc />`). ### Test 2: File Operations ``` # dir / # cat /ModuOS/System64/pcname.txt # dir $/mnt/vDrive0/ ``` **Expected**: Files listed, content displayed ### Test 3: Applications ``` # zsfetch # memtest ``` **Expected**: Programs run without errors ### Test 4: Games ``` # game ``` **Expected**: Game menu appears ## Debugging ### GDB Setup ```bash # 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 ``` # zsfetch ``` Check reported memory usage. ## Next Steps - [Debugging Guide](Debugging-Guide.md) - Advanced debugging - [Quick Start Guide](Quick-Start-Guide.md) - Initial setup