Avoid "boot" in xv6

This commit is contained in:
Frans Kaashoek 2011-08-15 20:11:13 -04:00
parent 9449646853
commit a4b213cf49
11 changed files with 43 additions and 51 deletions

View file

@ -21,15 +21,15 @@ struct {
extern char end[]; // first address after kernel loaded from ELF file
char *newend;
// simple page allocator to get off the ground during boot
// simple page allocator to get off the ground during entry
char *
boot_alloc(void)
enter_alloc(void)
{
if (newend == 0)
newend = end;
if ((uint) newend >= KERNBASE + 0x400000)
panic("only first 4Mbyte are mapped during boot");
panic("only first 4Mbyte are mapped during entry");
void *p = (void*)PGROUNDUP((uint)newend);
memset(p, 0, PGSIZE);
newend = newend + PGSIZE;