I've decided to write my own bootloader.
I've been able to set the video mode to 3 (although qemu already sets it to 3 already), and then print 'A' at the first character of the first line on the screen by directly changing video memory.
[org 0x7C00] ;Address BIOS loads the bootloader into
[bits 16]
;Set video mode to mode 3
mov al, 0x03
mov ah, 0x00
int 0x10
mov ax, 0xB800
mov es, ax
mov bx, 0
mov [es:bx], byte 65
mov [es:bx+1], byte 0x0F
;cli
JMP $ ;Infinite loop, hang it here.
times 510 - ($ - $$) db 0 ;Fill the rest of sector with 0
dw 0xAA55 ;Add boot signature at the end of bootloader
Note the commented out cli instruction. When I remove the semicolon and only the semicolon, the 'A' is no longer printed. I don't understand how clearing the IF flag can have the sideeffect of affecting what's in memory. If someone could shed some light on this that'd be great.
Oh and for what it's worth, the commands I use to run the bootloader
nasm -o bl.bin bl.asm
qemu -fda bl.bin
I got flamed somewhere else, and read up as much as I could. Someone mentioned setting up a stack, but I don't understand it's relevance to my issue.
Help is really appreciated!