This commit is contained in:
user
2026-02-25 15:20:06 +01:00
parent 8b271e2470
commit 23b453dac8
3 changed files with 37 additions and 10 deletions

View File

@@ -160,7 +160,7 @@ void* getFreeVirtSpace(four_lvl_paging_t* search_table, uint8_t num_pages){
}
void setMapping(uintptr_t vaddr, void* frame, four_lvl_paging_t* flpt){
void setMapping(uintptr_t vaddr, void* frame, four_lvl_paging_t* flpt, uint8_t writeable){
uint16_t l4Index = (vaddr>>39) & 0x1FF;
uint16_t l3Index = (vaddr>>30) & 0x1FF;
uint16_t l2Index = (vaddr>>21) & 0x1FF;
@@ -207,7 +207,7 @@ void setMapping(uintptr_t vaddr, void* frame, four_lvl_paging_t* flpt){
assert(!(lvl1->entries[l1Index].present)); // should not be present, bc its a new mapping
lvl1->entries[l1Index] = {
.present = 1,
.write = 1,
.write = writeable,
.user = 1,
.address = (uintptr_t)frame >> 12
};