Re: FAT16 bootloader
Posted: Mon Apr 19, 2021 1:30 am
You are 100% right, I didn't take into account the alignment:MichaelPetch wrote:Your DAP has moved. The bytes you are displaying no longer represent where your DAP now resides. I assume it has moved because you have made modifications to the code and data shifting the location.
Code: Select all
0x0000000000007d30 <bogus+ 0>: 0x10 0x00 0x01 0x00 0x00 0x06 0x00 0x00
0x0000000000007d38 <bogus+ 8>: 0x2c 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Code: Select all
rax: 00000000_0000422c
rbx: 00000000_00000600
rcx: 00000000_00090001
rdx: 00000000_00000080
rsp: 00000000_0000ffec
rbp: 00000000_00000000
rsi: 00000000_000e7d30
rdi: 00000000_0000ffac
r8 : 00000000_00000000
r9 : 00000000_00000000
r10: 00000000_00000000
r11: 00000000_00000000
r12: 00000000_00000000
r13: 00000000_00000000
r14: 00000000_00000000
r15: 00000000_00000000
rip: 00000000_00007cf5
eflags 0x00000202: id vip vif ac vm rf nt IOPL=0 of df IF tf sf zf af pf cf
EDIT:
After using bochs debugger to see if the sector was copied on memory, after dissecting 0x600 i can find STAGE2 ����������iY“R� ��� which matches the sector on the hdd file where the file resides, so my next guess is that after verifying the file exists, I might have overstated some things and it's very possible that the formulas I use are wrong and the file load doesn't work due to that? (I've checked the real destination of STAGE2 on-memory and it appears blank [Should contain FA F4 "cli; hlt])