There are a bunch of teaching OSes which are a great place to start for this stuff.
The actively developed ones we chose between when teaching the OS class at UW this fall were:
JOS (mit) https://github.com/guanqun/mit-jos
Pintos (stanford) http://www.stanford.edu/class/cs140/projects/
OS161 (harvard) http://www.eecs.harvard.edu/~syrah/os161/