I am 3-4 days old in assembly programming. trying to print a string in video memory and running through qemu. I expected this program to print Hallo world. But it prints nothing. qemu window prints "Booting From Hard Disk ..." Nothing else
Is it only 16 bit that is allowed in bootloader ? in that case how will I do MMIO ? I was following actual page 32 [ENTERING 32-BIT PROTECTED MODE] of http://www.cs.bham.ac.uk/~exr/lectures/opsys/10_11/lectures/os-dev.pdf
[bits 32]
[org 0x7c00]
loop:
mov edx, 0xb8000
mov ah, 0x0f
mov ebx, message
mov ecx, 0x0
call draw_string
;jmp self_loop
;jmp loop
self_loop:
jmp self_loop
; take the stream begining from ebx
draw_string:
mov al, [ebx]
mov ah, 0x0f
mov [edx], ax
add ebx, 1
add edx, 2
cmp al, 0
jne draw_string
ret
message:
db 'Hallo World', 0x0
times 510 -( $ - $$ ) db 0 ; When compiled , our program must fit into 512 bytes ,
; with the last two bytes being the magic number ,
; so here, tell our assembly compiler to pad out our
; program with enough zero bytes (db 0) to bring us to the
; 510th byte.
dw 0xAA55 ; Last two bytes (one word) form the magic number ,
; so BIOS knows we are a boot sector.