Dear list, I would like to add and test EFI boot support for a live system. Since I use isolinux and syslinux for everything, I would be glad to have syslinux.efi as boot loader for EFI-only machines, so I can just keep all syslinux.cfg files, help files and boot screen as they are. I checked out version 6.00-pre git of syslinux (the "firmware" branch) and was able to compile efi32 and efi64 versions (w/ gnu-efi 3.0t from Debian/experimental) of syslinux.efi on my 32bit netbook, however, I think that the generated file format for both .efi files is just wrong. Neither the OMVF EFI firmware, nor grub-efi or elilo can load the generated syslinux.efi binaries, and the reason seems to be this: $ file elilo.efi syslinux.efi syslinux.so elilo.efi: PE32+ executable (EFI application) x86-64 (stripped to external PDB), for MS Windows syslinux.efi: MS-DOS executable syslinux.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), not stripped The output for syslinux.efi just looks wrong. When checked with hexedit, the header of elilo.efi until .text also looks larger, but this may be related to some small boot code section which generates a verbose error message in case something goes wrong in elilo. The part of the syslinux code which turns syslinux.so ito syslinux.efi is efi/wrapper.c. I'm not quite sure whether or not this wrapper MUST be compiled and run under a pure 64bit environment. The source suggests that it would detect ELF64 and ELF32 automatically, and actually, this is true, but maybe the header is created wrongly for the 64bit version when running under 32bit. I wasn't able to start with the 32bit version of syslinux.efi either, though. So it looks like I cannot even test syslinux.efi right now because there is no EFI-suitable binary generated at all. Are there maybe precompiled .efi binaries available that I could try? Is wrapper.c doing something wrong, or is it just me? Since I don't need any of the syslinux module functions like menu.c32 or vesa.c32, just the plain commandline bootloader, syslinux.efi in 32 and 64bit would be perfect, if I get it running. Any hints about creating the right EFI file format for syslinux.efi? With kind regards -Klaus
On Tue, 07 May, at 01:05:22PM, Klaus Knopper wrote:> I checked out version 6.00-pre git of syslinux (the "firmware" branch) > and was able to compile efi32 and efi64 versions (w/ gnu-efi 3.0t from > Debian/experimental) of syslinux.efi on my 32bit netbook, however, I > think that the generated file format for both .efi files is just wrong. > Neither the OMVF EFI firmware, nor grub-efi or elilo can load the > generated syslinux.efi binaries, and the reason seems to be this:Hmm.. I have successfully loaded syslinux.efi from the OVMF firmware. I didn't think that grub-efi or elilo had the facilities to execute EFI applications? What error messages are you seeing when loading syslinux.efi from OVMF?> $ file elilo.efi syslinux.efi syslinux.so > elilo.efi: PE32+ executable (EFI application) x86-64 (stripped to external PDB), for MS Windows > syslinux.efi: MS-DOS executable > syslinux.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), not stripped > > The output for syslinux.efi just looks wrong.Well, the .efi file works fine when executed from multiple firmware implementations. I'm not sure what magic file(1) uses to figure out the type of PE32+ files, but I assure you that all the required fields appear in the syslinux.efi header. People have brought this discrepancy up before and I've just never found the time to fix it.> So it looks like I cannot even test syslinux.efi right now because there > is no EFI-suitable binary generated at all.Have you actually tried running syslinux.efi from the 6.0-pre* releases, either the EFI shell or the EFI boot manager? They should work.> Since I don't need any of the syslinux module functions like menu.c32 or > vesa.c32, just the plain commandline bootloader, syslinux.efi in 32 and > 64bit would be perfect, if I get it running.You will also need to install ldinux.c32, which contains all the key parts of Syslinux that are not absolutely required to be in the core (e.g. syslinux.efi). -- Matt Fleming, Intel Open Source Technology Center
On Tue, 07 May, at 01:05:22PM, Klaus Knopper wrote:> $ file elilo.efi syslinux.efi syslinux.so > elilo.efi: PE32+ executable (EFI application) x86-64 (stripped to external PDB), for MS Windows > syslinux.efi: MS-DOS executable > syslinux.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), not stripped > > The output for syslinux.efi just looks wrong.In case anyone is curious why file(1) claims that syslinux.efi is an MS-DOS executable, it's because file(1) checks whether the value of the relocs pointer field in the MS-DOS header is >= 0x40, and in the case of syslinux.efi the field is 0x00. -- Matt Fleming, Intel Open Source Technology Center