I used san RTOS written in assembly for the Atmel AVR. AvrX (by John Barello)
You can look at the code here.
https://github.com/kororos/AvrX
Compiles down under 2k.
The thing is while actually doing that isn't crazy hard, they did that with hardly any existing examples to go by. And without modern tools.