you can take a look at minix 3 source code. it's a very simple os, created with the purpose of understand how operating system works.
you can also study all the tanenbaum book about os. they are all very complete and I remember that one book has the complete source of minix attached and commented