iansjack wrote:Run your code in qemu with debugging enabled. Use gdb and single-step throught the code. The problem should then reveal itself.
So I took your advise and I installed qemu and gdb. Qemu emulates my disk perfectly. Gdb can connect to qemu. But the problem is that I can't place breakpoints.bluemoon wrote:have you actually see what's executing on the debugger?
Somewhere on the internet I found out that this is because when starting qemu in suspended mode, it is still in real mode, gdb will think in real-mode. So if I create a breakpoint on a specific address, gdb will put it in real mode. When I arrive in x64-mode at that address, something does happen at that address, but gdb will totally freak out and I can't do anything interesting at that point.
Do you know how I can start qemu not suspended but make gdb break at the address I want? I tried putting int 3 in the code, I tried using the DR0 register, nothing seems to work (or I don't know how to do it correctly).