All of lore.kernel.org
 help / color / mirror / Atom feed
* efilinux release 0.8
@ 2011-07-28 11:44 Matt Fleming
  2011-07-28 14:42 ` [syslinux] " KESHAV P.R.
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Matt Fleming @ 2011-07-28 11:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: syslinux

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [syslinux] efilinux release 0.8
  2011-07-28 11:44 efilinux release 0.8 Matt Fleming
@ 2011-07-28 14:42 ` KESHAV P.R.
  2011-08-02 20:30 ` Metatech
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: KESHAV P.R. @ 2011-07-28 14:42 UTC (permalink / raw)
  To: For discussion of Syslinux and tftp-hpa; +Cc: linux-kernel

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: efilinux release 0.8
  2011-07-28 11:44 efilinux release 0.8 Matt Fleming
  2011-07-28 14:42 ` [syslinux] " KESHAV P.R.
@ 2011-08-02 20:30 ` Metatech
  2011-08-03 21:51 ` Maarten Lankhorst
  2011-10-01 17:36 ` Dick
  3 siblings, 0 replies; 5+ messages in thread
From: Metatech @ 2011-08-02 20:30 UTC (permalink / raw)
  To: linux-kernel

Hi Matt,

I tested your program on a MacBook Pro 5,3 (x86-64 efi).

Here are the changes I did :

1. In protocol.h, comment "LocateProtocol" function

2. Add 2 symlinks in Ubuntu
mkdir /usr/lib64/gnuefi
cd /usr/lib64/gnuefi
sudo ln -s /usr/lib64/crt0-efi-x86_64.o crt0-efi-x86_64.o
sudo ln -s  /usr/lib64/elf_x86_64_efi.lds elf_x86_64_efi.lds

3. Comment the CRC check on the executable
/*if (CheckCrc(sys_table->Hdr.HeaderSize, &sys_table->Hdr) != TRUE)*/

4. The program fails in function "fs_init", with the following error
		Print(L"No devices support filesystems\n");
-> err = 14 (which means "not found").

Hope this helps,
Regards,

metatech


On 28 July 2011 13:44, Matt Fleming <matt@console-pimps.org> 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).

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: efilinux release 0.8
  2011-07-28 11:44 efilinux release 0.8 Matt Fleming
  2011-07-28 14:42 ` [syslinux] " KESHAV P.R.
  2011-08-02 20:30 ` Metatech
@ 2011-08-03 21:51 ` Maarten Lankhorst
  2011-10-01 17:36 ` Dick
  3 siblings, 0 replies; 5+ messages in thread
From: Maarten Lankhorst @ 2011-08-03 21:51 UTC (permalink / raw)
  To: Matt Fleming; +Cc: linux-kernel, syslinux

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@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);


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: efilinux release 0.8
  2011-07-28 11:44 efilinux release 0.8 Matt Fleming
                   ` (2 preceding siblings ...)
  2011-08-03 21:51 ` Maarten Lankhorst
@ 2011-10-01 17:36 ` Dick
  3 siblings, 0 replies; 5+ messages in thread
From: Dick @ 2011-10-01 17:36 UTC (permalink / raw)
  To: linux-kernel

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.

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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-10-01 17:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-28 11:44 efilinux release 0.8 Matt Fleming
2011-07-28 14:42 ` [syslinux] " KESHAV P.R.
2011-08-02 20:30 ` Metatech
2011-08-03 21:51 ` Maarten Lankhorst
2011-10-01 17:36 ` Dick

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.