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:
parent
880ee18ab1
commit
8d774afb2d
5 changed files with 13 additions and 49 deletions
8
kalloc.c
8
kalloc.c
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue