1

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
  • Check if videopage in BH is 0 and if DS:SI points to boot_msg at Print entry. Or load the characters with mov al,[cs:si]. Commented May 22, 2023 at 18:37

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.