diff --git a/m4-bochs/bochsout.txt b/m4-bochs/bochsout.txt new file mode 100644 index 0000000..16a3284 --- /dev/null +++ b/m4-bochs/bochsout.txt @@ -0,0 +1,309 @@ +00000000000i[ ] Bochs x86 Emulator 3.0 +00000000000i[ ] Built from GitHub snapshot on February 16, 2025 +00000000000i[ ] Timestamp: Sun Feb 16 10:00:00 CET 2025 +00000000000i[ ] System configuration +00000000000i[ ] processors: 1 (cores=1, HT threads=1) +00000000000i[ ] A20 line support: yes +00000000000i[ ] IPS is set to 10000000 +00000000000i[ ] CPU configuration +00000000000i[ ] SMP support: no +00000000000i[ ] Using pre-defined CPU configuration: corei7_haswell_4770 +00000000000i[ ] Optimization configuration +00000000000i[ ] RepeatSpeedups support: yes +00000000000i[ ] Fast function calls: yes +00000000000i[ ] Handlers Chaining speedups: yes +00000000000i[ ] Devices configuration +00000000000i[ ] PCI support: i440FX i430FX i440BX +00000000000i[ ] Networking: no +00000000000i[ ] Sound support: no +00000000000i[ ] USB support: UHCI +00000000000i[ ] VGA extension support: vbe cirrus +00000000000i[IMG ] Disk image modules +00000000000i[IMG ] flat concat sparse dll growing undoable volatile vmware3 +00000000000i[IMG ] vbox vvfat vpc vmware4 +00000000000i[USBCTL] Pluggable USB devices +00000000000i[USBCTL] disk cdrom mouse tablet keypad keyboard hub floppy +00000000000i[USBCTL] printer +00000000000i[MEM0 ] allocated memory at 0xcf0c00000. after alignment, vector=0xcf0c00000, block_size = 128K +00000000000i[MEM0 ] 32.00MB +00000000000i[MEM0 ] mem block size = 0x00020000, blocks=256 +00000000000i[MEM0 ] rom at 0xfffe0000/131072 ('/opt/homebrew/Cellar/bochs/3.0/share/bochs/BIOS-bochs-latest') +00000000000i[CPU0 ] WARNING: RDRAND would not produce true random numbers ! +00000000000i[CPU0 ] initialized CPU model corei7_haswell_4770 +00000000000i[DEV ] will paste characters every 100 iodev timer ticks +00000000000i[ ] lt_dlhandle is 0x8dcc21260 +00000000000i[PLUGIN] loaded plugin libbx_pci.so +00000000000i[ ] lt_dlhandle is 0x8dcc21200 +00000000000i[PLUGIN] loaded plugin libbx_pci2isa.so +00000000000i[ ] lt_dlhandle is 0x8dcc21320 +00000000000i[PLUGIN] loaded plugin libbx_usb_uhci.so +00000000000i[ ] lt_dlhandle is 0x8dcc21380 +00000000000i[PLUGIN] loaded plugin libbx_acpi.so +00000000000i[ ] lt_dlhandle is 0x8dcc213e0 +00000000000i[PLUGIN] loaded plugin libbx_hpet.so +00000000000i[ ] lt_dlhandle is 0x8dcc21440 +00000000000i[PLUGIN] loaded plugin libbx_cmos.so +00000000000i[ ] lt_dlhandle is 0x8dcc214a0 +00000000000i[PLUGIN] loaded plugin libbx_dma.so +00000000000i[ ] lt_dlhandle is 0x8dcc21500 +00000000000i[PLUGIN] loaded plugin libbx_pic.so +00000000000i[ ] lt_dlhandle is 0x8dcc21560 +00000000000i[PLUGIN] loaded plugin libbx_pit.so +00000000000i[ ] lt_dlhandle is 0x8dcc215c0 +00000000000i[PLUGIN] loaded plugin libbx_vga.so +00000000000i[ ] lt_dlhandle is 0x8dcc21620 +00000000000i[PLUGIN] loaded plugin libbx_floppy.so +00000000000i[ ] lt_dlhandle is 0x8dcc21680 +00000000000i[PLUGIN] loaded plugin libbx_ioapic.so +00000000000i[ ] lt_dlhandle is 0x8dcc216e0 +00000000000i[PLUGIN] loaded plugin libbx_keyboard.so +00000000000i[ ] lt_dlhandle is 0x8dcc21740 +00000000000i[PLUGIN] loaded plugin libbx_harddrv.so +00000000000i[ ] lt_dlhandle is 0x8dcc217a0 +00000000000i[PLUGIN] loaded plugin libbx_pci_ide.so +00000000000i[PLUGIN] init_dev of 'pci' plugin device by virtual method +00000000000i[DEV ] i440FX PMC present at device 0, function 0 +00000000000i[PLUGIN] init_dev of 'pci2isa' plugin device by virtual method +00000000000i[DEV ] PIIX3 PCI-to-ISA bridge present at device 1, function 0 +00000000000i[PLUGIN] init_dev of 'cmos' plugin device by virtual method +00000000000i[CMOS ] Using local time for initial clock +00000000000i[CMOS ] Setting initial clock to: Fri Jan 30 17:11:37 2026 tz=utc (time0=1769793097) +00000000000i[PLUGIN] init_dev of 'dma' plugin device by virtual method +00000000000i[DMA ] channel 4 used by cascade +00000000000i[PLUGIN] init_dev of 'pic' plugin device by virtual method +00000000000i[PLUGIN] init_dev of 'pit' plugin device by virtual method +00000000000i[PLUGIN] init_dev of 'vga' plugin device by virtual method +00000000000i[MEM0 ] Register memory access handlers: 0x0000000a0000 - 0x0000000bffff +00000000000i[VGA ] interval=100000, mode=realtime +00000000000i[VGA ] Setting VGA update interval to 100000 (10.0 Hz) +00000000000i[VGA ] VSYNC using standard mode +00000000000i[MEM0 ] Register memory access handlers: 0x0000e0000000 - 0x0000e0ffffff +00000000000i[BXVGA ] VBE Bochs Display Extension Enabled (16 MB) +00000000000i[MEM0 ] rom at 0xc0000/32768 ('/opt/homebrew/Cellar/bochs/3.0/share/bochs/VGABIOS-lgpl-latest.bin') +00000000000i[PLUGIN] init_dev of 'floppy' plugin device by virtual method +00000000000i[DMA ] channel 2 used by Floppy Drive +00000000000i[FLOPPY] fd0: 'boot.img' ro=0, h=2,t=80,spt=18 +00000000000i[FLOPPY] Using boot sequence floppy, none, none +00000000000i[FLOPPY] Floppy boot signature check is enabled +00000000000i[PLUGIN] init_dev of 'acpi' plugin device by virtual method +00000000000i[DEV ] ACPI Controller present at device 1, function 3 +00000000000i[PLUGIN] init_dev of 'hpet' plugin device by virtual method +00000000000i[HPET ] initializing HPET +00000000000i[MEM0 ] Register memory access handlers: 0x0000fed00000 - 0x0000fed003ff +00000000000i[PLUGIN] init_dev of 'ioapic' plugin device by virtual method +00000000000i[IOAPIC] initializing I/O APIC +00000000000i[MEM0 ] Register memory access handlers: 0x0000fec00000 - 0x0000fec00fff +00000000000i[IOAPIC] IOAPIC enabled (base address = 0xfec00000) +00000000000i[PLUGIN] init_dev of 'keyboard' plugin device by virtual method +00000000000i[PLUGIN] init_dev of 'harddrv' plugin device by virtual method +00000000000i[PLUGIN] init_dev of 'pci_ide' plugin device by virtual method +00000000000i[DEV ] PIIX3 PCI IDE controller present at device 1, function 1 +00000000000i[PLUGIN] init_dev of 'serial' plugin device by virtual method +00000000000i[SER ] com1 at 0x03f8 irq 4 (mode: null) +00000000000i[PLUGIN] init_dev of 'speaker' plugin device by virtual method +00000000000i[PCSPK ] Forwarding beep to gui +00000000000i[PLUGIN] init_dev of 'unmapped' plugin device by virtual method +00000000000i[PLUGIN] init_dev of 'parallel' plugin device by virtual method +00000000000i[PAR ] parallel port 1 at 0x0378 irq 7 +00000000000i[PLUGIN] init_dev of 'biosdev' plugin device by virtual method +00000000000i[PLUGIN] init_dev of 'iodebug' plugin device by virtual method +00000000000i[PLUGIN] init_dev of 'extfpuirq' plugin device by virtual method +00000000000i[PLUGIN] init_dev of 'usb_uhci' plugin device by virtual method +00000000000i[DEV ] USB UHCI present at device 1, function 2 +00000000000i[UHCI ] USB UHCI initialized +00000000000i[PLUGIN] register state of 'pci' plugin device by virtual method +00000000000i[PLUGIN] register state of 'pci2isa' plugin device by virtual method +00000000000i[PLUGIN] register state of 'cmos' plugin device by virtual method +00000000000i[PLUGIN] register state of 'dma' plugin device by virtual method +00000000000i[PLUGIN] register state of 'pic' plugin device by virtual method +00000000000i[PLUGIN] register state of 'pit' plugin device by virtual method +00000000000i[PLUGIN] register state of 'vga' plugin device by virtual method +00000000000i[PLUGIN] register state of 'floppy' plugin device by virtual method +00000000000i[PLUGIN] register state of 'serial' plugin device by virtual method +00000000000i[PLUGIN] register state of 'speaker' plugin device by virtual method +00000000000i[PLUGIN] register state of 'unmapped' plugin device by virtual method +00000000000i[PLUGIN] register state of 'parallel' plugin device by virtual method +00000000000i[PLUGIN] register state of 'biosdev' plugin device by virtual method +00000000000i[PLUGIN] register state of 'iodebug' plugin device by virtual method +00000000000i[PLUGIN] register state of 'extfpuirq' plugin device by virtual method +00000000000i[PLUGIN] register state of 'usb_uhci' plugin device by virtual method +00000000000i[PLUGIN] register state of 'acpi' plugin device by virtual method +00000000000i[PLUGIN] register state of 'hpet' plugin device by virtual method +00000000000i[PLUGIN] register state of 'ioapic' plugin device by virtual method +00000000000i[PLUGIN] register state of 'keyboard' plugin device by virtual method +00000000000i[PLUGIN] register state of 'harddrv' plugin device by virtual method +00000000000i[PLUGIN] register state of 'pci_ide' plugin device by virtual method +00000000000i[SYS ] bx_pc_system_c::Reset(HARDWARE) called +00000000000i[CPU0 ] cpu hardware reset +00000000000i[APIC0 ] allocate APIC id=0 (MMIO enabled) to 0x0000fee00000 +00000000000i[CPU0 ] CPUID[0x00000000]: 0000000d 756e6547 6c65746e 49656e69 +00000000000i[CPU0 ] CPUID[0x00000001]: 000306c3 00010800 77faf3bf afebfbff +00000000000i[CPU0 ] CPUID[0x00000002]: 76036301 00f0b5ff 00000000 00c10000 +00000000000i[CPU0 ] CPUID[0x00000003]: 00000000 00000000 00000000 00000000 +00000000000i[CPU0 ] CPUID[0x00000004]: 1c004121 01c0003f 0000003f 00000000 +00000000000i[CPU0 ] CPUID[0x00000005]: 00000040 00000040 00000003 00042120 +00000000000i[CPU0 ] CPUID[0x00000006]: 00000077 00000002 00000009 00000000 +00000000000i[CPU0 ] CPUID[0x00000007]: 00000000 000027ab 00000000 00000000 +00000000000i[CPU0 ] CPUID[0x00000008]: 00000000 00000000 00000000 00000000 +00000000000i[CPU0 ] CPUID[0x00000009]: 00000000 00000000 00000000 00000000 +00000000000i[CPU0 ] WARNING: Architectural Performance Monitoring is not implemented +00000000000i[CPU0 ] CPUID[0x0000000a]: 07300403 00000000 00000000 00000603 +00000000000i[CPU0 ] CPUID[0x0000000b]: 00000000 00000000 00000000 00000000 +00000000000i[CPU0 ] CPUID[0x0000000c]: 00000000 00000000 00000000 00000000 +00000000000i[CPU0 ] CPUID[0x0000000d]: 00000007 00000240 00000340 00000000 +00000000000i[CPU0 ] CPUID[0x80000000]: 80000008 00000000 00000000 00000000 +00000000000i[CPU0 ] CPUID[0x80000001]: 00000000 00000000 00000121 2c100000 +00000000000i[CPU0 ] CPUID[0x80000002]: 65746e49 2952286c 726f4320 4d542865 +00000000000i[CPU0 ] CPUID[0x80000003]: 37692029 3737342d 50432030 20402055 +00000000000i[CPU0 ] CPUID[0x80000004]: 30342e33 007a4847 00000000 00000000 +00000000000i[CPU0 ] CPUID[0x80000005]: 00000000 00000000 00000000 00000000 +00000000000i[CPU0 ] CPUID[0x80000006]: 00000000 00000000 01006040 00000000 +00000000000i[CPU0 ] CPUID[0x80000007]: 00000000 00000000 00000000 00000100 +00000000000i[CPU0 ] CPUID[0x80000008]: 00003028 00000200 00000000 00000000 +00000000000i[CPU0 ] CPU Features supported: +00000000000i[CPU0 ] x87 +00000000000i[CPU0 ] 486ni +00000000000i[CPU0 ] pentium_ni +00000000000i[CPU0 ] p6ni +00000000000i[CPU0 ] mmx +00000000000i[CPU0 ] debugext +00000000000i[CPU0 ] vme +00000000000i[CPU0 ] pse +00000000000i[CPU0 ] pae +00000000000i[CPU0 ] pge +00000000000i[CPU0 ] mtrr +00000000000i[CPU0 ] pat +00000000000i[CPU0 ] sysenter_sysexit +00000000000i[CPU0 ] clflush +00000000000i[CPU0 ] sse +00000000000i[CPU0 ] sse2 +00000000000i[CPU0 ] sse3 +00000000000i[CPU0 ] ssse3 +00000000000i[CPU0 ] sse4_1 +00000000000i[CPU0 ] sse4_2 +00000000000i[CPU0 ] popcnt +00000000000i[CPU0 ] mwait +00000000000i[CPU0 ] longmode +00000000000i[CPU0 ] lm_lahf_sahf +00000000000i[CPU0 ] nx +00000000000i[CPU0 ] 1g_pages +00000000000i[CPU0 ] cmpxhg16b +00000000000i[CPU0 ] rdtscp +00000000000i[CPU0 ] xsave +00000000000i[CPU0 ] xsaveopt +00000000000i[CPU0 ] aes_pclmulqdq +00000000000i[CPU0 ] movbe +00000000000i[CPU0 ] fsgsbase +00000000000i[CPU0 ] avx +00000000000i[CPU0 ] avx2 +00000000000i[CPU0 ] avx_f16c +00000000000i[CPU0 ] avx_fma +00000000000i[CPU0 ] lzcnt +00000000000i[CPU0 ] bmi1 +00000000000i[CPU0 ] bmi2 +00000000000i[CPU0 ] vmx +00000000000i[CPU0 ] rdrand +00000000000i[CPU0 ] smep +00000000000i[CPU0 ] xapic +00000000000i[CPU0 ] x2apic +00000000000i[CPU0 ] pcid +00000000000i[CPU0 ] invpcid +00000000000i[CPU0 ] tsc_adjust +00000000000i[CPU0 ] tsc_deadline +00000000000i[CPU0 ] fcs_fds_deprecation +00000000000i[PLUGIN] reset of 'pci' plugin device by virtual method +00000000000i[PLUGIN] reset of 'pci2isa' plugin device by virtual method +00000000000i[PLUGIN] reset of 'cmos' plugin device by virtual method +00000000000i[PLUGIN] reset of 'dma' plugin device by virtual method +00000000000i[PLUGIN] reset of 'pic' plugin device by virtual method +00000000000i[PLUGIN] reset of 'pit' plugin device by virtual method +00000000000i[PLUGIN] reset of 'vga' plugin device by virtual method +00000000000i[PLUGIN] reset of 'floppy' plugin device by virtual method +00000000000i[PLUGIN] reset of 'acpi' plugin device by virtual method +00000000000i[PLUGIN] reset of 'hpet' plugin device by virtual method +00000000000i[PLUGIN] reset of 'ioapic' plugin device by virtual method +00000000000i[PLUGIN] reset of 'keyboard' plugin device by virtual method +00000000000i[PLUGIN] reset of 'harddrv' plugin device by virtual method +00000000000i[PLUGIN] reset of 'pci_ide' plugin device by virtual method +00000000000i[PLUGIN] reset of 'serial' plugin device by virtual method +00000000000i[PLUGIN] reset of 'speaker' plugin device by virtual method +00000000000i[PLUGIN] reset of 'unmapped' plugin device by virtual method +00000000000i[PLUGIN] reset of 'parallel' plugin device by virtual method +00000000000i[PLUGIN] reset of 'biosdev' plugin device by virtual method +00000000000i[PLUGIN] reset of 'iodebug' plugin device by virtual method +00000000000i[PLUGIN] reset of 'extfpuirq' plugin device by virtual method +00000000000i[PLUGIN] reset of 'usb_uhci' plugin device by virtual method +00000001734i[BIOS ] BIOS BUILD DATE: 02/16/25 +00000316572i[KBD ] reset-disable command received +00000320309i[BIOS ] Starting rombios32 +00000320747i[BIOS ] Shutdown flag 0 +00000321345i[BIOS ] ram_size=0x02000000 +00000321777i[BIOS ] ram_end=32MB +00000421946i[BIOS ] Found 1 cpu(s) +00000435904i[BIOS ] bios_table_addr: 0x000fa168 end=0x000fcc00 +00000763718i[PCI ] i440FX PMC write to PAM register 59 (TLB Flush) +00001091652i[P2ISA ] PCI IRQ routing: PIRQA# set to 0x0b +00001091676i[P2ISA ] PCI IRQ routing: PIRQB# set to 0x09 +00001091700i[P2ISA ] PCI IRQ routing: PIRQC# set to 0x0b +00001091724i[P2ISA ] PCI IRQ routing: PIRQD# set to 0x09 +00001091736i[P2ISA ] write: ELCR2 = 0x0a +00001092506i[BIOS ] PIIX3/PIIX4 init: elcr=00 0a +00001106182i[BIOS ] PCI: bus=0 devfn=0x00: vendor_id=0x8086 device_id=0x1237 class=0x0600 +00001108526i[BIOS ] PCI: bus=0 devfn=0x08: vendor_id=0x8086 device_id=0x7000 class=0x0601 +00001110709i[BIOS ] PCI: bus=0 devfn=0x09: vendor_id=0x8086 device_id=0x7010 class=0x0101 +00001110943i[PIDE ] BAR #4: i/o base address = 0xc000 +00001111560i[BIOS ] region 4: 0x0000c000 +00001113595i[BIOS ] PCI: bus=0 devfn=0x0a: vendor_id=0x8086 device_id=0x7020 class=0x0c03 +00001113807i[UHCI ] BAR #4: i/o base address = 0xc020 +00001114424i[BIOS ] region 4: 0x0000c020 +00001114549i[UHCI ] new IRQ line = 9 +00001116474i[BIOS ] PCI: bus=0 devfn=0x0b: vendor_id=0x8086 device_id=0x7113 class=0x0680 +00001116747i[ACPI ] new IRQ line = 11 +00001116762i[ACPI ] new IRQ line = 9 +00001116790i[ACPI ] new PM base address: 0xb000 +00001116805i[ACPI ] new SM base address: 0xb100 +00001116833i[PCI ] setting SMRAM control register to 0x4a +00001280970i[CPU0 ] Enter to System Management Mode +00001280970i[CPU0 ] enter_system_management_mode: temporary disable VMX while in SMM mode +00001280980i[CPU0 ] RSM: Resuming from System Management Mode +00001445034i[PCI ] setting SMRAM control register to 0x0a +00001471698i[BIOS ] MP table addr=0x000fa240 MPC table addr=0x000fa170 size=0xc8 +00001473405i[BIOS ] SMBIOS table addr=0x000fa250 +00001475494i[BIOS ] ACPI tables: RSDP addr=0x000fa370 ACPI DATA addr=0x01ff0000 size=0xff8 +00001478479i[BIOS ] Firmware waking vector 0x1ff00cc +00001480730i[PCI ] i440FX PMC write to PAM register 59 (TLB Flush) +00001481463i[BIOS ] bios_table_cur_addr: 0x000fa394 +00001581411i[VBIOS ] VGABios ID: vgabios.c 2025-01-08 +00001581494i[BXVGA ] VBE known Display Interface b0c0 +00001581534i[BXVGA ] VBE known Display Interface b0c5 +00001582951i[VBIOS ] VBE Bios ID: vbe.c 2025-01-08 +00032304437i[BIOS ] Booting from 0000:7c00 +30310648633i[BIOS ] KBD: int09h_handler(): unknown scancode read: 0x5b! +34533318135i[BIOS ] KBD: int09h_handler(): unknown scancode read: 0x5b! +147031518132i[BIOS ] KBD: int09h_handler(): unknown scancode read: 0x5b! +147069861132i[BIOS ] KBD: int09h_handler(): unknown scancode read: 0x5b! +227383750000p[SDL2 ] >>PANIC<< User requested shutdown. +227383750000i[CPU0 ] CPU is in real mode (halted) +227383750000i[CPU0 ] CS.mode = 16 bit +227383750000i[CPU0 ] SS.mode = 16 bit +227383750000i[CPU0 ] EFER = 0x00000000: ffxsr nxe lma lme sce +227383750000i[CPU0 ] XCR0=0x00000001: tiledata tilecfg hwp lbr uintr hdc cet_s cet_u pasid pkru pt hi_zmm zmm_hi256 opmask bndcfg bndregs ymm sse FPU +227383750000i[CPU0 ] | EAX=60000e00 EBX=00000000 ECX=00090000 EDX=00000000 +227383750000i[CPU0 ] | ESP=0000ffd6 EBP=00000000 ESI=000e7c27 EDI=0000ffac +227383750000i[CPU0 ] | EFLAGS=00000246: id vip vif ac vm rf nt IOPL=0 of df IF tf sf ZF af PF cf +227383750000i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D +227383750000i[CPU0 ] | CS:0000( 0004| 0| 0) 00000000 0000ffff 0 0 +227383750000i[CPU0 ] | DS:0000( 0005| 0| 0) 00000000 0000ffff 0 0 +227383750000i[CPU0 ] | SS:0000( 0005| 0| 0) 00000000 0000ffff 0 0 +227383750000i[CPU0 ] | ES:0000( 0005| 0| 0) 00000000 0000ffff 0 0 +227383750000i[CPU0 ] | FS:0000( 0005| 0| 0) 00000000 0000ffff 0 0 +227383750000i[CPU0 ] | GS:0000( 0005| 0| 0) 00000000 0000ffff 0 0 +227383750000i[CPU0 ] | EIP=00007c15 (00007c15) +227383750000i[CPU0 ] | CR0=0x60000010: pg CD NW ac wp ne ET ts em mp pe +227383750000i[CPU0 ] | CR2=0x00000000 +227383750000i[CPU0 ] | CR3=0x00000000 +227383750000i[CPU0 ] | CR4=0x00000000: lass uintr pks cet pke smap smep keylock osxsave pcid fsgsbase smx vmx la57 umip osxmmexcpt osfxsr pce pge mce pae pse de tsd pvi vme +227383750000i[CPU0 ] 0x0000000000007c15>> jmp .-3 (0x00007c14) : EBFD +227383750000i[CMOS ] Last time: 1769815835 tz=utc (Fri Jan 30 23:30:35 2026) +227383750000i[ ] restoring default signal behavior +227383750000i[SIM ] quit_sim called with exit code 1 diff --git a/m4-bochs/bochsrc b/m4-bochs/bochsrc new file mode 100644 index 0000000..7231818 --- /dev/null +++ b/m4-bochs/bochsrc @@ -0,0 +1,9 @@ +megs: 32 +cpu: count=1, ips=10000000 +display_library: sdl2 +romimage: file="/opt/homebrew/Cellar/bochs/3.0/share/bochs/BIOS-bochs-latest" +vgaromimage: file="/opt/homebrew/Cellar/bochs/3.0/share/bochs/VGABIOS-lgpl-latest.bin" +boot: floppy +floppya: 1_44=boot.img, status=inserted +keyboard: type=mf +log: bochsout.txt diff --git a/m4-bochs/boot.img b/m4-bochs/boot.img new file mode 100644 index 0000000..9c644a6 Binary files /dev/null and b/m4-bochs/boot.img differ diff --git a/m4-bochs/hello.asm b/m4-bochs/hello.asm new file mode 100644 index 0000000..c37157f --- /dev/null +++ b/m4-bochs/hello.asm @@ -0,0 +1,25 @@ +[BITS 16] +[ORG 0x7C00] + +start: + xor ax, ax + mov ds, ax + mov es, ax + mov si, msg + +loop: + lodsb + cmp al, 0 + je hlt + mov ah, 0x0E + int 0x10 + jmp loop + +hlt: + hlt + jmp hlt + +msg: db 'Hello M4 Bochs!', 0 + +times 510-($-$$) db 0 +dw 0xAA55 diff --git a/m4-bochs/hello.bin b/m4-bochs/hello.bin new file mode 100644 index 0000000..d0809d7 Binary files /dev/null and b/m4-bochs/hello.bin differ diff --git a/m4-bochs/readme.md b/m4-bochs/readme.md new file mode 100644 index 0000000..3c1ef1a --- /dev/null +++ b/m4-bochs/readme.md @@ -0,0 +1,77 @@ +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" +