I'm following a tutorial that introduce you in the magic world of bootloader.
The easiest example, print a character, works.
Displaying a string gives me some problem: it displays random characters.
It should display 12 characters, starting at the location inside si register
Here's the Nasm code (build command: nasm.exe bootloader.asm -f bin -o bootloader.bin)
[bits 16]
[org 0]
start:
mov al, 68
mov ah, 0x0E
mov bh, 0x00
mov bl, 0x07
mov si, helloWorld
call printString
jmp $
printString:
mov dx, 0
._loop:
mov al, [si]
int 0x10
inc si
inc dx
cmp dx, 12
jl ._loop
ret
helloWorld:
db 'AAAAAAAAAA'
times 510 - ($ - $$) db 0
dw 0xAA55
Then I create the .img file with dd.exe if=bootloader.bin of=bootloader.img count=1 bs=512
It boots correctly in QEMU (qemu-system-i386.exe) (well, it loads, because my bootloader still not boot) (maybe it's a problem of QEMU -difficoult-)
What's the problem in my code?
