[syslinux:firmware] load_linux: fallback to the BIOS linux loader

syslinux-bot for Matt Fleming matt.fleming at intel.com
Mon Jun 24 02:24:06 PDT 2013


Commit-ID:  acf2fcb4cc03c14fd144a740d68ff399e1932d9e
Gitweb:     http://www.syslinux.org/commit/acf2fcb4cc03c14fd144a740d68ff399e1932d9e
Author:     Matt Fleming <matt.fleming at intel.com>
AuthorDate: Mon, 24 Jun 2013 09:34:39 +0100
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Mon, 24 Jun 2013 09:46:38 +0100

load_linux: fallback to the BIOS linux loader

The BIOS firmware backend is missing a .load_linux pointer, and so
anyone trying to boot a Linux kernel under BIOS is hitting the following
error message,

   "No linux boot function registered for firmware"

The usual way to handle this kind of abstraction would be to move
bios_load_linux() to core/bios.c and assign it to .load_linux, but that
would necessitate pulling the movebits and shuffler code into the core.

For now, leave the BIOS loader where it is and use it as the default. In
future we will want to move this to BIOS-specific code (though not
necessarily in the core) because, by having it in the generic loader
code, it is currently being built for the EFI backends even though it is
never used.

Signed-off-by: Matt Fleming <matt.fleming at intel.com>

---
 com32/lib/syslinux/load_linux.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/com32/lib/syslinux/load_linux.c b/com32/lib/syslinux/load_linux.c
index 120c69b..914258b 100644
--- a/com32/lib/syslinux/load_linux.c
+++ b/com32/lib/syslinux/load_linux.c
@@ -517,11 +517,10 @@ int syslinux_boot_linux(void *kernel_buf, size_t kernel_size,
 			struct setup_data *setup_data,
 			char *cmdline)
 {
-    if (!firmware->boot_linux) {
-	printf("No linux boot function registered for firmware\n");
-	return -1;
-    }
+    if (firmware->boot_linux)
+	return firmware->boot_linux(kernel_buf, kernel_size, initramfs,
+				    setup_data, cmdline);
 
-    return firmware->boot_linux(kernel_buf, kernel_size, initramfs,
-				setup_data, cmdline);
+    return bios_boot_linux(kernel_buf, kernel_size, initramfs,
+			   setup_data, cmdline);
 }


More information about the Syslinux-commits mailing list