Why my print function doesn't print my string?

58 views Asked by At

I just started creating my first operating system, I wanted to start with a very simple bootloader that basically just prints a very simple string. But I can't figure out why, whatever string, the virtual machine (qemu) just prints a 'U'

This is my code:

ORG 0x7c00
BITS 16

%include "lib/print.asm"

boot:
    mov si, boot_msg
    call Print

    jmp $

boot_msg: db "The os is correctly loaded!", 0

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

Print function (lib/print.asm):

Print:
    mov ah, 0x0e
    mov al, [si]
    psloop:
        int 0x10
        inc si
        mov al, [si]
        cmp al, 0
        jne psloop
        ret
    ret
1

There are 1 answers

0
Nassau On

I put jmp boot before Print label.

Compile boot.asm with nasm -f bin boot.asm -o boot.bin

Copy boot.bin to qemu folder and run qemu-system-i386 -fda boot.bin

enter image description here