Hi, I'm pleased to announce release 0.8 of efilinux, a reference implementation of a minimal UEFI bootloader. This bootloader has no bells or whistles, it is simply a prototype with the minimum amount of smarts required to load a linux kernel (though loaders for other formats could be added). Currently it only supports booting x86-64 bzImages but i386 support is planned for release 0.9, with a 1.0 release coming after a thorough round of testing. If anyone has the time and inclination I'd really appreciate it if they could have a play with it on their machines and report any bugs. Testing has mainly been done under qemu up to this point so there are bound to be some lurking bugs that only show up on real hardware. As there is no configuration file parser all config is done via command-line arguments. To boot a kernel simply type, Shell> efilinux -l efilinux loader 0.8 Devices: 0. "Acpi(PNP0A03,0)/Pci(1|1)/Ata(Primary,Master)" Shell> efilinux -f Acpi(PNP0A03,0)/Pci(1|1)/Ata(Primary,Master):\bzimage efilinux understands the LILO-style initrd= kernel command-line argument, but the full device path to the initrd is required. A kernel command-line can be passed at the end of the command-line, e.g. Shell> efilinux -f bzimage console=ttyS0 root=/dev/sdb The latest release is available at, git://git.kernel.org/pub/scm/boot/efilinux/efilinux.git This project is a preview of the EFI stub patches that I hope to push into the kernel. The EFI stub will allow a bzImage to masquerade as an EFI application, such that the firmware will load the bzImage and jump to its entry point without requiring a bootloader at all. -- Matt Fleming, Intel Open Source Technology Center
Hi, Compile error in Archlinux x86_64 with gcc-multilib 4.6.1 , gnu-efi 3.0k (x86_64 UEFI libs only) - GIT devel branch - snapshot http://git.kernel.org/?p=boot/efilinux/efilinux.git;a=snapshot;h=471830a5a7494b6ca59f914cc7e93e75ed4b2a88;sf=tgz cc -I. -I/usr/include/efi -I/usr/include/efi/x86_64 -DEFI_FUNCTION_WRAPPER -fPIC -fshort-wchar -ffreestanding -Wall -Ifs/ -Iloaders/ -Dx86_64 -Werror -c -o entry.o entry.c In file included from entry.c:38:0: protocol.h: In function 'locate_protocol': protocol.h:62:31: error: 'EFI_BOOT_SERVICES' has no member named 'LocateProtocol' make: *** [entry.o] Error 1 gnu-efi 3.0k File list (libs in /usr/lib/ not /usr/lib64 in Archlinux) gnu-efi /usr/ gnu-efi /usr/include/ gnu-efi /usr/include/efi/ gnu-efi /usr/include/efi/efi.h gnu-efi /usr/include/efi/efi_nii.h gnu-efi /usr/include/efi/efi_pxe.h gnu-efi /usr/include/efi/efiapi.h gnu-efi /usr/include/efi/eficon.h gnu-efi /usr/include/efi/efidebug.h gnu-efi /usr/include/efi/efidef.h gnu-efi /usr/include/efi/efidevp.h gnu-efi /usr/include/efi/efierr.h gnu-efi /usr/include/efi/efifs.h gnu-efi /usr/include/efi/efigpt.h gnu-efi /usr/include/efi/efilib.h gnu-efi /usr/include/efi/efilink.h gnu-efi /usr/include/efi/efinet.h gnu-efi /usr/include/efi/efipart.h gnu-efi /usr/include/efi/efiprot.h gnu-efi /usr/include/efi/efipxebc.h gnu-efi /usr/include/efi/efirtlib.h gnu-efi /usr/include/efi/efiser.h gnu-efi /usr/include/efi/efistdarg.h gnu-efi /usr/include/efi/efiui.h gnu-efi /usr/include/efi/libsmbios.h gnu-efi /usr/include/efi/pci22.h gnu-efi /usr/include/efi/protocol/ gnu-efi /usr/include/efi/protocol/adapterdebug.h gnu-efi /usr/include/efi/protocol/eficonsplit.h gnu-efi /usr/include/efi/protocol/efidbg.h gnu-efi /usr/include/efi/protocol/efivar.h gnu-efi /usr/include/efi/protocol/intload.h gnu-efi /usr/include/efi/protocol/legacyboot.h gnu-efi /usr/include/efi/protocol/piflash64.h gnu-efi /usr/include/efi/protocol/vgaclass.h gnu-efi /usr/include/efi/romload.h gnu-efi /usr/include/efi/x86_64/ gnu-efi /usr/include/efi/x86_64/efibind.h gnu-efi /usr/include/efi/x86_64/efilibplat.h gnu-efi /usr/include/efi/x86_64/pe.h gnu-efi /usr/lib/ gnu-efi /usr/lib/crt0-efi-x86_64.o gnu-efi /usr/lib/elf_x86_64_efi.lds gnu-efi /usr/lib/libefi.a gnu-efi /usr/lib/libgnuefi.a Firmware to be used is Tianocore UDK/EDK2 DUET x86_64 (UEFI 2.3.1 compliant reference implementation) https://gitorious.org/tianocore_uefi_duet_builds (wiki https://gitorious.org/tianocore_uefi_duet_builds/pages/Home ) and VirtualBox EFI firmware (based on Tianocore OVMF). I already boot grub2 (x86_64-efi platform) with it (including Linux 3.0 x86_64 kernel). Can this be built using Tianocore EDK2 libraries instead of gnu-efi. Also is this going to be syslinux UEFI bootloader or independent of it? Thanks for the program. Regards. Keshav
On 07/28/2011 01:44 PM, Matt Fleming wrote:> Hi, > > I'm pleased to announce release 0.8 of efilinux, a reference > implementation of a minimal UEFI bootloader. This bootloader has no > bells or whistles, it is simply a prototype with the minimum amount of > smarts required to load a linux kernel (though loaders for other formats > could be added). > > Currently it only supports booting x86-64 bzImages but i386 support is > planned for release 0.9, with a 1.0 release coming after a thorough > round of testing. > > If anyone has the time and inclination I'd really appreciate it if they > could have a play with it on their machines and report any bugs. Testing > has mainly been done under qemu up to this point so there are bound to > be some lurking bugs that only show up on real hardware. > > As there is no configuration file parser all config is done via > command-line arguments. To boot a kernel simply type, > > Shell> efilinux -l > efilinux loader 0.8 > Devices: > > 0. "Acpi(PNP0A03,0)/Pci(1|1)/Ata(Primary,Master)" > > Shell> efilinux -f Acpi(PNP0A03,0)/Pci(1|1)/Ata(Primary,Master):\bzimage > > efilinux understands the LILO-style initrd= kernel command-line > argument, but the full device path to the initrd is required. A kernel > command-line can be passed at the end of the command-line, e.g. > > Shell> efilinux -f bzimage console=ttyS0 root=/dev/sdb > > The latest release is available at, > > git://git.kernel.org/pub/scm/boot/efilinux/efilinux.git > > This project is a preview of the EFI stub patches that I hope to push > into the kernel. The EFI stub will allow a bzImage to masquerade as an > EFI application, such that the firmware will load the bzImage and jump > to its entry point without requiring a bootloader at all. >Yuck, it's case sensitive and it requires you to type all that? Here's a patch to accept 0:\vmlinuz initrd=0:\initrd.img and zap the sensitivity. I alter name in file_open, but it seems nothing else requires it anyhow, so I didn't see a need to copy or revert it. For what it's worth, it didn't seem to boot on my asrock P67 pro3. Signed-off-by: Maarten Lankhorst <m.b.lankhorst at gmail.com> --- diff --git a/fs/fs.c b/fs/fs.c index b799c00..555ced3 100644 --- a/fs/fs.c +++ b/fs/fs.c @@ -66,6 +66,21 @@ file_open(CHAR16 *name, struct file **file) if (!f) return EFI_OUT_OF_RESOURCES; + for (dev_len = 0; name[dev_len]; ++dev_len) { + if (name[dev_len] == ':') break; + } + if (!name[dev_len] || !dev_len) + goto notfound; + name[dev_len] = 0; + + if (name[0] >= '0' && name[0] <= '9') { + i = Atoi(name); + if (i >= nr_fs_devices) + goto notfound; + f->handle = fs_devices[i].fh; + goto found; + } + for (i = 0; i < nr_fs_devices; i++) { EFI_DEVICE_PATH *path; CHAR16 *dev; @@ -73,23 +88,20 @@ file_open(CHAR16 *name, struct file **file) path = DevicePathFromHandle(fs_devices[i].handle); dev = DevicePathToStr(path); - if (!StrnCmp(dev, name, StrLen(dev))) { + if (!StriCmp(dev, name)) { f->handle = fs_devices[i].fh; - dev_len = StrLen(dev); free_pool(dev); break; } free_pool(dev); } + if (i == nr_fs_devices) + goto notfound; - if (i == nr_fs_devices) { - err = EFI_NOT_FOUND; - goto fail; - } - +found: /* Strip the device name */ - filename = name + dev_len; + filename = name + dev_len + 1; /* skip any path separators */ while (*filename == ':' || *filename == '\\') @@ -104,6 +116,8 @@ file_open(CHAR16 *name, struct file **file) *file = f; return err; +notfound: + err = EFI_NOT_FOUND; fail: Print(L"Unable to open file \"%s\"", name); free(f);
(Let's move this to the Syslinux mailing list and add Keshav) On Sat, 2011-10-01 at 17:36 +0000, Dick wrote:> Matt Fleming <matt <at> console-pimps.org> writes: > > If anyone has the time and inclination I'd really appreciate it if they > > could have a play with it on their machines and report any bugs. > > Latitude E6510 (Intel 45 Express chipset, UEFI can start efilinux.efi (I get the > usage output) but when I load a kernel it get stuck after a message about the > kernel is being loaded.Have you compiled your kernel with CONFIG_FB_EFI=y? Can you hook up a serial console and see if anything is emitted? Can you tell if your machine has hung while trying to load the kernel image or is it just that the kernel has boooted but isn't printing anything on the screen?> I'm using the (old) shell (EdkShellBinPkg) from tianocore(.sf.net) to start > efilinux.efi because the Dell BIOS setup utility can't add parameters to an EFI > executable.Hmm.. Keshav has also run into this problem with the old tianocore shell and I haven't been able to get to the bottom of it yet. Can you try the latest version at, https://github.com/mfleming/efilinux.git And if that version still doesn't work can you apply the following patch to efilinux and see if you are returned to the EFI shell after trying to load the kernel, i.e. it should no longer hang, but it won't successfully boot the kernel either. diff --git a/loaders/bzimage/bzimage.c b/loaders/bzimage/bzimage.c index 054df4d..1b011eb 100644 --- a/loaders/bzimage/bzimage.c +++ b/loaders/bzimage/bzimage.c @@ -308,6 +308,7 @@ again: /* Close all open file handles */ fs_close(); + return EFI_SUCCESS; err = exit_boot_services(image, map_key); if (err != EFI_SUCCESS) goto out;