* same with xv6
[mascara-docs.git] / i386 / ucla / src / lab5 / grade-lab2.sh
blobb5b5a9211fcb75d9affd7b3440b9c6cf9d28dc1c
1 #!/bin/sh
3 qemuopts="-hda obj/kernel.img"
4 . ./grade-functions.sh
5 brkfn=
6 keystrokes="backtrace;exit;"
9 $make $make_args
11 check () {
12 pts=20
13 echo_n "Physical page allocator: "
14 if grep "check_page_alloc() succeeded!" jos.out >/dev/null
15 then
16 pass
17 else
18 fail
21 pts=30
22 echo_n "Page management: "
23 if grep "check_page() succeeded!" jos.out >/dev/null
24 then
25 pass
26 else
27 fail
30 pts=20
31 echo_n "Kernel page directory: "
32 if grep "check_kern_pgdir() succeeded!" jos.out >/dev/null
33 then
34 pass
35 else
36 fail
39 pts=10
40 echo_n "Kernel breakpoint interrupt: "
41 if grep "^Trap frame at 0x" jos.out >/dev/null \
42 && grep " trap 0x00000003 Breakpoint" jos.out >/dev/null
43 then
44 pass
45 else
46 fail
49 echo_n "Kernel breakpoint backtrace: "
50 syms=`$cxxfilt < jos.out | grep "kern/init.c:[0-9]*: *test_kernel_breakpoint[(+]"`
51 badsyms=`$cxxfilt < jos.out | grep "kern/trap.c:[0-9]*: *trap[(+]"`
52 if [ -n "$syms" -a -z "$badsyms" ]; then
53 pass
54 elif [ -z "$syms" ]; then
55 fail "found no symbols"
56 else
57 fail "found wrong symbols ($badsyms)"
60 echo_n "Returning from breakpoint interrupt: "
61 if grep "Breakpoint succeeded" jos.out >/dev/null
62 then
63 pass
64 else
65 fail
69 run
70 check
72 showfinal