next up previous contents index
Next: 10.5.8 paging_enable: enable page Up: (X86) Processor Identification and Previous: 10.5.6 i16_enter_pmode: enter protected

10.5.7 i16_leave_pmode: leave protected mode

 

SYNOPSIS

#include <oskit/x86/pmode.h>

void i16_leave_pmode(int real_cs);

DESCRIPTION

This 16-bit function switches the processor out of protected mode and back into real mode by turning off the Protection Enable (PE) bit in CR0. The instruction that clears the PE bit is followed immediately by a jump instruction to flush the prefetch buffer, as recommended by Intel documentation. At the same time, this function also initializes the CS register with the appropriate real-mode code segment, specified by the real_cs parameter.

This routine does not perform any of the other steps in Intel's recommended mode switching procedure, such as reinitializing the data segment registers; these steps must be performed separately. See Section 10.10 for information on the full mode switch implementation provided by the base environment.



University of Utah Flux Research Group