This is an old revision of the document!
In short: Your developement tools, and in what order they are used. A chain of tools, if you will.
This is highly dependent on your environment. For myself, I am starting the developement on a Windows 10 computer. So I need tools that runs nicely on this platform.
The good news is that Microsoft has created a Linux command line option, which opens up for a lot of Linux tools that is tailored for these tasks.
Basically, you need this:
- Text editor
- Assembler
- Compiler
- Build tools
- Computer emulator
I like the Geany editor. You can find version for both Windows and Linux. I use it under Windows in my current toolchain.
You can use any plain text editor but I recommend one that has at least context colouring, and possibly automatic function and symbol lists.
I use two assemblers. A specially built GNU assembler, and NASM.
The GNU assembler will be your best option when you start to mix assembler and C code.
The NASM assembler will be your best choice when you write your real mode code. This will be your boot code.
This is where it gets difficult. You will have to learn about user space and kernels and all very detailed stuff you don't want to know yet. Essentially, your compiler needs to understand that it does not have another operating system, like Linux or Windows, to rely upon. It will all be from scratch. You won't even have proper libraries to tell you how long a string is, and by far you won't have any code to initialise C++ constructors and the like.
You write the system. Nothing works until you make it so.
You have your assemblers and your C-compiler that generates code. Now you need to combine it into something a computer will accept.
My best friend in this is Linux' “make”. It will take a script (a list of things to do) and walk through it until it's done.
So when NASM has made your real mode boot binaries, I use Linux' “dd” to put the code at their proper place in a HD image that I shove onto a USB stick.
Basically I have 'make' create all my binaries, then 'make' copies binaries to a a raw image file, resulting in a single file with my code representing a bootable disk.
The Windows 10 bash Linux command line does not (at the time of writing this) support removable drives, so I am using a Windows tool to apply my disk image to a USB drive. At the moment: Win32 Disk Imager
My sequence to build my project is to execute “make” in bash, press “Write” and “Ok” in Win32 Disk Imager, and then launch the emulator. The process takes about 3 seconds, which is good since you do this every time you change the code. -which is often…
Most emulators will do. I am using VirtualBox because I've used it before. Also, VirualBox can boot from a real disk, which you probably will want.
Many kernel developers also use qemu.