Page 2 of 2

Re: Kernel Crashes due to compiler optimization

Posted: Sat Jun 10, 2017 12:07 am
by iocoder
yerri07 wrote:I tried above code cause another strange execution happened when i have a code to print functions in assembly and called the function from the c file(linked both files) , the first two instructions are not executed and but when i place a call to print the message with in the assembly file it executes correctly . So i gave a try compiling the above tutorial code.

see the disassembly of the code (push edi) in the image, the stack doesn't changed after the execution.

I will provide you the image that caused the strange execution.

1. After stepping the instruction
2.Before steeping the instruction
Looks like the emulator misinterprets the opcode at 0xc0001120. Are you sure your code never modifies this memory location?

Re: Kernel Crashes due to compiler optimization

Posted: Tue Jun 13, 2017 11:22 am
by irvanherz
I'm not sure. But I think that was because inline assemblies that not marked as volatile