PAE & PSE
Posted: Sat Jun 25, 2005 6:22 am
Hello, i want activate PAE and PSE.
But if i execute this function Qemu & VMware are fucking up.
Code: Select all
ulong *page_dir = (ulong *)0x200000;
bool MmInit()
{
ulong address = 0;
int i;
page_dir[0] = address;
page_dir[0] |= 0x83;
for (i = 1; i < 1024; i++)
page_dir[i] = 0;
asm("mov cr3, eax" :: "a"(page_dir));
asm("mov eax,cr4" : "=a"(i));
i = i | 0x10;
asm("mov cr4,eax" :: "a"(i));
asm("mov eax,cr4" : "=a"(i));
i = i | 0x20;
asm("mov cr4,eax" :: "a"(i));
asm("mov eax,cr0;" : "=a"(i));
i = i | 0x80000000;
asm("mov cr0, eax;" :: "a"(i));
}