Cambridge University hosts a course called baking Pi. Yes, it is not a spelling mistake, it is about our beloved Raspberry Pi.
The course teaches about operating system fundamentals by implementing a basic OS on the bare metal of the pi. For all of us not attending university at Cambridge the teaching material is available on-line. If you are feeling like writing some low level code is assembly, head on over to the course.