Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 121 lines (97 sloc) 3.168 kB
9bf29a3 @aclements lab3
aclements authored
1 #!/bin/sh
2
3 qemuopts="-hda obj/kern/kernel.img"
4 . ./grade-functions.sh
5
6
7 $make
8
9 # the [00001000] tags should have [] in them, but that's
10 # a regular expression reserved character, and i'll be damned if
11 # I can figure out how many \ i need to add to get through
12 # however many times the shell interprets this string. sigh.
13
14 pts=10
15
16 runtest1 divzero \
17 ! '1/0 is ........!' \
18 'Incoming TRAP frame at 0xefbfff..' \
19 'TRAP frame at 0xf.......' \
20 ' trap 0x00000000 Divide error' \
21 ' eip 0x008.....' \
22 ' ss 0x----0023' \
23 '.00001000. free env 00001000'
24
25 runtest1 softint \
26 'Welcome to the JOS kernel monitor!' \
27 'Incoming TRAP frame at 0xefbfffbc' \
28 'TRAP frame at 0xf.......' \
29 ' trap 0x0000000d General Protection' \
30 ' eip 0x008.....' \
31 ' ss 0x----0023' \
32 '.00001000. free env 00001000'
33
34 runtest1 badsegment \
35 'Incoming TRAP frame at 0xefbfffbc' \
36 'TRAP frame at 0xf.......' \
37 ' trap 0x0000000d General Protection' \
38 ' err 0x00000028' \
39 ' eip 0x008.....' \
40 ' ss 0x----0023' \
41 '.00001000. free env 00001000'
42
43 showpart A
44
45 pts=5
46
47 runtest1 faultread \
48 ! 'I read ........ from location 0!' \
49 '.00001000. user fault va 00000000 ip 008.....' \
50 'Incoming TRAP frame at 0xefbfffbc' \
51 'TRAP frame at 0xf.......' \
52 ' trap 0x0000000e Page Fault' \
53 ' err 0x00000004.*' \
54 '.00001000. free env 00001000'
55
56 runtest1 faultreadkernel \
57 ! 'I read ........ from location 0xf0100000!' \
58 '.00001000. user fault va f0100000 ip 008.....' \
59 'Incoming TRAP frame at 0xefbfffbc' \
60 'TRAP frame at 0xf.......' \
61 ' trap 0x0000000e Page Fault' \
62 ' err 0x00000005.*' \
63 '.00001000. free env 00001000' \
64
65 runtest1 faultwrite \
66 '.00001000. user fault va 00000000 ip 008.....' \
67 'Incoming TRAP frame at 0xefbfffbc' \
68 'TRAP frame at 0xf.......' \
69 ' trap 0x0000000e Page Fault' \
70 ' err 0x00000006.*' \
71 '.00001000. free env 00001000'
72
73 runtest1 faultwritekernel \
74 '.00001000. user fault va f0100000 ip 008.....' \
75 'Incoming TRAP frame at 0xefbfffbc' \
76 'TRAP frame at 0xf.......' \
77 ' trap 0x0000000e Page Fault' \
78 ' err 0x00000007.*' \
79 '.00001000. free env 00001000'
80
81
82 runtest1 breakpoint \
83 'Welcome to the JOS kernel monitor!' \
84 'Incoming TRAP frame at 0xefbfffbc' \
85 'TRAP frame at 0xf.......' \
86 ' trap 0x00000003 Breakpoint' \
87 ' eip 0x008.....' \
88 ' ss 0x----0023' \
89 ! '.00001000. free env 00001000'
90
91 runtest1 testbss \
92 'Making sure bss works right...' \
93 'Yes, good. Now doing a wild write off the end...' \
94 '.00001000. user fault va 00c..... ip 008.....' \
95 '.00001000. free env 00001000'
96
97 runtest1 hello \
98 '.00000000. new env 00001000' \
99 'hello, world' \
100 'i am environment 00001000' \
101 '.00001000. exiting gracefully' \
102 '.00001000. free env 00001000' \
103 'Destroyed the only environment - nothing more to do!'
104
105 runtest1 buggyhello \
106 '.00001000. user_mem_check assertion failure for va 00000001' \
107 '.00001000. free env 00001000'
108
109 runtest1 buggyhello2 \
110 '.00001000. user_mem_check assertion failure for va 0....000' \
111 '.00001000. free env 00001000' \
112 ! 'hello, world'
113
114 runtest1 evilhello \
115 '.00001000. user_mem_check assertion failure for va f0100...' \
116 '.00001000. free env 00001000'
117
118 showpart B
119
120 showfinal
Something went wrong with that request. Please try again.