/* prot.S - protected mode code */ #define ASM 1 #include .code32 .text .globl enter_realmode, _enter_realmode enter_realmode: _enter_realmode: cli movl $realidtdesc,%eax lidt (%eax) movl %cr0, %eax xorl $(CR0_PE),%eax movl %eax,%cr0 movw $(SEG_REAL),%ax movw %ax,%gs movw %ax,%fs movw %ax,%es movw %ax,%ds ljmpl $(SEG_REAL),$realmode_entry .code16 .extern enter_protmode, _enter_protmode .text realmode_entry: _realmode_entry: #sti jmpl enter_protmode nop