summaryrefslogtreecommitdiff
path: root/kalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'kalloc.c')
-rw-r--r--kalloc.c4
1 files changed, 3 insertions, 1 deletions
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;