Minimal Linux Bootloader
a year ago
- #bootloader
- #linux
- #assembly
- Minimal Linux Bootloader is a free software under GNU General Public License.
- The bootloader loads the first 512 bytes of the kernel to 0x10000 using BIOS interrupt 0x13.
- It checks the kernel setup size at 0x1f1 and loads the setup after the first 512 bytes.
- The bootloader sets up kernel header fields including loader type, heap usage, and command line pointer.
- It moves the command line to memory and reads the protected-mode kernel size from the kernel setup.
- The bootloader uses BIOS interrupts to load kernel chunks to temporary memory and then copies them to extended memory above 1MB.
- Memory layout includes bootloader code at 0x07c00, real mode kernel at 0x10000, stack and heap at 0x18000, and command line at 0x1e000.
- The bootloader includes error handling and prints the kernel version string during boot.
- It uses a Global Descriptor Table (GDT) for memory operations and a Disk Address Packet (DAP) for disk reads.
- The bootloader ends with a jump to the kernel setup code at 0x10200.