Writing an OS is no trivial matter. Even the simplest of OS's need to provide system call support (such as write to console) which means having driver support for the individual devices (the video out, mouse, keyboard, etc.) and be able to be booted from the BIOS. The drivers alone would be quite a task if you were writing them from scratch.
"We are Microsoft, resistance is futile." - Bill Gates, 2015.