Avoid "boot" in xv6
This commit is contained in:
parent
9449646853
commit
a4b213cf49
11 changed files with 43 additions and 51 deletions
6
kalloc.c
6
kalloc.c
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue