pagetable lab initialized

This commit is contained in:
2025-05-06 11:20:36 +08:00
parent 0e751d690f
commit 38997cbef6
42 changed files with 1963 additions and 1154 deletions

View File

@ -7,7 +7,6 @@
#include "memlayout.h"
#include "spinlock.h"
#include "riscv.h"
#include "proc.h"
#include "defs.h"
void freerange(void *pa_start, void *pa_end);
@ -81,17 +80,3 @@ kalloc(void)
memset((char*)r, 5, PGSIZE); // fill with junk
return (void*)r;
}
int
freemem(void)
{
struct run* p = kmem.freelist;
uint64 num = 0;
while (p) {
num += 1;
p = p->next;
}
return num * PGSIZE;
}