The MIT course for Operating Systems has a teaching OS called xv6. There's some nifty implementations in there. I'm not sure I'd comment on the codebase itself, but I think more importantly it teaches you good abstractions which Unix is all about: https://pdos.csail.mit.edu/6.1810/2024/xv6.html