Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* lab7: 7.1 The last two labs have evolved over time. Add the old ones for historic reference. Clear DF after setting it in memmove Fix grade script to enable the NIC and to stop after each test is done instead of timing out. Remove a few old tests that only test provided code. Bug fix from ezyang lab7
- Loading branch information
Showing
39 changed files
with
1,405 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
LAB=6 | ||
PACKAGEDATE=Fri Nov 13 02:30:19 EST 2009 | ||
LAB=7 | ||
PACKAGEDATE=Tue Nov 24 17:32:15 EST 2009 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Lorem ipsum dolor sit amet, consectetur | ||
adipisicing elit, sed do eiusmod tempor | ||
incididunt ut labore et dolore magna | ||
aliqua. Ut enim ad minim veniam, quis | ||
nostrud exercitation ullamco laboris | ||
nisi ut aliquip ex ea commodo consequat. | ||
Duis aute irure dolor in reprehenderit | ||
in voluptate velit esse cillum dolore eu | ||
fugiat nulla pariatur. Excepteur sint | ||
occaecat cupidatat non proident, sunt in | ||
culpa qui officia deserunt mollit anim | ||
id est laborum. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
echo This is from the script. | ||
cat lorem | num | cat | ||
echo These are my file descriptors. | ||
lsfd -1 | ||
echo This is the end of the script. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# echo hello world | cat | ||
hello world | ||
# cat lorem >out | ||
# cat out | ||
Lorem ipsum dolor sit amet, consectetur | ||
adipisicing elit, sed do eiusmod tempor | ||
incididunt ut labore et dolore magna | ||
aliqua. Ut enim ad minim veniam, quis | ||
nostrud exercitation ullamco laboris | ||
nisi ut aliquip ex ea commodo consequat. | ||
Duis aute irure dolor in reprehenderit | ||
in voluptate velit esse cillum dolore eu | ||
fugiat nulla pariatur. Excepteur sint | ||
occaecat cupidatat non proident, sunt in | ||
culpa qui officia deserunt mollit anim | ||
id est laborum. | ||
# cat lorem |num | ||
1 Lorem ipsum dolor sit amet, consectetur | ||
2 adipisicing elit, sed do eiusmod tempor | ||
3 incididunt ut labore et dolore magna | ||
4 aliqua. Ut enim ad minim veniam, quis | ||
5 nostrud exercitation ullamco laboris | ||
6 nisi ut aliquip ex ea commodo consequat. | ||
7 Duis aute irure dolor in reprehenderit | ||
8 in voluptate velit esse cillum dolore eu | ||
9 fugiat nulla pariatur. Excepteur sint | ||
10 occaecat cupidatat non proident, sunt in | ||
11 culpa qui officia deserunt mollit anim | ||
12 id est laborum. | ||
# cat lorem |num |num |num |num |num | ||
1 1 1 1 1 Lorem ipsum dolor sit amet, consectetur | ||
2 2 2 2 2 adipisicing elit, sed do eiusmod tempor | ||
3 3 3 3 3 incididunt ut labore et dolore magna | ||
4 4 4 4 4 aliqua. Ut enim ad minim veniam, quis | ||
5 5 5 5 5 nostrud exercitation ullamco laboris | ||
6 6 6 6 6 nisi ut aliquip ex ea commodo consequat. | ||
7 7 7 7 7 Duis aute irure dolor in reprehenderit | ||
8 8 8 8 8 in voluptate velit esse cillum dolore eu | ||
9 9 9 9 9 fugiat nulla pariatur. Excepteur sint | ||
10 10 10 10 10 occaecat cupidatat non proident, sunt in | ||
11 11 11 11 11 culpa qui officia deserunt mollit anim | ||
12 12 12 12 12 id est laborum. | ||
# lsfd -1 | ||
fd 0: name testshell.sh isdir 0 size 126 dev file | ||
fd 1: name testshell.out isdir 0 size 1951 dev file | ||
# cat script | ||
echo This is from the script. | ||
cat lorem | num | cat | ||
echo These are my file descriptors. | ||
lsfd -1 | ||
echo This is the end of the script. | ||
# sh <script | ||
This is from the script. | ||
1 Lorem ipsum dolor sit amet, consectetur | ||
2 adipisicing elit, sed do eiusmod tempor | ||
3 incididunt ut labore et dolore magna | ||
4 aliqua. Ut enim ad minim veniam, quis | ||
5 nostrud exercitation ullamco laboris | ||
6 nisi ut aliquip ex ea commodo consequat. | ||
7 Duis aute irure dolor in reprehenderit | ||
8 in voluptate velit esse cillum dolore eu | ||
9 fugiat nulla pariatur. Excepteur sint | ||
10 occaecat cupidatat non proident, sunt in | ||
11 culpa qui officia deserunt mollit anim | ||
12 id est laborum. | ||
These are my file descriptors. | ||
fd 0: name script isdir 0 size 132 dev file | ||
fd 1: name testshell.out isdir 0 size 2780 dev file | ||
This is the end of the script. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
echo hello world | cat | ||
cat lorem >out | ||
cat out | ||
cat lorem |num | ||
cat lorem |num |num |num |num |num | ||
lsfd -1 | ||
cat script | ||
sh <script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/sh | ||
|
||
qemuopts="-hda obj/kern/kernel.img -hdb obj/fs/fs.img -net user -net nic,model=i82559er" | ||
. ./grade-functions.sh | ||
brkfn=cons_getc | ||
|
||
|
||
$make | ||
run | ||
|
||
score=0 | ||
|
||
# 10 points - run-testpteshare | ||
pts=10 | ||
runtest1 -tag 'PTE_SHARE [testpteshare]' testpteshare \ | ||
'fork handles PTE_SHARE right' \ | ||
'spawn handles PTE_SHARE right' \ | ||
|
||
# 10 points - run-testfdsharing | ||
pts=10 | ||
runtest1 -tag 'fd sharing [testfdsharing]' testfdsharing \ | ||
'read in parent succeeded' \ | ||
'read in child succeeded' \ | ||
'write to file data page succeeded' | ||
|
||
# 20 points - run-icode | ||
pts=20 | ||
runtest1 -tag 'updated file system switch [icode]' icode \ | ||
'icode: read /motd' \ | ||
'This is /motd, the message of the day.' \ | ||
'icode: spawn /init' \ | ||
'init: running' \ | ||
'init: data seems okay' \ | ||
'icode: exiting' \ | ||
'init: bss seems okay' \ | ||
"init: args: 'init' 'initarg1' 'initarg2'" \ | ||
'init: running sh' \ | ||
|
||
# 20 points - run-testshell | ||
pts=20 | ||
timeout=60 | ||
runtest1 -tag 'shell [testshell]' testshell \ | ||
'shell ran correctly' \ | ||
|
||
# 10 points - run-primespipe | ||
pts=10 | ||
timeout=120 | ||
echo 'The primespipe test has up to 2 minutes to complete. Be patient.' | ||
runtest1 -tag 'primespipe' primespipe \ | ||
! 1 2 3 ! 4 5 ! 6 7 ! 8 ! 9 \ | ||
! 10 11 ! 12 13 ! 14 ! 15 ! 16 17 ! 18 19 \ | ||
! 20 ! 21 ! 22 23 ! 24 ! 25 ! 26 ! 27 ! 28 29 \ | ||
! 30 31 ! 32 ! 33 ! 34 ! 35 ! 36 37 ! 38 ! 39 \ | ||
541 1009 1097 | ||
|
||
echo "Score: $score/70" | ||
|
||
if [ $score -lt 70 ]; then | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.