Files
ownOS/m4-bochs
..
2026-01-30 17:18:50 +01:00
2026-01-30 17:18:50 +01:00
2026-01-30 17:18:50 +01:00
2026-01-30 17:18:50 +01:00
2026-01-30 17:18:50 +01:00
2026-01-30 17:18:50 +01:00

mkdir ~/bochs-m4 && cd ~/bochs-m4 && clear

=======================================================================

BOOTLOADER hello.asm (16-bit real-mode, BIOS int 0x10)

=======================================================================

cat > hello.asm << 'EOF' [BITS 16] [ORG 0x7C00]

start: xor ax, ax ; Zero segment registers mov ds, ax mov es, ax mov si, msg ; SI = pointer na zprávu

print_loop: lodsb ; AL = [SI++] cmp al, 0 ; konec stringu? je hlt_loop mov ah, 0x0E ; Teletype BIOS funkce int 0x10 ; Vypis znak jmp print_loop

hlt_loop: hlt ; Zastav CPU jmp hlt_loop

msg: db 'Hello M4 Bochs v2026!', 0 times 510-(-$) db 0 dw 0xAA55 ; Boot signature (povinné!) EOF

=======================================================================

KOMPILACE + 1.44MB FLOPPY IMAGE

=======================================================================

nasm -f bin hello.asm -o hello.bin dd if=/dev/zero of=boot.img bs=512 count=2880 # Plný floppy dd if=hello.bin of=boot.img bs=512 count=1 conv=notrunc echo " Boot signature: $(hexdump -C boot.img | tail -1)"

=======================================================================

BOCHS 3.0 CESTY (Homebrew Apple Silicon M4)

=======================================================================

VGA_PATH="/opt/homebrew/Cellar/bochs/3.0/share/bochs/VGABIOS-lgpl-latest.bin" BIOS_PATH="/opt/homebrew/Cellar/bochs/3.0/share/bochs/BIOS-bochs-latest" echo " VGABIOS: $VGA_PATH" echo " BIOS: $BIOS_PATH" ls -la "$VGA_PATH" "$BIOS_PATH"

=======================================================================

BOCHSRC CONFIG (SDL2 GUI + rychlost)

=======================================================================

cat > bochsrc << EOF

Memory + CPU

megs: 32 cpu: count=1, ips=20000000

Display (SDL2 GUI okno)

display_library: sdl2

ROM images (Homebrew M4 paths)

romimage: file="$BIOS_PATH" vgaromimage: file="$VGA_PATH"

Boot floppy

boot: floppy floppya: 1_44=boot.img, status=inserted

Keyboard + log

keyboard: type=mf log: bochsout.txt EOF

echo " VŠE PŘIPRAVENO! 🚀" ls -la *.asm *.bin *.img bochsrc echo "START: bochs -f bochsrc -q"