Testing
Due by 11:59 PM on Sunday, Nov 08
You should be at least a little bit familiar with testing by now. Your testing requirements however are a little different this time. You are expected to write tests for the read systemcall that you had to implement. You should also have some multi threaded tests to ensure that your kernel does not deadlock itself. To that end, you can copy and modify the program from part1. You should modify to use the mailbox system to keep track of it’s shared memory, instead of the static global variable that it is using. All your tests should be in the project3test
directory, just like they were for project2
Here is an example testing approach. You could always implement your own multi-threaded tests from scratch:
- Remove all the locks from the part1 program
- Modify the part1 program to use the mailbox system
- Run it multiple times with a few concurrent threads to see if lockdep gives you any errors, or if the kernel freezes
- At this point your sums should still not be correct.
- Add the locks back into the part1 program.
- Your sums should now be correct.
You should not be calling init and shutdown constantly.
If you want to call a systemcall from python (ie init/shutdown so the C executable doesn’t have to) you can use ctypes
and libc.syscall
. A quick google search should give you more info.