vm.c
// Load the initcode into address 0 of pgdir.
// sz must be less than a page.
Load the initcode into address 0 of pgdir.
sz must be less than a page.
Load the initcode into address 0 of pgdir . sz must be less than a page .
void
inituvm(pde_t *pgdir, char *init, uint sz)
{
  char *mem;
  if(sz >= PGSIZE)
    panic("inituvm: more than a page");
  mem = kalloc();
  memset(mem, 0, PGSIZE);
  mappages(pgdir, 0, PGSIZE, v2p(mem), PTE_W|PTE_U);
  memmove(mem, init, sz);
}
void inituvm ( pde_t * pgdir , char * init , uint sz ) { char * mem ; if ( sz >= PGSIZE ) panic ( " " ) ; mem = kalloc ( ) ; memset ( mem , 0 , PGSIZE ) ; mappages ( pgdir , 0 , PGSIZE , v2p ( mem ) , PTE_W | PTE_U ) ; memmove ( mem , init , sz ) ; }
Load the initcode into address 0 of pgdir.
Load the initcode into address 0 of pgdir .