[syslinux:elflink] ldlinux: Make the default execute type KT_KERNEL

syslinux-bot for Matt Fleming matt.fleming at intel.com
Mon Mar 26 15:36:06 PDT 2012


Commit-ID:  aa4544d4afdf576ca5e8e1581f968a9e41037ba9
Gitweb:     http://www.syslinux.org/commit/aa4544d4afdf576ca5e8e1581f968a9e41037ba9
Author:     Matt Fleming <matt.fleming at intel.com>
AuthorDate: Tue, 13 Mar 2012 09:39:14 +0000
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Fri, 23 Mar 2012 16:56:16 +0000

ldlinux: Make the default execute type KT_KERNEL

Default to trying to boot a linux kernel image, which was the
behaviour of the old asm image file loader.

Note that we don't need to go through __intcall() to load a kernel as
the dynamic linker will fixup any references to the kernel load
functions for us at runtime. Furthermore, modules invoking execute()
could be located anywhere in the 32-bit address space and may not be
able to represent their pointer arguments with SEG() and OFFS(), so
using the comboot API may not even work.

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

---
 com32/elflink/ldlinux/execute.c |   25 +++++++------------------
 1 files changed, 7 insertions(+), 18 deletions(-)

diff --git a/com32/elflink/ldlinux/execute.c b/com32/elflink/ldlinux/execute.c
index b3ed958..269b74d 100644
--- a/com32/elflink/ldlinux/execute.c
+++ b/com32/elflink/ldlinux/execute.c
@@ -86,10 +86,6 @@ void execute(const char *cmdline, enum kernel_type type)
 		/* new entry for elf format c32 */
 		lfree(kernel);
 		create_args_and_load(cmdline);
-	} else if (type == KT_KERNEL) {
-		/* Need add one item for kernel load, as we don't use
-		* the assembly runkernel.inc any more */
-		new_linux_kernel(kernel, cmdline);
 	} else if (type == KT_CONFIG) {
 		char *argv[] = { "ldlinux.c32", NULL };
 
@@ -101,22 +97,15 @@ void execute(const char *cmdline, enum kernel_type type)
 			mangle_name(config_cwd, args);
 
 		start_ldlinux("ldlinux.c32", 1, argv);
-	} else {
+	} else if (type == KT_LOCALBOOT) {
 		/* process the image need int 22 support */
-		if (type == KT_LOCALBOOT) {
-			ireg.eax.w[0] = 0x0014;	/* Local boot */
-			ireg.edx.w[0] = strtoul(kernel, NULL, 0);
-		} else {
-			ireg.eax.w[0] = 0x0016;	/* Run kernel image */
-			ireg.esi.w[0] = OFFS(kernel);
-			ireg.ds = SEG(kernel);
-			ireg.ebx.w[0] = OFFS(args);
-			ireg.es = SEG(args);
-			ireg.edx.l = type - KT_KERNEL;
-			/* ireg.ecx.l    = 0; *//* We do ipappend "manually" */
-		}
-
+		ireg.eax.w[0] = 0x0014;	/* Local boot */
+		ireg.edx.w[0] = strtoul(kernel, NULL, 0);
 		__intcall(0x22, &ireg, NULL);
+	} else {
+		/* Need add one item for kernel load, as we don't use
+		* the assembly runkernel.inc any more */
+		new_linux_kernel(kernel, cmdline);
 	}
 
 	lfree(kernel);


More information about the Syslinux-commits mailing list