summaryrefslogtreecommitdiff
path: root/kalloc.c
diff options
context:
space:
mode:
authorRobert Morris <[email protected]>2010-08-31 15:39:25 -0400
committerRobert Morris <[email protected]>2010-08-31 15:39:25 -0400
commit8d774afb2d45592d85725474a704ac99b0624d2c (patch)
tree5a745a3a37c9bed426f27d72f151de48ac3bcaa1 /kalloc.c
parent880ee18ab14477b669a6b95707721322bfe086c1 (diff)
downloadxv6-labs-8d774afb2d45592d85725474a704ac99b0624d2c.tar.gz
xv6-labs-8d774afb2d45592d85725474a704ac99b0624d2c.tar.bz2
xv6-labs-8d774afb2d45592d85725474a704ac99b0624d2c.zip
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
Diffstat (limited to 'kalloc.c')
-rw-r--r--kalloc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/kalloc.c b/kalloc.c
index 65de759..8c9ff93 100644
--- a/kalloc.c
+++ b/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);
}