Hello! I compile (fasm) a binary from this code and load a virtual machine (VMware) from it, but there is nothing on the screen. Help me please.

org 7C00h use16 jmp Beginning nop db 'bootsect' SectSize dw 00200h ClustSize db 001h ResSecs dw 00001h FatCnt db 002h RootSiz dw 000E0h TotSecs dw 00B40h Media db 0F0h FatSize dw 00009h TrkSecs dw 00012h HeadCnt dw 00002h HidnSec dw 00000h Beginning: jmp Main_Program times (512-2-($-7C00h)) db 0 db 055H,0AAH include "C:\main.asm" 

main.asm

 Main_Program: mov ax, cs cli mov ss, ax mov es, ax mov ds, ax sti mov ax, 3 int 10h mov dx, 0 mov ah, 2 mov bh, 0 int 10h mov al, 'a' mov ah, 9 mov bx, 0Fh mov cx, 1 int 10h 

    1 answer 1

    The first . The first code fragment (boot sector, primary loader) must load some code from the disk and transfer control to it not by a label (whose address is calculated at the compilation stage), but directly, such as jmp 0000: 0500H. But in fact, you immediately transfer the control, and it is not known where. The second . From this source, the compiler will give the exhaust in bin format, which will have to somehow be written to a virtual disk. I would advise you not to use VMware, but Bochs, you can slip the binaries as a disk image. Third . It is necessary to divide the program into three parts: a minimalistic primary loader (512 bytes), which will only load the secondary and transfer control to it. Secondary bootloader - will determine the hardware configuration, load the main program (using the CHS or LBA modes, or working directly with the disk controller), transfer the processor to the protected mode, and transfer control to it.