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)
This commit is contained in:
Frans Kaashoek 2011-08-09 21:37:35 -04:00
parent 3a03810643
commit 66ba8079c7
9 changed files with 1101 additions and 103 deletions

View file

@ -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;