When executing this instruction I got an exception
LFS ESI,PWORD PTR [EBP+12]
From this page http://wiki.osdev.org/Double_Fault#Double_Fault
Any PUSH or POP instruction or any instruction using ESP or EBP as a base register is executed, while the stack address is not in canonical form.
So i think it should be an Stack-Segment Fault here.
But the system gives an general protection exception(0D).
Could anyone tell me why the result is this?
General protection fault for an LFS occurs when:
trying to load is not with the
descriptor table limits
table, but it’s not a readable data
segment
(meaning less privilege) that the
privilige level for the descriptor.
So, the problem is not the instruction itself, but the segment descriptor table.
See chapter 3 in the Intel Software Developer’s Manual Volume 3A:
http://www.intel.com/products/processor/manuals/?wapkw=(Intel+64+and+IA-32+Architectures)