This is my code to learn a little bit assembly when I came across the interesting YouTube playlist "Making an OS (x86)" by Daedalus Community.
Its aim is to create a 512-byte-long boot sector in nasm
, an assembler for the x86 CPU architecture.
Besides nasm
, the machine emulator qemu
must also be installed.
I tested my code in Kali WSL, so it should work in other Linux distros too.
For Debian-based distro, you can use:
sudo apt install nasm qemu-system
The asm
and bin
files are located in the directories that correspond to the videos as follows:
Directory | Description | Reference video |
---|---|---|
boot2 | Print the alphabet in alternating caps aBcD... | Chapter 2 - BIOS, Printing the Alphabet, Conditional Jumps |
boot3 | Store and relay keyboard input | Chapter 3 - Strings, Keyboard Input in BIOS |
boot4 | Convert 16-bit hex to dec |
Chapter 4 - Stack, Functions, Segmentation |
boot5 | Read disk with failure detection | Chapter 5 - Reading the disk with BIOS |
boot6 | Global Descriptor Table and text UI in 32-bit protected mode | Chapter 6 - Entering Protected mode, GDT |
To boot, use the script boot.sh
with the directory number.
E.g., for boot2
:
./boot.sh 2
(As recommended by Daedalus Community)