Rework x86_64 paging and vmm

This commit is contained in:
2025-08-30 00:31:20 +02:00
parent 8cf1bde879
commit 7a52f2f051
28 changed files with 262 additions and 291 deletions

View File

@ -7,6 +7,7 @@
#include "bitmap/bitmap.h"
#include "util/util.h"
#include "vmm/vmm.h"
#include "pmm/pmm.h"
#include "malloc.h"
#define USE_DL_PREFIX 1
@ -64,10 +65,9 @@ void *sbrk(long inc) {
}
uint64_t blocks = _DIV_ROUNDUP(inc, BITMAP_BLOCK_SIZE);
void *virt = vmm_alloc(blocks);
uint8_t *virt = VIRT(pmm_alloc(blocks));
hal_memset(virt, 0, blocks * BITMAP_BLOCK_SIZE);
_last = (void *)((size_t)virt + inc);
_last = (void *)(virt + inc);
return virt;
}