Lecture 12 Thoughts
Code examples
We’ve added all the OS01 code to the cs61/cs61-lectures.git
repository. It is
located in the os01
directory.
See the os01/README.md
file for more
information.
The file layout has changed from lecture, where code was in l12/os01
.
You will want to look at os01/kernel.c
, os01/p-hello.c
, and
os01/p-welcome.c
in the current file layout.
We ran through several versions of the OS01 example code in class, and have created branches in cs61-lectures.git so you can compare these versions. The branches are:
v01
The initial code.
v02
The p-hello
process runs an infinite loop. This hangs the OS forever.
v03
The OS kernel adds a timer interrupt, which fixes the hang.
v04
The p-hello
process evilly turns off the timer interrupt. The OS again
hangs forever.
v05
The OS kernel disables interrupt manipulation in user processes. The attempt to turn off the interrupt becomes a fault.
v06
The OS catches the fault.
You can examine these branches in several ways.
- To check the differences between two branches, run something like
“
git diff v01 v02
”. - To run code from branch
v03
, run “git checkout -f v03; make run
”. - Don’t forget to run “
git checkout master
” at the end.
We also added accessibility support to OS01. Try “make run-console
”.