| 238 | } |
| 239 | |
| 240 | page_table_t AllocatePageTable(){ |
| 241 | void* virt = KernelAllocate4KPages(1); |
| 242 | uint64_t phys = Memory::AllocatePhysicalMemoryBlock(); |
| 243 | |
| 244 | KernelMapVirtualMemory4K(phys,(uintptr_t)virt, 1); |
| 245 | |
| 246 | page_table_t pTable; |
| 247 | pTable.phys = phys; |
| 248 | pTable.virt = (page_t*)virt; |
| 249 | |
| 250 | for(int i = 0; i < PAGES_PER_TABLE; i++){ |
| 251 | ((page_t*)virt)[i] = 0; |
| 252 | } |
| 253 | |
| 254 | return pTable; |
| 255 | } |
| 256 | |
| 257 | void CreatePageTable(uint16_t pdptIndex, uint16_t pageDirIndex, address_space_t* addressSpace){ |
| 258 | page_table_t pTable = AllocatePageTable(); |
no test coverage detected