bios not loading bootloader at 0000:7c00
Posted: Sun Nov 05, 2017 2:05 pm
I have a boot.asm file with the following content:
Then I compile with this command:
and execute in a virtual machine with this command:
As expected, the screen is filled up with 'X'. However, this doesn't happen when I don't explicitly tell the bootloader to be loaded in 0x7c00 with [ORG 0x7c00]:
In the Babystep1 tutorial in OSDev Wiki (http://wiki.osdev.org/Babystep1) says:
if the BIOS is supposed to load the code in that location anyways?
Code: Select all
[ORG 0x7c00]
mov ah , 0x0e
mov al ,'X'
int 0x10
jmp 0x7c00
times 510 - ( $ - $$ ) db 0
dw 0xaa55
Code: Select all
nasm boot.asm -f bin -o boot.bin
Code: Select all
qemu-system-i386 boot.bin
Code: Select all
mov ah , 0x0e
mov al ,'X'
int 0x10
jmp 0x7c00
times 510 - ( $ - $$ ) db 0
dw 0xaa55
Why do I have to writeThe CPU starts in real mode and the BIOS loads this code at address 0000:7c00
Code: Select all
[ORG 0x7c00]