Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application #165

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ UPROGS=\
_usertests\
_wc\
_zombie\
_yes\

fs.img: mkfs README $(UPROGS)
./mkfs fs.img README $(UPROGS)
Expand Down Expand Up @@ -250,7 +251,7 @@ qemu-nox-gdb: fs.img xv6.img .gdbinit
EXTRA=\
mkfs.c ulib.c user.h cat.c echo.c forktest.c grep.c kill.c\
ln.c ls.c mkdir.c rm.c stressfs.c usertests.c wc.c zombie.c\
printf.c umalloc.c\
printf.c umalloc.c yes.c\
README dot-bochsrc *.pl toc.* runoff runoff1 runoff.list\
.gdbinit.tmpl gdbutil\

Expand Down
4 changes: 4 additions & 0 deletions usertests.c
Original file line number Diff line number Diff line change
Expand Up @@ -1458,7 +1458,11 @@ sbrktest(void)
exit();
}
lastaddr = (char*) (BIG-1);

#pragma GCC diagnostic ignored "-Wstringop-overflow"
*lastaddr = 99;
#pragma GCC diagnostic pop


// can one de-allocate?
a = sbrk(0);
Expand Down
13 changes: 13 additions & 0 deletions yes.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include "types.h"
#include "stat.h"
#include "user.h"

int
main(int argc, char *argv[])
{
for (int i = 0; i < 100; i++)
printf(1, "%s\n", (argc>1? argv[1]: "y"));
// printf(1, "y\n");
exit();
}