From 735ac4b8d255f4d1cf8cebaeb3a6a724ea3df008 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 26 May 2006 20:59:59 +0000 Subject: [PATCH] Make the default simulator qemu for project 2...4, instead of just doing so in tests/Makefile. Update documentation to match. --- doc/filesys.texi | 4 ---- doc/intro.texi | 13 ++++++++----- doc/userprog.texi | 4 +--- doc/vm.texi | 4 ---- src/filesys/Make.vars | 1 + src/tests/Make.tests | 2 +- src/threads/Make.vars | 1 + src/userprog/Make.vars | 1 + src/utils/pintos | 4 +--- src/vm/Make.vars | 1 + tests/Makefile | 3 +-- 11 files changed, 16 insertions(+), 22 deletions(-) diff --git a/doc/filesys.texi b/doc/filesys.texi index 08ac31c..a93481c 100644 --- a/doc/filesys.texi +++ b/doc/filesys.texi @@ -14,10 +14,6 @@ filesys submission. If you build on project 3, then all of the project @file{filesys/Make.vars} to enable VM functionality. You can receive up to 5% extra credit if you do enable VM. -The tests for project 4 will run much faster if -you use the qemu emulator, e.g.@: via @code{make check -PINTOSOPTS='--qemu'}. - @menu * Project 4 Background:: * Project 4 Requirements:: diff --git a/doc/intro.texi b/doc/intro.texi index d95842e..f5e6fb3 100644 --- a/doc/intro.texi +++ b/doc/intro.texi @@ -268,8 +268,8 @@ When you're debugging code, it's useful to be able to run a program twice and have it do exactly the same thing. On second and later runs, you can make new observations without having to discard or verify your old observations. This property is called -``reproducibility.'' The simulator we use by default, Bochs, can be set -up for +``reproducibility.'' One of the simulators that Pintos supports, Bochs, +can be set up for reproducibility, and that's the way that @command{pintos} invokes it by default. @@ -337,7 +337,10 @@ After running all the tests, @command{make check} also prints a summary of the test results. For project 1, the tests will probably run faster in Bochs. For the -rest of the projects, they will probably run faster in qemu. +rest of the projects, they will run much faster in qemu. +@command{make check} will select the faster simulator by default, but +you can override its choice by specifying @option{SIMULATOR=--bochs} or +@option{SIMULATOR=--qemu} on the @command{make} command line. You can also run individual tests one at a time. A given test @var{t} writes its output to @file{@var{t}.output}, then a script scores the @@ -353,8 +356,8 @@ its run. If you prefer, you can observe the progress of each test by specifying @option{VERBOSE=1} on the @command{make} command line, as in @code{make check VERBOSE=1}. You can also provide arbitrary options to the @command{pintos} run by the tests with @option{PINTOSOPTS='@dots{}'}, -e.g.@: @code{make check PINTOSOPTS='--qemu'} to run the tests under -qemu. +e.g.@: @code{make check PINTOSOPTS='-j 1'} to select a jitter value of 1 +(@pxref{Debugging Versus Testing}). All of the tests and related files are in @file{pintos/src/tests}. Before we test your submission, we will replace the contents of that diff --git a/doc/userprog.texi b/doc/userprog.texi index 65caf33..b3987d9 100644 --- a/doc/userprog.texi +++ b/doc/userprog.texi @@ -20,9 +20,7 @@ assignment. The ``alarm clock'' functionality may be useful in projects 3 and 4, but it is not strictly required. You might find it useful to go back and reread how to run the tests -(@pxref{Testing}). In particular, the tests for project 2 (and later -projects) will run much faster if you use the qemu emulator, e.g.@: -via @code{make check PINTOSOPTS='--qemu'}. +(@pxref{Testing}). @menu * Project 2 Background:: diff --git a/doc/vm.texi b/doc/vm.texi index 53c88cb..be99808 100644 --- a/doc/vm.texi +++ b/doc/vm.texi @@ -17,10 +17,6 @@ in project 3. You will continue to handle Pintos disks and file systems the same way you did in the previous assignment (@pxref{Using the File System}). -The tests for project 3 (and later projects) will run much faster if -you use the qemu emulator, e.g.@: via @code{make check -PINTOSOPTS='--qemu'}. - @menu * Project 3 Background:: * Project 3 Suggested Order of Implementation:: diff --git a/src/filesys/Make.vars b/src/filesys/Make.vars index 7fec172..d8050cd 100644 --- a/src/filesys/Make.vars +++ b/src/filesys/Make.vars @@ -4,6 +4,7 @@ os.dsk: DEFINES = -DUSERPROG -DFILESYS KERNEL_SUBDIRS = threads devices lib lib/kernel userprog filesys TEST_SUBDIRS = tests/userprog tests/filesys/base tests/filesys/extended GRADING_FILE = $(SRCDIR)/tests/filesys/Grading.no-vm +SIMULATOR = --qemu # Uncomment the lines below to enable VM. #os.dsk: DEFINES += -DVM diff --git a/src/tests/Make.tests b/src/tests/Make.tests index 44e8d5e..9cb992b 100644 --- a/src/tests/Make.tests +++ b/src/tests/Make.tests @@ -12,7 +12,7 @@ PINTOSFLAGS += -v -T $(TIMEOUT) \ $(foreach file,$(PUTFILES),-p $(file) -a $(notdir $(file))) KERNELFLAGS += -q -PINTOS = pintos $(PINTOSOPTS) $(PINTOSFLAGS) -- $(KERNELFLAGS) +PINTOS = pintos $(SIMULATOR) $(PINTOSOPTS) $(PINTOSFLAGS) -- $(KERNELFLAGS) OUTPUTS = $(addsuffix .output,$(TESTS)) ERRORS = $(addsuffix .errors,$(TESTS)) diff --git a/src/threads/Make.vars b/src/threads/Make.vars index 1c90f59..dc45c2a 100644 --- a/src/threads/Make.vars +++ b/src/threads/Make.vars @@ -4,3 +4,4 @@ os.dsk: DEFINES = KERNEL_SUBDIRS = threads devices lib lib/kernel $(TEST_SUBDIRS) TEST_SUBDIRS = tests/threads GRADING_FILE = $(SRCDIR)/tests/threads/Grading +SIMULATOR = --bochs diff --git a/src/userprog/Make.vars b/src/userprog/Make.vars index 711b091..9db3cfa 100644 --- a/src/userprog/Make.vars +++ b/src/userprog/Make.vars @@ -4,3 +4,4 @@ os.dsk: DEFINES = -DUSERPROG -DFILESYS KERNEL_SUBDIRS = threads devices lib lib/kernel userprog filesys TEST_SUBDIRS = tests/userprog tests/userprog/no-vm tests/filesys/base GRADING_FILE = $(SRCDIR)/tests/userprog/Grading +SIMULATOR = --qemu diff --git a/src/utils/pintos b/src/utils/pintos index 19ef70f..31f4a38 100755 --- a/src/utils/pintos +++ b/src/utils/pintos @@ -8,7 +8,7 @@ use Getopt::Long qw(:config bundling); # Command-line options. our ($start_time) = time (); -our ($sim) = $ENV{PINTOSSIM}; # Simulator: bochs, qemu, or gsx. +our ($sim); # Simulator: bochs, qemu, or gsx. our ($debug) = "none"; # Debugger: none, monitor, or gdb. our ($mem) = 4; # Physical RAM in MB. our ($serial_out) = 1; # Send output to serial port? @@ -130,8 +130,6 @@ Disk options: (name an existing FILE or specify SIZE in MB for a temp disk) --swap-disk=FILE|SIZE Set swap disk file (default: swap.dsk) Other options: -h, --help Display this help message. -Environment variables: - PINTOSSIM Select default simulator. EOF exit $exitcode; } diff --git a/src/vm/Make.vars b/src/vm/Make.vars index a65d137..a5ea6b0 100644 --- a/src/vm/Make.vars +++ b/src/vm/Make.vars @@ -4,3 +4,4 @@ os.dsk: DEFINES = -DUSERPROG -DFILESYS -DVM KERNEL_SUBDIRS = threads devices lib lib/kernel userprog filesys vm TEST_SUBDIRS = tests/userprog tests/vm tests/filesys/base GRADING_FILE = $(SRCDIR)/tests/vm/Grading +SIMULATOR = --qemu diff --git a/tests/Makefile b/tests/Makefile index b119ffd..102e1e9 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -19,7 +19,7 @@ cd $@/src && $(MAKE) -s clean endef define run-tests -cd $@/src/$(PROJECT) && $(MAKE) check PINTOSOPTS=$(PINTOSOPTS) +cd $@/src/$(PROJECT) && $(MAKE) check endef define grade-tests @@ -58,7 +58,6 @@ examples userprog vm filesys:: $(clean) # Tests for the reference solutions. -p2 p3 p4: PINTOSOPTS = --qemu p1 p2 p3 p4:: $(mk-sandbox) $(apply-patch) -- 2.30.2