diff options
author | Austin Clements <[email protected]> | 2010-09-02 15:37:05 -0400 |
---|---|---|
committer | Austin Clements <[email protected]> | 2010-09-02 15:42:25 -0400 |
commit | f53e6110bed159c8541c6e0d2fc1b1ffac2d141a (patch) | |
tree | b71b99eb612d27fb054a07ff149668e579fb5fb2 /proc.c | |
parent | b3cfd7fc372424d754f5478c93f6fbe756d9c80f (diff) | |
download | xv6-labs-f53e6110bed159c8541c6e0d2fc1b1ffac2d141a.tar.gz xv6-labs-f53e6110bed159c8541c6e0d2fc1b1ffac2d141a.tar.bz2 xv6-labs-f53e6110bed159c8541c6e0d2fc1b1ffac2d141a.zip |
Simplify inituvm and userinit by assuming initcode fits on a page
Diffstat (limited to 'proc.c')
-rw-r--r-- | proc.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -120,11 +120,8 @@ userinit(void) initproc = p; if(!(p->pgdir = setupkvm())) panic("userinit: out of memory?"); - if(!allocuvm(p->pgdir, 0x0, (int)_binary_initcode_size)) - panic("userinit: out of memory?"); - inituvm(p->pgdir, 0x0, _binary_initcode_start, - (int)_binary_initcode_size); - p->sz = PGROUNDUP((int)_binary_initcode_size); + inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size); + p->sz = PGSIZE; memset(p->tf, 0, sizeof(*p->tf)); p->tf->cs = (SEG_UCODE << 3) | DPL_USER; p->tf->ds = (SEG_UDATA << 3) | DPL_USER; |