mirror of
https://gitlab.os-k.eu/os-k-team/os-k.git
synced 2023-08-25 14:03:10 +02:00
Userspace code runs !
This commit is contained in:
parent
d0d546e073
commit
2a1990e043
@ -113,7 +113,8 @@ void MmInitPaging(void)
|
||||
|
||||
//DebugLog("\t\t\t\tPDP %d : %p\n", index, MmPDP);
|
||||
MmPageMapLevel4[index] = (pdpe_t *)((ulong)MmPDP | PRESENT
|
||||
| READWRITE);
|
||||
| READWRITE
|
||||
| USERMODE );
|
||||
|
||||
for (curAddrPDP = curAddrPML4;
|
||||
curAddrPDP < (curAddrPML4 + ((ulong)KPAGESIZE * 0x8000000));
|
||||
@ -134,7 +135,8 @@ void MmInitPaging(void)
|
||||
index = (curAddrPDP / ((ulong)KPAGESIZE * 0x40000)) % 512;
|
||||
|
||||
//DebugLog("\t\t\t\tPD %d : %p\n", index, MmPD);
|
||||
MmPDP[index] = (pde_t *)((ulong)MmPD | PRESENT | READWRITE);
|
||||
MmPDP[index] = (pde_t *)((ulong)MmPD | PRESENT
|
||||
| READWRITE );
|
||||
|
||||
for (curAddrPD = curAddrPDP;
|
||||
curAddrPD < (curAddrPDP + ((ulong)KPAGESIZE * 0x40000));
|
||||
@ -155,7 +157,7 @@ void MmInitPaging(void)
|
||||
|
||||
//DebugLog("\t\t\t\tPT %d : %p\n", index, MmPT);
|
||||
MmPD[index] = (pte_t *)((ulong)MmPT | PRESENT
|
||||
| READWRITE);
|
||||
| READWRITE );
|
||||
|
||||
for (curAddrPT = curAddrPD;
|
||||
curAddrPT < (curAddrPD + ((ulong)KPAGESIZE * 0x200));
|
||||
@ -252,7 +254,10 @@ ulong *MmGetPageDescriptorFromVirtual(void *virtualAddr)
|
||||
|
||||
// Set present
|
||||
MmPageMapLevel4[pml4Index] =
|
||||
(pml4_t)((ulong)MmPageMapLevel4[pml4Index] | PRESENT | READWRITE);
|
||||
(pml4_t)((ulong)MmPageMapLevel4[pml4Index]
|
||||
| PRESENT
|
||||
| READWRITE
|
||||
| USERMODE * (virtualAddr >= USERSPACE) );
|
||||
|
||||
pdp = (pdpe_t *)((ulong)MmPageMapLevel4[pml4Index] & 0xFFFFFFFFFF000);
|
||||
//DebugLog("\tCreate PDP at %p\n", MmPageMapLevel4[pml4Index]);
|
||||
@ -268,7 +273,10 @@ ulong *MmGetPageDescriptorFromVirtual(void *virtualAddr)
|
||||
|
||||
pdp[pdpIndex] = memalign(512*sizeof(pde_t), KPAGESIZE);
|
||||
|
||||
pdp[pdpIndex] = (pdpe_t)((ulong)pdp[pdpIndex] | PRESENT | READWRITE);
|
||||
pdp[pdpIndex] = (pdpe_t)((ulong)pdp[pdpIndex]
|
||||
| PRESENT
|
||||
| READWRITE
|
||||
| USERMODE * (virtualAddr >= USERSPACE) );
|
||||
|
||||
pd = (pde_t *)((ulong)pdp[pdpIndex] & 0xFFFFFFFFFF000);
|
||||
//DebugLog("\tCreate PD at %p\n", (ulong)pdp[pdpIndex]);
|
||||
@ -284,7 +292,10 @@ ulong *MmGetPageDescriptorFromVirtual(void *virtualAddr)
|
||||
|
||||
pd[pdIndex] = memalign(512*sizeof(pte_t), KPAGESIZE);
|
||||
|
||||
pd[pdIndex] = (pde_t)((ulong)pd[pdIndex] | PRESENT | READWRITE);
|
||||
pd[pdIndex] = (pde_t)((ulong)pd[pdIndex]
|
||||
| PRESENT
|
||||
| READWRITE
|
||||
| USERMODE * (virtualAddr >= USERSPACE) );
|
||||
|
||||
pt = (pte_t *)((ulong)pd[pdIndex] & 0xFFFFFFFFFF000);
|
||||
//DebugLog("\tCreate PT at %p\n", (ulong)pd[pdIndex]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user