I´m in my 16bit bootloader. I searched (E820h) for a big memory region (above 1MB) and want to load my kernel file to that position.
I cant access this region in real mode, I know, but I dont want to, I just want to load the file.
This is my structure for the AH 42h call:
Code: Select all
.dap:
.dap_sz db 0
.dap_zero db 0
.dap_sread dw 0
.dap_ptr_off dw 0
.dap_ptr_seg dw 0
.dap_ssec_lo dd 0
.dap_ssec_hi dd 0
.dap_qaddr_lo dd 0
.dap_qaddr_hi dd 0
I initialize the structure like this:
Code: Select all
.dap_sz = 0x18
.dap_sread = 1
.dap_ptr_off = 0xffff
.dap_ptr_seg = 0xffff
.dap_ssec_lo = fat32_sector_of_the_file
.dap_qaddr_lo = a_big_address
;other fields are set to 0
The problem:
CF is cleared, 1 sector is loaded. But if I look at the destination address ("a_big_address"), nothing is loaded here.
So do I misunderstand the 64-bit-address-field of the structure?
Thanks for the help!
Edit:
I dumped the memory of bochs and searched for the loaded sector. It is loaded, but at address 0xFFEF.
I used 0x8000 (for debug) as address for the sector and I also used 0x9000. The sector is always loaded at 0xFFEF...