Oddity at 0x0000:0x0900.
Posted: Wed Dec 23, 2009 1:01 am
Greetings,
I'm currently stuck on a bug while I was rewriting second stage of my boot loader. My boot sector loads my second stage to 0x0000:0x0500, which works fine. The second stage is currently about 1172 bytes in size and 1979-2614 (in RAM, so plus 0x500 bytes) is filled up with messages which are being display in order to present the current state of the second stage. However, when I created a new floppy image and booted it on Qemu, Bochs and VirtualBox, it displayed:
Where ??? is actually an replacement for some odd characters. I'm assuming this is:
However, that code is at 0x0000:0x7C00 and not at 0x0000:0x0900, which is where that code is being presented instead. Also, when doing a hexdump on the file, I'm getting this:
So I'm assuming my file is fine. Also, when I left out some code in my Assembly file, reassembled it and then did a hexdump, I got this:
And the display showed:
So I concluded that the boot sector or something is being copied to 0x0000:0x0900 or is at least present at that address. However, this is odd as 0x0000:0x7C00 isn't 0x0000:0x0900. So I'm currently wondering what is actually happening here. Does the BIOS reserve this area for a copy of the boot sector or something similar?
Edit: fixed up the numbers as the switching between octal, hexadecimal and decimal was getting confusing.
Regards,
Stephan J.R. van Schaik.
I'm currently stuck on a bug while I was rewriting second stage of my boot loader. My boot sector loads my second stage to 0x0000:0x0500, which works fine. The second stage is currently about 1172 bytes in size and 1979-2614 (in RAM, so plus 0x500 bytes) is filled up with messages which are being display in order to present the current state of the second stage. However, when I created a new floppy image and booted it on Qemu, Bochs and VirtualBox, it displayed:
Code: Select all
Trying to ent
???OEMID
Code: Select all
jmp short main
nop
OEM: db "OEMID"
times 11 - ($ - $$) db 0
Code: Select all
2288 \r \n \0 T r y i n g t o e n t
0d 0a 00 54 72 79 69 6e 67 20 74 6f 20 65 6e 74
2304 e r u n r e a l m o d e . \r
Code: Select all
2272 \n \0 T r y i n g t o e n t e
0a 00 54 72 79 69 6e 67 20 74 6f 20 65 6e 74 65
2288 r u n r e a l m o d e . \r \n
72 20 75 6e 72 65 61 6c 20 6d 6f 64 65 2e 0d 0a
2304 \0 N o w r u n n i n g i n
00 4e 6f 77 20 72 75 6e 6e 69 6e 67 20 69 6e 20
Code: Select all
Trying to enter unreal mode.
???OEMID
Edit: fixed up the numbers as the switching between octal, hexadecimal and decimal was getting confusing.
Regards,
Stephan J.R. van Schaik.