kwphil
kwphil

Reputation: 11

Trying to run a simple bootloader in qemu

I am trying to run a simple bootloader with a dummy kernel in qemu, the bootloader seems to work fine, I get no errors running qemu or commands compiling it, just a warning from qemu that probing guessed raw.

My boot loader is :

[org 0x7c00]
[bits 16]

bt:
    mov ax, 0x0201
    mov bx, 0x1000
    mov cx, 0x0002
    mov dx, 0x0000
    mov es, bx
    int 0x13
    jc  dsk_err
    mov ax, 0x0e24 ;print '$'
    mov bh, 0
    int 0x10
    jmp 0x1000:0x00

dsk_err:
    mov ax, 0x0e21 ;print '!'
    mov bh, 0
    int 0x10
    hlt

times 510-($-$$) db 0
dw 0xaa55

Then the dummy kernel looks like

[org 0]
[bits 16]

section .text
    global _start

_start:
    mov ax, 0x0e21 ;print '!' to make sure it works
    mov bh, 0
    int 0x10
    hlt

times 510-($-$$) db 0
dw 0xaa55

and then to separate the two I have a file called zero.bin created by an asm file that looks like times 0x1000-512 db 0

The only output I get in qemu is a single $

Upvotes: 0

Views: 189

Answers (0)

Related Questions