ERROR: unable to load segment 01000000[40A8000], memory already in use
Just did a quick test simplebooting Linux kernel 6.12.56 (make defconfig) on latest simpleboot.
- BIOS boot: no problem (work perfectly)
- EFI boot:
ERROR: unable to load segment 01000000[2A69000], memory already in use
Steps to reproduce on Ubuntu 25.04:
# create new boot dir
rm -rf boot && mkdir boot
# copy in the Linux 6.12.56 kernel
cp "${LINUX_SRC:?}/arch/x86/boot/bzImage" boot/kernel
# enable logs
cat > boot/simpleboot.cfg <<EOF
kernel kernel console=ttyS0,115200
verbose 3
EOF
# create disk image
simpleboot -vv -c boot disk.img
# run with default EFI firmware
qemu-system-x86_64 -m 256 -drive file=disk.img,format=raw -serial stdio -display none -bios /usr/share/ovmf/OVMF.fd
The complete output:
BdsDxe: loading Boot0001 "UEFI QEMU HARDDISK QM00001 " from PciRoot(0x0)/Pci(0x1,0x1)/Ata(Primary,Master,0x0)
BdsDxe: starting Boot0001 "UEFI QEMU HARDDISK QM00001 " from PciRoot(0x0)/Pci(0x1,0x1)/Ata(Primary,Master,0x0)
Simpleboot loader, Copyright (c) 2023 bzt, MIT license
Physical RAM 256 Megabytes
Loading Linux kernel 'kernel'...
segment 00005000[02A69000] -> 01000000[02A69000]
ERROR: unable to load segment 01000000[2A69000], memory already in use
BdsDxe: failed to start Boot0001 "UEFI QEMU HARDDISK QM00001 " from PciRoot(0x0)/Pci(0x1,0x1)/Ata(Primary,Master,0x0): Load Error
BdsDxe: loading Boot0002 "EFI Internal Shell" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4AF6516A1)/FvFile(7C04A583-9E3E-4F1C-AD65-E05268D0B4D1)
BdsDxe: starting Boot0002 "EFI Internal Shell" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4AF6516A1)/FvFile(7C04A583-9E3E-4F1C-AD65-E05268D0B4D1)
BdsDxe: failed to start Boot0002 "EFI Internal Shell" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4AF6516A1)/FvFile(7C04A583-9E3E-4F1C-AD65-E05268D0B4D1): Invalid Parameter
qemu-system-x86_64: terminating on signal 2