MosquitOS - A tiny, annoying operating system
Overview
Welcome! This blog details my ongoing journey to write a modern toy operating system for the x86_64 architecture. Throughout this process I noticed a lack of detailed information on how to interface with the hardware found in modern computers. There are obviously the multi-hundred page specification documents, but most of the tutorials I could find used older technologies (BIOS instead of EFI, 32-bit instead of 64-bit, etc.) The articles below will hopefully serve as a tutorial to those of you foolish enough to follow in my footsteps. In them, I try to detail my process, mistakes, and hopefully my successes.
I’ve tried to make the information as accurate as possible, but as this is a learning process for me as well, I guarantee there are tons of mistakes in my code and MosquitOS is a poor example of how to write an operating system. Please treat what follows not as “The One True and Correct Way to Write and Operating System,” but instead as one guy’s “OS That Hasn’t Broken Anything Expensive Yet.” If you run my code on your computer it could literally catch on fire. Always keep a bucket of water handy. Comments and corrections are appreciated!
Since many of the first articles were written much after the fact, they don’t follow the exact path I took through developing my OS. Instead, they follow what I think would have been a good order, and they take into account bug fixes/features I implemented long after the original functionality was somewhat complete. For a real history, feel free to checkout the git repository.
Prerequisites
The articles assume you have a good working understanding of the C language, and some basic experience with x64 assembly. Additionally, the development is all done on the Linux command line, so experience with this is useful.
Articles
- Introduction
- UEFI and Bootloaders
- Setting Up a Development Environment
- Build Systems
- Writing a UEFI Application
- Writing a Bootloader
- A Basic Kernel
- Kernel Debugging
- Dynamic Memory (And Life Without libc)
- Interrupts
- Pre-emptive Multithreading
- ACPICA
- PCI
- SATA