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.
movl %cr0, %eax
andl $0x7fffffff, %eax
movl %eax, %cr0
movl %cr4, %eax
orl $CR4_PAE, %eax
movl %eax, %cr4
movl $0xe000, %eax
movl %eax, %cr3
xchg %bx, %bx
movl $0xc0000080, %ecx
rdmsr
or $IA32_EFER_LME, %eax
wrmsr
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.
, ? , , .