From 66ba8079c7e376c189ccb3367b8d13825141b8ec Mon Sep 17 00:00:00 2001 From: Frans Kaashoek Date: Tue, 9 Aug 2011 21:37:35 -0400 Subject: Use static page table for boot, mapping first 4Mbyte; no more segment trick Allocate proper kernel page table immediately in main using boot allocator Remove pginit Simplify address space layout a tiny bit More to come (e.g., superpages to simplify static table) --- kalloc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'kalloc.c') diff --git a/kalloc.c b/kalloc.c index cc6d380..cf89dd4 100644 --- a/kalloc.c +++ b/kalloc.c @@ -23,11 +23,13 @@ char *newend; // simple page allocator to get off the ground during boot char * -pgalloc(void) +boot_alloc(void) { if (newend == 0) newend = end; + if ((uint) newend >= KERNBASE + 0x400000) + panic("only first 4Mbyte are mapped during boot"); void *p = (void*)PGROUNDUP((uint)newend); memset(p, 0, PGSIZE); newend = newend + PGSIZE; -- cgit v1.2.3