exec questions
This commit is contained in:
parent
faad047ab2
commit
4587b35847
2 changed files with 9 additions and 3 deletions
6
exec.c
6
exec.c
|
|
@ -48,6 +48,9 @@ exec(char *path, char **argv)
|
|||
}
|
||||
iunlockput(ip);
|
||||
|
||||
// XXX rtm: what about the BSS? shouldn't there be some
|
||||
// bzero()ing here?
|
||||
|
||||
// Allocate and initialize stack at sz
|
||||
sz = spbottom = PGROUNDUP(sz);
|
||||
if(!(sz = allocuvm(pgdir, sz, sz + PGSIZE)))
|
||||
|
|
@ -62,6 +65,9 @@ exec(char *path, char **argv)
|
|||
sp = sz;
|
||||
argp = sz - arglen - 4*(argc+1);
|
||||
|
||||
// XXX rtm: does the following code work if the
|
||||
// arguments &c do not fit in one page?
|
||||
|
||||
// Copy argv strings and pointers to stack.
|
||||
*(uint*)(mem+argp-spbottom + 4*argc) = 0; // argv[argc]
|
||||
for(i=argc-1; i>=0; i--){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue