Opened 6 months ago

Last modified 6 months ago

#15119 new enhancement

Implement multiboot2 bootloader support to haiku_loader

Reported by: kallisti5 Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: System/Boot Loader Version: R1/Development
Keywords: multiboot2 Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

qemu (as well as grub and a hand-full of other bootloaders) support the new(ish) multiboot2 specification.

Implementing a multiboot2 loader would allow us to boot our haiku_loader directly in things like qemu and pass the fdt, initial ram disk, etc and not depend on things like u-boot on these platforms. This would accelerate non-x86 platform development by allowing us to reduce the complexity of booting haiku_loader (bypass efi, u-boot, bios_ia32, etc) and load our kernel (well, haiku_loader) directly.

Some example code is here:

The specification is here:

Change History (1)

comment:1 by kallisti5, 6 months ago

(I started poking at things, but don't need another rabbit hole to follow.)

Here are some example things:

src/system/boot/platform/multiboot2/
src/system/boot/platform/multiboot2/arch
src/system/boot/platform/multiboot2/arch/x86
src/system/boot/platform/multiboot2/arch/x86/start.S
src/system/ldscripts/arm/boot_loader_multiboot2.ld
$ cat src/system/ldscripts/arm/boot_loader_multiboot2.ld
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)

ENTRY(start)

STACK_SIZE = 16384;


SECTIONS {
	. = BOOT_LOADER_BASE;

	.boot :
	{
		/* ensure that the multiboot header is at the beginning */
		*(.multiboot_header)
	}

	.text :
	{
		*(.text)
	}
}
Note: See TracTickets for help on using tickets.