Hope you are all doing good with the current worldwide situation!
While being at home, I decided to challenge myself and learn something completely out of my comfort zone.
I followed some tutorial, read a lot and played with my own .asm program and even an bootsector / qemu.
I did learn a lot so far, but also a lot about gdb and how to run it to debug my project.
I am currently reading through this PDF and this Github Project that seems to be following the PDF. I also use a lot OSDev wiki for various references.
My first question is regarding the segment
I went trough the OSDev Segmentation page.
I do not understand this :
Code: Select all
Eg, the segment 0x1000 has a base address of 0x10000. This segment occupies the physical address range 0x10000 -> 0x1FFFF, However the segment 0x1010 has a base address of 0x10100. This segment occupies the physical address range 0x10100 -> 0x200FF
Where is that extra 0 coming from?
Ain't we in 16bit mode at this point?
My second question is regarding the Disk BootSector
I pretty much understand the code from this example along with the referenced url.
The only thing that I do not understand about that example, is while using Qemu (-s -S) to run my bin file and using gdb to check the registers values (b 0x7c00 -> c -> info registers dl), I can see that DL register is already set to 0x80.
Where is it coming from? I was expecting that I would have to set it myself in my asm file.
Is it because we "booted from hdisk" through Qemu and bootloader set dl to 0x80?
Thank you very much for the help!
Felix