Time to... Subscribe! A bootloader is not standardized but most bootloaders are based on the principles from old MS-DOS fdisk.exe. The BIOS will initialize the hardware, read in the first 512 bytes of the disk, verify its signature and then jump to the top of that code segment.
The bootloader needs to interate through all the partition entries and find a partition that has the bootable flag set to true. Then it should take the hardware location from the partition table and use that to read in the first 512 bytes of the partition's data on disk and try to boot from that.
But our bootloader's code is located at address 0x7c00 in RAM memory, and the partition data needs to be stored at that same location. So before we even begin examining the partition table we need to relocate - ie. move our own program code to a different location in memory, and then restart the program from there.
This is a very interesting and low level project and you will learn a lot about the computer's bios, its memory, the partition table, how a hard disk is laid out - and a whole lot of Assembly.
It is not strictly necessary, but if you want to understand everything in this episode, then I recommend checking out my "Assembly school" series in the playlist section.
Let's get started!
JB
References
0. Code repo (check out the folder lux-bootloader/)
https://repo.doctorbirch.com
1. Become a channel member and get benefits and members-only videos. Check out:
/ @dr-jonas-birch
2. Master Boot Record -OSdev wiki
https://wiki.osdev.org/MBR_(x86)
3. MEMORY - LD manual
https://sourceware.org/binutils/docs/...
4. Struc directive in NASM - TheJat
https://thejat.in/learn/struc-directi...
5. BIOS Int 10h - Stanislav
https://stanislavs.org/helppc/int_10....
6. x86 REP MOVSB instruction - Felix C.
https://www.felixcloutier.com/x86/rep...
Table of Contents
00:00:00 Introduction
00:08:09 Setting up the project
00:48:04 Writing a bootloader
01:04:58 First 🍒
01:06:21 Relocating
01:18:29 Troubleshooting
01:30:46 Second 🍒
01:31:42 Partition table
02:02:16 Testing the final code
02:09:06 Success 🍒
Nesta página do site você pode assistir ao vídeo on-line Project: Coding a GRUB bootloader for booting Linux duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário dr Jonas Birch 02 Outubro 2025, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 5,552 vezes e gostou 363 espectadores. Boa visualização!