xv6

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 05d66b06294df89ba3d5b8f6cf535f7edf00bd1f
parent 4587b35847b116057e3ef1058da914b8837ff343
Author: Robert Morris <rtm@csail.mit.edu>
Date:   Sun, 19 Sep 2010 13:47:52 -0400

my comment is wrong, exec handles BSS fine

Diffstat:
Mexec.c | 3---
Musertests.c | 16++++++++++++++++
2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/exec.c b/exec.c @@ -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))) diff --git a/usertests.c b/usertests.c @@ -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();