Ollie Lho wrote:
Ronald, It seems that you made some mistake in mixing 16 and 32 bits code in the intel_start32.S:
_realstart: cli movw %cs, %eax movw %eax, %es
xor %eax, %eax mov %eax, %cr3 /* Invalidate TLB*/ .byte 0x66 /* prefix */ .byte 0x26 .byte 0x0f, 0x01, 0x16 /* lgdt [es:offset]*/ .word 0x02 /* offset in segment */ movl %cr0, %eax andl $0x7FFAFFD1, %eax /* PG,AM,WP,NE,TS,EM,MP = 0*/ orl $1, %eax movl %eax, %cr0 data32 ljmp $0x10, $.Lprotected
Before _realstart there was a .code16 directive, so it should be in 16 bits mode, so how could those 32 bits (long) operation works ??
The compiler (assembler) adds 32-bit prefix to the insn.