fix corner cases in exec of ELF

put an invalid page below the stack
have fork() handle invalid pages
This commit is contained in:
Robert Morris 2010-08-06 11:12:18 -04:00
parent 1afc9d3fca
commit c4cc10da7e
8 changed files with 84 additions and 37 deletions

3
defs.h
View file

@ -163,7 +163,8 @@ void freevm(pde_t*);
void inituvm(pde_t*, char*, char*, uint);
int loaduvm(pde_t*, char*, struct inode *ip, uint, uint);
pde_t* copyuvm(pde_t*,uint);
void loadvm(struct proc*);
void switchuvm(struct proc*);
void switchkvm();
// number of elements in fixed-size array
#define NELEM(x) (sizeof(x)/sizeof((x)[0]))