Simple assembly hello world bootloader problem
Posted: Fri Mar 05, 2010 3:24 pm
Hey, I'm trying to make a simple Hello World bootloader in assembly (following the tutorial at http://www.viralpatel.net/taj/operating ... torial.php). I've made it show a single character on the screen, but as soon as I try to load a string of characters, the new characters won't show up when I boot it on a real machine, it only works when I'm running it in VirtualBox. Here's the code I'm using:
When running it on a real machine, I only get "H", but when I'm running it in VirtualBox, I get "Hello". Can anybody see what I'm doing wrong?
Code: Select all
[BITS 16]
[ORG 0x7C00]
MOV AL, 72
CALL PrintChar
MOV SI, HelloWorldString
CALL PrintString
JMP $
PrintChar:
MOV AH, 0x0E
MOV BH, 0x00
MOV BL, 0x07
INT 0x10
RET
PrintString:
PrintStringNext:
MOV AL, [SI]
INC SI
OR AL, AL
JZ PrintStringExit
CALL PrintChar
JMP PrintStringNext
PrintStringExit:
RET
HelloWorldString db 101, 108, 108, 111, 0
TIMES 510 - ($ - $$) db 0
DW 0xAA55