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

@ -6,6 +6,7 @@
#include "bootinfo/bootinfo.h"
#include "spinlock/spinlock.h"
#include "util/util.h"
#include "hal/hal.h"
PhysMem PHYS_MEM;
@ -13,7 +14,6 @@ void pmm_init(void) {
spinlock_init(&PHYS_MEM.spinlock);
BitMap *bm = &PHYS_MEM.self;
bm->init = false;
bm->nblocks = _DIV_ROUNDUP(BOOT_INFO.memmap_total, BITMAP_BLOCK_SIZE);
bm->nbytes = _DIV_ROUNDUP(bm->nblocks, 8);
@ -48,7 +48,6 @@ void pmm_init(void) {
bm->alloc_blocks = 0;
LOG("pmm", "phys bitmap init 0x%lx, size = 0x%lx\n", physbegin, bm->nbytes);
bm->init = true;
}
void *pmm_alloc(size_t pages) {