Running bootloader in qemu
Posted: Tue May 27, 2014 10:14 am
I have very simple bootloader which i am trying to run through qemu in linux.
But qemu gets idle and show "booting from floppy"
I dont know how to make it work! I have included bootloader code and makefile script.
Here is the code for the bootloader
org 0
bits 16
jmp boot1
bootmsg db "Preparing to Load Operating System", 0x0a,0x0d,0x0
print:
or al,al
jz .printdone
lodsb
mov ah,0x0e
int 0x10
jmp print
.printdone:
ret
boot1:
cli
mov ax,0x07c0
mov ds,ax
mov es,ax
mov ax,0x0000
mov ss,ax
mov sp,0x07c0
sti
mov si,bootmsg
call print
hlt
times 510-($-$$) db 0
dw 0xAA55
and here is my Makefile script
boot.bin: boot.asm
nasm -f bin boot.asm -o boot.bin
boot.img: boot.bin
dd if=/dev/null of=boot.img count=1 bs=512
dd if=boot.bin of=boot.img conv=notrunc
qemu: boot.img
qemu -fda boot.img
clean:
rm *.bin *.img
But qemu gets idle and show "booting from floppy"
I dont know how to make it work! I have included bootloader code and makefile script.
Here is the code for the bootloader
org 0
bits 16
jmp boot1
bootmsg db "Preparing to Load Operating System", 0x0a,0x0d,0x0
print:
or al,al
jz .printdone
lodsb
mov ah,0x0e
int 0x10
jmp print
.printdone:
ret
boot1:
cli
mov ax,0x07c0
mov ds,ax
mov es,ax
mov ax,0x0000
mov ss,ax
mov sp,0x07c0
sti
mov si,bootmsg
call print
hlt
times 510-($-$$) db 0
dw 0xAA55
and here is my Makefile script
boot.bin: boot.asm
nasm -f bin boot.asm -o boot.bin
boot.img: boot.bin
dd if=/dev/null of=boot.img count=1 bs=512
dd if=boot.bin of=boot.img conv=notrunc
qemu: boot.img
qemu -fda boot.img
clean:
rm *.bin *.img