QEMU cant find a bootable disk when trying to boot my kernel
Posted: Fri Jan 09, 2026 9:52 am
Hello,
when Iam trying to boot my kernel with
qemu starts succesfully but it cant find a bootable disk. My kernel includes a multiboot2 header and is packaged as a .bin file called kernel.bin.
Here are some informations about my kernel:
multiboot2_header.S:
I already tried multiple different ways to fix this, like packaging it into a .iso together with grub but i couldnt get it to work because the error persisted. I sqw some different posts online, but none provided me with the required information to notch me in the correct way of fixing it. Does anyone know what iam doing wrong? Thank you for your answers 
when Iam trying to boot my kernel with
Code: Select all
run: $(KERNEL)
@echo "Booting kernel in QEMU..."
qemu-system-x86_64 \
-m 256 \
-drive format=raw,file=$(KERNEL) \
-serial stdio \
-display sdl
Here are some informations about my kernel:
Code: Select all
~/Dokumente/Projects/Nexus> make info
Kernel ELF Header:
readelf -h build/kernel.bin
ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: Advanced Micro Devices X86-64
Version: 0x1
Entry point address: 0x100040
Start of program headers: 64 (bytes into file)
Start of section headers: 4592 (bytes into file)
Flags: 0x0
Size of this header: 64 (bytes)
Size of program headers: 56 (bytes)
Number of program headers: 3
Size of section headers: 64 (bytes)
Number of section headers: 6
Section header string table index: 4
Kernel Sections:
readelf -S build/kernel.bin
There are 6 section headers, starting at offset 0x11f0:
Section Headers:
[Nr] Name Type Address Offset
Size EntSize Flags Link Info Align
[ 0] NULL 0000000000000000 00000000
0000000000000000 0000000000000000 0 0 0
[ 1] .multiboot_header PROGBITS 0000000000100000 00001000
0000000000000018 0000000000000000 A 0 0 8
[ 2] .text PROGBITS 0000000000100020 00001020
0000000000000062 0000000000000000 AX 0 0 16
[ 3] .symtab SYMTAB 0000000000000000 00001088
00000000000000f0 0000000000000018 5 5 8
[ 4] .shstrtab STRTAB 0000000000000000 00001178
0000000000000033 0000000000000000 0 0 1
[ 5] .strtab STRTAB 0000000000000000 000011ab
0000000000000044 0000000000000000 0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
L (link order), O (extra OS processing required), G (group), T (TLS),
C (compressed), x (unknown), o (OS specific), E (exclude),
D (mbind), l (large), p (processor specific)
Kernel Symbols:
readelf -s build/kernel.bin | grep -E "_start|kernel_main"
2: 0000000000100000 0 NOTYPE LOCAL DEFAULT 1 header_start
6: 0000000000100040 0 NOTYPE GLOBAL DEFAULT 2 _start
Code: Select all
.section .multiboot_header, "a"
.align 8
header_start:
.long 0xE85250D6
.long 4
.long header_end - header_start
.long 0x100000 - header_start
.short 0
.short 0
.long 8
header_end: