Here [1] you can find another example of writing OS from scratch. Going through chapters progress is made iteratively by making limited changes in each step. This OS is intended to be (RT)OS for embedded computers, but example arch-level is implemented for x86.
[1] https://github.com/l30nard0/Benu