Triple error installing IA32 EFER.LME

We are working on the educational operating system Pintos, trying to configure it to support virtualization. We start with a 32-bit version, and our first step would be to switch to 64-bit mode and continue from there. We operate Pintos through Bochs.

We examined the steps for this in the Intel Programmer manual (chapter 9.8.5, volume 3), and when we want to set the IA32 EFER.LME bit to 1 to enable IA32e mode, the system generates a triple error and starts working again from the very beginning.

Here is the code we were working on.

#Step 1: Disable paging CR0_PG = 0. Use MOV CR0 instr. to disable paging (instr. must be located in an identity-mapped page.
    movl %cr0, %eax
    andl $0x7fffffff, %eax
    movl %eax, %cr0

#Step 2: Enable physical-address extensions by setting CR4_PAE = 1
    movl %cr4, %eax
    orl $CR4_PAE, %eax
    movl %eax, %cr4

#Step 3: Load CR3 with the physical base address of the level 4 page map table PML4
    movl $0xe000, %eax
    movl %eax, %cr3

    xchg %bx, %bx
#Step 4: Enable IA-32e mode by setting IA32_EFER_LME = 1
    movl $0xc0000080, %ecx
    rdmsr
    or $IA32_EFER_LME, %eax
    wrmsr

#Step 5: Enable paging CR0_PG = 1.
    movl %cr0, %eax
    orl $CR0_PG, %eax
    movl %eax, %cr0

We tried to configure our own TSS, because of all the possible cases proposed by Intel, which could generate a triple error, this seemed to be the only reasonable reason.

, ? , , .

+4
1

- . , , Pintos, bochs, 64- . , .

+1

All Articles