[syslinux] Multiboot BIOS / EFI32 / EFI64

Johann Obermayr johann.obermayr at sigmatek.at
Fri Jul 1 01:36:00 PDT 2022


Hi,

We only use one kernel for all three boot types.

In the common.cfg we load a own C32 file. ( compiled for every boot type. Found correct version with "PATH=" )
And this library create  a own start command line for kernel.

##### filepart of common.cfg ###############
	DEFAULT HardwareBootLoader
	# Labels
	LABEL HardwareBootLoader
		COM32 hardware_boot.c32

It can read from a hardware-boot.cfg and add some data as kernel parameter.
It use the DMI info to read from hardware-boot.cfg.

Example for hardware-boot-cfg:
	#####################################
	# debug parameter
	#####################################
	# dmi.debug=0
	#     enable dmi parse logging
	#     0x0001    DMIDUMP_COMMON        show common info about dmi entry
	#     0x0002    DMIDUMP_HEADER_HEX    show dmi entry in hex code
	#     0x0004    DMIDUMP_HEADER_ASCII  show dmi entry in ascii code
	#     0x0008    DMIDUMP_STRINGS       show string tables from entrys
	# dmi.show=0
	#     Show DMI Info in beautyfull format

	# Board Fujitsu D3544-Sx
	# use COM 2 as debug serial port
	console.set. D3544-Sx=2
	param.<dmi-product-name>=acpi=off
	param.<dmi-serial-number>=checklicense=1

console.set add  "console=ttyS2,115200" to the kernel start parameter

best regards
  Johann


> -----Ursprüngliche Nachricht-----
> Von: Syslinux <syslinux-bounces at syslinux.org> Im Auftrag von Erik Rull via
> Syslinux
> Gesendet: Freitag, 1. Juli 2022 07:38
> An: syslinux at syslinux.org
> Betreff: Re: [syslinux] Multiboot BIOS / EFI32 / EFI64
> 
> Hello Johann,
> 
> that's a nice approach.
> 
> I'm missing a bit, maybe you can help me clearing this up:
> With the "common" syslinux.cfg - how do you distinguish for the correct
> kernel?
> If you have an old, legacy embedded system with no proper 64 bit support,
> how do you select the correct kernel? Or do you only have 64 bit Kernels for
> your targets and simply ignore the non 64-bit systems?
> 
> Best regards,
> 
> Erik
> 
> 
> Johann Obermayr via Syslinux wrote:
> > Hello,
> >
> > It work.
> > With one Disk , I can boot on PC with old BIOS Boot & new PC with EFI Boot.
> > First Partition is a EFI Boot Partition.
> > The problem is, that windows can’t set this partition as active.
> > Use other Tools. Or Linux 😊
> >
> > We generate Flash Disk Images. This image can be used on different
> systems.
> >
> > We must fix some bugs in our DiskImage create.
> >   Write MBR, Write ldlinux.bss as Partition Boot Record with correct data.
> >   And set partition as active.
> >
> > With Yocto we build three for targets
> >
> > do_compile_target() {
> >                 echo "------------ do_compile do_compile_target ----------------"
> >                 # Make sure the recompile is OK.
> >                 # Though the ${B} should always exist, still check it before find and
> rm.
> >                 [ -d "${B}" ] && find ${B} -name '.*.d' -type f -exec
> > rm -f {} \;
> >
> >                 # Build bootloader for BIOS, EFI32, EFI64
> >                 oe_runmake CC="${SL_CC} ${SL_CFLAGS} -DDEBUG_STDIO"
> LD="${LD}" LDFLAGS="${SL_LDFLAGS} -m elf_i386"     firmware="bios"
> >                 oe_runmake CC="${SL_CC} ${SL_CFLAGS} -DDEBUG_STDIO"
> LD="${LD}" LDFLAGS="${SL_LDFLAGS} -m elf_i386"     firmware="efi32"
> >                 oe_runmake CC="${SL_CC} ${SL_CFLAGS} -DDEBUG_STDIO"
> LD="${LD}" LDFLAGS="${SL_LDFLAGS} -m elf_x86_64"   firmware="efi64"
> >
> >                 # Build Target syslinux installer executable
> >                 oe_runmake CC="${SL_CC} ${SL_CFLAGS}" LD="${LD}"
> > LDFLAGS="${SL_LDFLAGS}" firmware="bios"  installer }
> >
> > python do_compile() {
> >     bb.build.exec_func("filter_flags", d)
> >     bb.build.exec_func("do_compile_target", d) }
> >
> > # our BOOT Partition structure
> > # Partition Type must be a FAT (EFI Bootloader) # # /EFI/
> > # /EFI/BOOT                                                     EFI32, EFI64 Bootloader + syslx64.cfg
> + syslia32.cfg
> > # /EFI/BOOT/x32                                            32 Bit Modules for EFI32 (*.c32)
> > # /EFI/BOOT/x64                                            64 Bit Modules for EFI64 (*.c32)
> > # /syslinux/                                       SYSLINUX Bootloader + syslinux.cfg
> > # /CONFIG/
> >
> > in every directory are the needed *.c32 files.
> > With PATH we set the search directory for the *.c32 files.
> >
> > $ cat syslinux.cfg
> >                 #
> >                 # BIOS configuration
> >                 #
> >
> >                 PATH /syslinux
> >
> >                 # add empty lines
> >                 SAY
> >                 SAY Starting EFI64 ...
> >
> >                 # Include common config
> >                 INCLUDE /CONFIG/common.cfg
> >
> > so we have one common.cfg for all boot types
> >
> > Best regards.
> >   Johann
> >
> >
> > Von: Loïc Grenié <loic.grenie at gmail.com>
> > Gesendet: Donnerstag, 30. Juni 2022 13:43
> > An: Johann Obermayr <johann.obermayr at sigmatek.at>
> > Betreff: Re: [syslinux] Multiboot BIOS / EFI32 / EFI64
> >
> >      Hello,
> >
> > On Wed Jun 29, 2022 at 14:39, Johann Obermayr wrote:
> > Hello,
> >
> > I will make a boot disk, that can boot from older Hardware with BIOS boot &
> newer hardware with EFI boot.
> >
> > My idea is:
> >
> > Partition1: EFI Boot partition
> >    /EFI/BOOT/ BOOTia32.efi
> >    /EFI/BOOT/ BOOTx64.efi
> >   ...
> >   /syslinux/ldlinux.sys
> >   ...
> > Partition2: Linux System
> > ...
> > ...
> >
> > Also set EFI Boot Partition as active.
> > Witch BIN file must I install on MBR ?
> >    I think mbr.bin ist the correct.
> > For PBR (Partition Bootrecord) I use ldlinux.bss.
> > But is this compatible with the EFI Boot FAT Partition ?
> >
> > Is there a way to do this, or must I patch syslinux ?
> >
> >      I'd be interested in the answer to your question. I can only suggest to try
> with
> >   qemu: qemu has a native bios and, apparently, ovmf allows you to boot an
> UEFI
> >   system.
> >
> >       Good luck,
> >
> >            Loïc
> > _______________________________________________
> > Syslinux mailing list
> > Submissions to Syslinux at syslinux.org
> > Unsubscribe or set options at:
> > https://lists.syslinux.org/syslinux
> >
> _______________________________________________
> Syslinux mailing list
> Submissions to Syslinux at syslinux.org
> Unsubscribe or set options at:
> https://lists.syslinux.org/syslinux



More information about the Syslinux mailing list