no more pminit, or ELF header at 0x10000

kinit() knows about end and PHYSTOP
map all of kernel read/write (rather than r/o instructions)
thanks, austin
This commit is contained in:
Robert Morris 2010-08-31 15:39:25 -04:00
parent 880ee18ab1
commit 8d774afb2d
5 changed files with 13 additions and 49 deletions

View file

@ -19,11 +19,13 @@ struct {
// Initialize free list of physical pages.
void
kinit(char *p, uint len)
kinit(void)
{
extern char end[];
initlock(&kmem.lock, "kmem");
char *p1 = (char*)PGROUNDUP((uint)p);
char *p2 = PGROUNDDOWN(p + len);
char *p1 = (char*)PGROUNDUP((uint)end);
char *p2 = PGROUNDDOWN(PHYSTOP);
for( ; p1 < p2; p1 += 4096)
kfree(p1);
}