<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nebez</title>
    <description>The latest articles on DEV Community by Nebez (@nebez).</description>
    <link>https://dev.to/nebez</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4057036%2F126e3a69-b839-43d3-9370-d7772ce05277.jpg</url>
      <title>DEV Community: Nebez</title>
      <link>https://dev.to/nebez</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nebez"/>
    <language>en</language>
    <item>
      <title>Building a Bootloader from Scratch</title>
      <dc:creator>Nebez</dc:creator>
      <pubDate>Sat, 01 Aug 2026 20:56:01 +0000</pubDate>
      <link>https://dev.to/nebez/building-a-bootloader-from-scratch-53ea</link>
      <guid>https://dev.to/nebez/building-a-bootloader-from-scratch-53ea</guid>
      <description>&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;Starting My Learning Journey&lt;/li&gt;
&lt;li&gt;My First Introduction to Intel 8086&lt;/li&gt;
&lt;li&gt;A Simple Look at 8086 Architecture&lt;/li&gt;
&lt;li&gt;Setting Up the Development Environment&lt;/li&gt;
&lt;li&gt;Understanding the Boot Process&lt;/li&gt;
&lt;li&gt;Writing My First Bootloader&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  My First Experience in the World of Low-Level Programming: Building My First Bootloader
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Part 1
&lt;/h2&gt;

&lt;p&gt;For a long time, one question had been stuck in my mind:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What actually happens inside a processor, and how do the code we write get executed at the lowest level?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I already knew that the code we write in high-level programming languages like Java, Python, Kotlin, and others eventually needs to be translated into a language that the processor can understand.&lt;/p&gt;

&lt;p&gt;For example, in Java, the code we write is first compiled into &lt;strong&gt;Bytecode&lt;/strong&gt; by the Compiler. Then, it is executed by the &lt;strong&gt;Java Virtual Machine (JVM)&lt;/strong&gt; and eventually translated into instructions that the processor can execute.&lt;/p&gt;

&lt;p&gt;This means that behind even the simplest programs we run, the processor is performing billions of operations on zeros and ones in a fraction of a second.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;That is truly amazing!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This curiosity pushed me to challenge myself and enter a completely new world, a world much closer to the hardware than languages like Java and Python.&lt;/p&gt;




&lt;h1&gt;
  
  
  Starting My Learning Journey
&lt;/h1&gt;

&lt;p&gt;The first thing I did was search through different resources. Like always, my first destination was YouTube.&lt;/p&gt;

&lt;p&gt;I found a video titled:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How to build an Operating System from scratch&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;and opened it with a lot of excitement.&lt;/p&gt;

&lt;p&gt;A few minutes later, I realized that I barely understood anything, so I respectfully closed the video with a little bit of fear and confusion 😄&lt;/p&gt;

&lt;p&gt;I understood that building an operating system from scratch was still far beyond my current level, and I needed to start with more fundamental concepts.&lt;/p&gt;

&lt;p&gt;I started reading articles, watching educational videos, and exploring different resources until I realized that many computer architecture and operating system tutorials start with simpler and older architectures, such as &lt;strong&gt;x86 8086&lt;/strong&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  My First Introduction to Intel 8086
&lt;/h1&gt;

&lt;p&gt;The good news was that I did not need to manually write millions of zeros and ones inside a text file just to create a simple program.&lt;/p&gt;

&lt;p&gt;The not-so-good news was that I had to learn Assembly 😄&lt;/p&gt;

&lt;p&gt;I started by collecting information about the &lt;strong&gt;Intel 8086 processor&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The Intel 8086 was a 16-bit processor introduced by Intel in 1978 and became one of the most important processors in the x86 family.&lt;/p&gt;

&lt;p&gt;To learn this architecture, educational tools like &lt;strong&gt;emu8086&lt;/strong&gt; allow us to write Assembly code, execute it, and observe the processor's Registers and Flags step by step.&lt;/p&gt;

&lt;p&gt;This was truly fascinating for me.&lt;/p&gt;

&lt;p&gt;Imagine being able to see exactly what instructions the processor executes, how Register values change, and what the CPU state looks like at every moment!&lt;/p&gt;

&lt;p&gt;But there was one problem...&lt;/p&gt;

&lt;p&gt;I had no idea what a Register was, what a Flag was, what Memory Addressing meant, or what the CPU was actually doing.&lt;/p&gt;

&lt;p&gt;So I spent several days trying to understand the basics of x86 architecture first.&lt;/p&gt;

&lt;p&gt;Of course, I have to admit that for someone who has just moved from:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;hello world&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;into the world of processors, looking at the internal structure of a CPU can be a little scary 😄&lt;/p&gt;

&lt;h1&gt;
  
  
  A Simple Look at the Structure of 8086
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1qp7spld7keybaq0xwqo.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1qp7spld7keybaq0xwqo.jpg" alt=" " width="470" height="653"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Image credit:&lt;/strong&gt; ElectronicsMind - Intel 8086 Microprocessor Architecture&lt;/p&gt;

&lt;p&gt;The 8086 processor consists of different parts, but for a beginner, we can focus on the most important ones.&lt;/p&gt;
&lt;h2&gt;
  
  
  Execution Unit (EU)
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;Execution Unit&lt;/strong&gt; is responsible for interpreting and executing instructions.&lt;/p&gt;

&lt;p&gt;This unit includes components such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ALU (Arithmetic Logic Unit)&lt;/strong&gt; for performing arithmetic and logical operations&lt;/li&gt;
&lt;li&gt;General-purpose Registers&lt;/li&gt;
&lt;li&gt;Flag Registers&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Bus Interface Unit (BIU)
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;Bus Interface Unit&lt;/strong&gt; is responsible for communication between the CPU and memory, as well as fetching instructions from RAM.&lt;/p&gt;

&lt;p&gt;This unit includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Segment Registers&lt;/li&gt;
&lt;li&gt;Instruction Pointer (IP)&lt;/li&gt;
&lt;li&gt;Memory address generation logic&lt;/li&gt;
&lt;/ul&gt;


&lt;h1&gt;
  
  
  Registers
&lt;/h1&gt;

&lt;p&gt;Registers are extremely small and extremely fast storage locations inside the CPU.&lt;/p&gt;

&lt;p&gt;The processor cannot always work directly with RAM for operations such as calculations, data transfers, and instruction execution because RAM is slower compared to the CPU.&lt;/p&gt;

&lt;p&gt;Because of this, the CPU uses Registers as a very fast workspace to keep the data it needs closer to the processing unit.&lt;/p&gt;

&lt;p&gt;In &lt;strong&gt;Low-Level Programming&lt;/strong&gt;, Registers are one of the most important tools for directly interacting with the CPU.&lt;/p&gt;

&lt;p&gt;Some Registers are used for storing data, some for memory addressing, some for managing the Stack, and some for controlling the execution flow of a program.&lt;/p&gt;

&lt;p&gt;In fact, we are going to use these tiny storage locations inside the CPU to control program execution step by step.&lt;/p&gt;


&lt;h1&gt;
  
  
  My First Assembly Code Execution
&lt;/h1&gt;

&lt;p&gt;After getting a basic understanding of the processor architecture, I told myself:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I will not truly understand these concepts until I start writing code."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So I decided to write my first Assembly program.&lt;/p&gt;

&lt;p&gt;At first, I tried &lt;strong&gt;emu8086&lt;/strong&gt;, but I could not really connect with its environment.&lt;/p&gt;

&lt;p&gt;Instead, I decided to use my favorite editor, &lt;strong&gt;Vim&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;To prepare my development environment, I installed the required tools:&lt;/p&gt;
&lt;h2&gt;
  
  
  Ubuntu / Debian
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update

&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;nasm qemu-system-x86 gdb binutils
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Fedora
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf &lt;span class="nb"&gt;install &lt;/span&gt;nasm qemu-system-x86 gdb binutils
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;To verify the installation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nasm &lt;span class="nt"&gt;-version&lt;/span&gt;

qemu-system-i386 &lt;span class="nt"&gt;--version&lt;/span&gt;

gdb &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The main tools I used were:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;NASM&lt;/strong&gt; for converting Assembly code into Binary files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;QEMU&lt;/strong&gt; for running the Bootloader in an emulated environment&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GDB&lt;/strong&gt; for debugging the CPU and inspecting Registers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Binutils&lt;/strong&gt; for analyzing Binary files&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  From Turning On the Computer to Executing My First Bootloader
&lt;/h1&gt;

&lt;p&gt;After getting familiar with the CPU and the 8086 architecture, it was time to understand what exactly happens when a computer starts.&lt;/p&gt;

&lt;p&gt;How can a computer that has not executed any program yet, run its first piece of code?&lt;/p&gt;

&lt;p&gt;This is where I learned about the concept of the &lt;strong&gt;Boot Process&lt;/strong&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  What is a Bootloader?
&lt;/h1&gt;

&lt;p&gt;Simply put, a &lt;strong&gt;Bootloader&lt;/strong&gt; is a small program that is executed during the early stages of system startup and prepares the system for the next steps.&lt;/p&gt;

&lt;p&gt;In real operating systems, the Bootloader is usually responsible for finding the Kernel from storage and loading it into RAM.&lt;/p&gt;

&lt;p&gt;However, to start learning, I decided to write a very simple Bootloader that does only one thing:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Display a character on the screen.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It may sound simple, but this small action means that I am executing my first piece of code that runs directly on the CPU before any operating system exists.&lt;/p&gt;




&lt;h1&gt;
  
  
  What Happens When a Computer Starts?
&lt;/h1&gt;

&lt;p&gt;The boot process of a BIOS-based system can be summarized like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Power On
   |
   ↓
CPU Reset
   |
   ↓
BIOS starts executing
   |
   ↓
POST (Power-On Self Test)
   |
   ↓
Find Boot Device
   |
   ↓
Load Bootloader into RAM
   |
   ↓
Jump to Bootloader Code
   |
   ↓
Bootloader executes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let's look at these steps in more detail.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Turning on the system
&lt;/h2&gt;

&lt;p&gt;When we press the Power button, the CPU exits the Reset state and starts executing its first instructions.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Executing BIOS
&lt;/h2&gt;

&lt;p&gt;In older systems based on BIOS, the initial control is transferred to the system Firmware.&lt;/p&gt;

&lt;p&gt;BIOS stands for:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Basic Input/Output System&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;and its job is to check and initialize the main hardware components of the system.&lt;/p&gt;

&lt;p&gt;During this stage, a test called:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;POST (Power-On Self Test)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;is performed to check components such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;RAM&lt;/li&gt;
&lt;li&gt;Keyboard&lt;/li&gt;
&lt;li&gt;Display&lt;/li&gt;
&lt;li&gt;Storage Devices&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3. Finding the Boot Device
&lt;/h2&gt;

&lt;p&gt;After POST is completed successfully, BIOS searches for a bootable device according to the configured Boot Order.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hard Drive&lt;/li&gt;
&lt;li&gt;USB&lt;/li&gt;
&lt;li&gt;CD/DVD&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  4. Finding the Bootloader
&lt;/h2&gt;

&lt;p&gt;In traditional BIOS-based systems, BIOS checks the first sector of the bootable device.&lt;/p&gt;

&lt;p&gt;This sector must contain a special signature in its last two bytes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0x55AA
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is called:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Boot Signature&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If this signature exists, BIOS recognizes this sector as a valid boot sector.&lt;/p&gt;

&lt;p&gt;Then, it loads these 512 bytes into a specific memory address:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0x7C00
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and transfers control of execution to the CPU.&lt;/p&gt;

&lt;p&gt;From this moment, the code we wrote starts running.&lt;/p&gt;

&lt;h1&gt;
  
  
  My First Bootloader
&lt;/h1&gt;

&lt;p&gt;After understanding the concept of the Boot Process, it was time to write my first piece of code.&lt;/p&gt;

&lt;p&gt;The goal was very simple:&lt;/p&gt;

&lt;p&gt;Just display the character:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;N
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;on the screen.&lt;/p&gt;

&lt;p&gt;The code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[bits 16]

org 0x7c00

mov ah, 0x0e
mov al, 'N'

int 0x10

times 510 - ($ - $$) db 0

dw 0xAA55
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Understanding the Code
&lt;/h1&gt;

&lt;p&gt;This simple Bootloader runs in:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;16-bit Real Mode&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Defining the CPU Mode
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[bits 16]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tells the Assembler that our code is written for a 16-bit processor mode.&lt;/p&gt;




&lt;h2&gt;
  
  
  Bootloader Location
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;org 0x7c00
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tells the Assembler that this code will be loaded and executed at memory address &lt;code&gt;0x7C00&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This is the address where BIOS usually places the Boot Sector.&lt;/p&gt;




&lt;h2&gt;
  
  
  Loading Values into Registers
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mov ah, 0x0e
mov al, 'N'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this section, we place the required values into CPU Registers.&lt;/p&gt;

&lt;p&gt;For a simpler understanding, we can compare this idea to assigning values to variables in high-level programming languages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mh"&gt;0x0e&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, the important difference is that in Assembly, we do not work with variables created by a Compiler.&lt;/p&gt;

&lt;p&gt;Instead, we directly control real Registers inside the CPU.&lt;/p&gt;

&lt;p&gt;Here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The value &lt;code&gt;0x0E&lt;/code&gt; is placed inside the &lt;code&gt;AH&lt;/code&gt; Register.&lt;/li&gt;
&lt;li&gt;The character &lt;code&gt;N&lt;/code&gt; is placed inside the &lt;code&gt;AL&lt;/code&gt; Register.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The value &lt;code&gt;0x0E&lt;/code&gt; is a &lt;strong&gt;Service Number&lt;/strong&gt; for BIOS that tells it we want to display a character using &lt;strong&gt;Teletype Mode&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Calling BIOS Interrupt
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int 0x10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This instruction calls a:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;BIOS Video Interrupt&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The control is transferred to BIOS video services, which perform the character display operation.&lt;/p&gt;




&lt;h2&gt;
  
  
  Completing the Boot Sector
&lt;/h2&gt;

&lt;p&gt;A Boot Sector must be exactly 512 bytes in size.&lt;/p&gt;

&lt;p&gt;For this reason:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;times 510 - ($ - $$) db 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;fills the remaining space of the file with zeros.&lt;/p&gt;

&lt;p&gt;At the end:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dw 0xAA55
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;adds the Boot Signature so that BIOS can recognize this sector as a valid Bootloader.&lt;/p&gt;




&lt;h1&gt;
  
  
  Building and Running the Bootloader
&lt;/h1&gt;

&lt;p&gt;After writing the code, I saved the file as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;boot.asm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, using NASM, I converted it into a Binary file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nasm &lt;span class="nt"&gt;-f&lt;/span&gt; bin boot.asm &lt;span class="nt"&gt;-o&lt;/span&gt; boot.bin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command creates a raw Binary file that can be executed as a Boot Sector.&lt;/p&gt;

&lt;p&gt;To run it, I used QEMU:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;qemu-system-i386 &lt;span class="nt"&gt;-fda&lt;/span&gt; boot.bin
or
qemu-system-x86_64 &lt;span class="nt"&gt;-fda&lt;/span&gt; boot.bin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the result?&lt;/p&gt;

&lt;p&gt;A simple character appeared on the screen:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fehv8zdji8snkzmtcw7u8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fehv8zdji8snkzmtcw7u8.png" alt=" " width="606" height="270"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;N
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;But for me, it was much more than just a character.&lt;/p&gt;

&lt;p&gt;This was the first time I had written code that ran directly on the CPU without an operating system, without any Runtime, and without any Framework.&lt;/p&gt;

&lt;p&gt;At that moment, I finally understood why the world of &lt;strong&gt;Low-Level Programming&lt;/strong&gt; is so fascinating.&lt;/p&gt;

&lt;p&gt;At the lowest level, there are no ready-made layers hiding the details.&lt;/p&gt;

&lt;p&gt;There is only:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You, the CPU, memory, and a few Assembly instructions.&lt;/strong&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  Continuing the Journey
&lt;/h1&gt;

&lt;p&gt;This experience was only a small beginning.&lt;/p&gt;

&lt;p&gt;By writing this simple Bootloader, my interest in Low-Level Programming became much stronger, and I decided to continue this learning journey.&lt;/p&gt;

&lt;p&gt;My next goals are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Learning Assembly more deeply&lt;/li&gt;
&lt;li&gt;Building more advanced Bootloaders&lt;/li&gt;
&lt;li&gt;Eventually writing a simple Kernel&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This was only the first step...&lt;/p&gt;




&lt;h1&gt;
  
  
  My First Bootloader on GitHub
&lt;/h1&gt;

&lt;p&gt;You can find the source code of my first Bootloader here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/Nebez-Berzency/simple-bootloader" rel="noopener noreferrer"&gt;https://github.com/Nebez-Berzency/simple-bootloader&lt;/a&gt;&lt;/p&gt;

</description>
      <category>bootloader</category>
      <category>learning</category>
      <category>assembly</category>
      <category>x8086</category>
    </item>
  </channel>
</rss>
