So I'm having this very strange bug that triggers a page fault. Apparently, those are the instructions that triggers the page fault:
Code:
(0) [0x000000402f42] 0008:0000000000402f42 (unk. ctxt): add eax, 0x2345e064 ; 0564e04523
<bochs:8> s
Next at t=1451281218
(0) [0x000000402f47] 0008:0000000000402f47 (unk. ctxt): add dword ptr ds:[eax], eax ; 0100
It makes sense as 0x2345e064 is not a valid adress. The problem however is that when I look at my kernel.exe in IDA it shows following instructions at the same spot:
Code:
.text:00402F42 add eax, offset word_40E064
.text:00402F47 movzx eax, word ptr [eax]
It looks like the code is being modified while the OS is running...
What's more interresting. I started having this issue after changing this line of code:
Code:
terminal_print(term, "\tAvailable memory: %uMB\n", memory_get_available()/1024/1024);
to this one:
Code:
terminal_print(term, "\tAvailable memory: %uMB\n", memory_get_available()/1000000);
in a funtion that has absolutely nothing to do with the page fault triggering function.
I have absolutely no idea what is going on in here. Can you help me with understanding it?