Writing an operating system from scratch