Here begin the code thing : writing large amounts of code, in order to have actual software based on the preceding work to toy with. Before we start, let’s explain which tools we’ll use, and which material we’ll start with.
The main programming language in use will be C++. It is chosen because
- It is fast and does not include unnecessary and unpredictable bloat in the code like garbage collection mechanisms
- It works on all common hardware and has got a myriad of tools to work with
- There’s a lot of freely available C++ code to check on the internet. Moreover, it is compatible with C, and C is the language used for most system programming today
- It is object-oriented, and hence allows for easy code re-usability and improvement. It also favors a clean design
- One can easily put assembly code in it for hardware-dependent features.
Main programming tools will be gcc/gas/g++, GNU ld, and maybe GNU make, in the beginning at least. I have no special interest in them, but most code on the internet uses them for UNIX legacy and power reasons, so it’s a wiser choice in terms of usability and developer compatibility ;) Moreover, I work on linux, where only g++ is easily available and not linked to a specific architecture.
For testing purposes, we’ll begin with Bochs x86_64 emulation, as it offers an internal debugger of lifesaving quality and prefers high-quality emulation over performance tweaks. Then, as the system gets more mature, testing in QEMU (less debug features but more powerful virtual hardware and performance closer to the actual hardware), then usual virtual machines like VirtualBox/VMware, may be envisioned, in order to look for potential hardware issues not emulated by Bochs and port the code base to more hardware. Once we’ve reached a goal of zero warnings from the virtual machine and are able to run a complete test suite without a single glitch, we may start to make it run on actual hardware and begin work on higher-level parts of the OS.