The most fun and beautiful code you know of?
kmavm: The UNIX v6 kernel (Lions book). Every page brims with the excellent, hard tradeoffs required to shoehorn what we'd recognize as a modern system onto a 128K 16-bit machine.