I'm trying to use the bios video interrupt to display a character on the screen. The following is the assembly code:
mov $0x0A, %AH
mov $0x68, %AL ; to display character 'h'
int $0x10
I assembled this code using GNU assembler to produce an object file called sample.o The total size of sample.o is 449 bytes. Now I manually write to this object file the hex digits 0x55 and 0xAA at 511th and 512th byte positions in order to make it bootable. So I believe now i have a 512 bytes boot sector. I use qemu to try to boot from this object file:
$> qemu -fda sample.o
The qemu emulator starts and freezes at the point where it says "Booting from Floppy..." But I thought after it detects the boot sector the bios video interrupt code was supposed to run and display a character on the screen.
I know i'm doing something horribly wrong. Maybe i'm missing the whole concept of interrupts. Can anyone help.
EDIT: so i'm now using as86 and ld86 to produce just the flat binary. And instead of 0x0A in AH i'm using 0x0E and it seems like it did the trick. Seems like bios implementation issue.
I appreciate all those who replied back.
Thanks