Ho to make a bootable disk image to test bootloader with vmware?

Viewed 100

I made a simple bootloader but I have no idea about testing this with vmware.

It works well in bochs. But I have to test this with vmware.

So I am trying to make a bootable disk image file, but I don't know what to do.

; loader.asm

%macro setline 1
   mov al, 0x0a
   int 0x10
   mov ah, 0x02
   mov bh, 0
   mov dl, 0
   mov dh, %1
   int 0x10
%endmacro

[org 0x7c00]

cli

mov bp, 0x7c00
mov sp, bp

mov bx, null
call bios_writestr
setline 18

mov bx, logstr_1
call bios_writestr
setline 19

mov bx, logstr_2
call bios_writestr
setline 20

jmp $

bios_writestr:
   mov ah, 0x0e
   .Loop:
   cmp [bx], byte 0
   je .Exit
      mov al, [bx]
      int 0x10
      inc bx
      jmp .Loop
   .Exit:
   ret

null: db 0
logstr_1: db 'Hello, world', 0
logstr_2: db 'Hello! World!', 0

times 510-($-$$) db 0
db 0x55
db 0xaa

Compilation:

nasm -f bin loader.asm -o loader.bin

Then what am I going to do? I want to test it in vmware.

1 Answers

There's no way of converting your .bin file to .iso without breaking things, you can use an real world bootloader like Grub, Limine, BOOTBOOT, ETC... There some guides for using them for your OS: Like this one for Grub.

Related