Skip to content
Snippets Groups Projects
Commit 05d66b06 authored by Robert Morris's avatar Robert Morris
Browse files

my comment is wrong, exec handles BSS fine

parent 4587b358
No related branches found
No related tags found
No related merge requests found
......@@ -48,9 +48,6 @@ 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)))
......
......@@ -1419,6 +1419,21 @@ validatetest(void)
printf(stdout, "validate ok\n");
}
char uninit[10000];
void
bsstest(void)
{
int i;
printf(stdout, "bss test\n");
for(i = 0; i < sizeof(uninit); i++){
if(uninit[i] != '\0'){
printf(stdout, "bss test failed\n");
exit();
}
}
printf(stdout, "bss test ok\n");
}
int
main(int argc, char *argv[])
{
......@@ -1430,6 +1445,7 @@ main(int argc, char *argv[])
}
close(open("usertests.ran", O_CREATE));
bsstest();
sbrktest();
validatetest();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment