[syslinux:elflink] ldlinux: Add localboot support

syslinux-bot for Matt Fleming matt.fleming at linux.intel.com
Fri May 27 17:15:18 PDT 2011


Commit-ID:  eecc876ef99deb4cf753db5b31d5eb1f83600b6c
Gitweb:     http://syslinux.zytor.com/commit/eecc876ef99deb4cf753db5b31d5eb1f83600b6c
Author:     Matt Fleming <matt.fleming at linux.intel.com>
AuthorDate: Tue, 24 May 2011 11:54:10 +0100
Committer:  Matt Fleming <matt.fleming at linux.intel.com>
CommitDate: Tue, 24 May 2011 12:01:08 +0100

ldlinux: Add localboot support

Add a few tweaks to enable ldlinux to localboot a hard disk. Most of
the support was already there, there were just a few bug fixes in
execute().

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


---
 com32/elflink/ldlinux/execute.c |   17 +++++++++--------
 com32/elflink/ldlinux/ldlinux.c |    9 +++++++--
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/com32/elflink/ldlinux/execute.c b/com32/elflink/ldlinux/execute.c
index a00a5b1..635e327 100644
--- a/com32/elflink/ldlinux/execute.c
+++ b/com32/elflink/ldlinux/execute.c
@@ -134,7 +134,7 @@ void execute(const char *cmdline, enum kernel_type type)
 		argv[argc] = NULL;
 		module_load_dependencies(kernel, "modules.dep");
 		spawn_load(kernel, argc, argv);
-	} else if (type <= KT_KERNEL) {
+	} 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);
@@ -148,14 +148,15 @@ void execute(const char *cmdline, enum kernel_type type)
 		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] = 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" */
 
 		__intcall(0x22, &ireg, NULL);
 	}
diff --git a/com32/elflink/ldlinux/ldlinux.c b/com32/elflink/ldlinux/ldlinux.c
index 9ba1aeb..67f38c0 100644
--- a/com32/elflink/ldlinux/ldlinux.c
+++ b/com32/elflink/ldlinux/ldlinux.c
@@ -27,8 +27,13 @@ static void load_kernel(const char *kernel)
 	/* Virtual kernel? */
 	me = find_label(kernel);
 	if (me) {
-		/* XXX we don't handle LOCALBOOT yet */
-		execute(me->cmdline, KT_KERNEL);
+		enum kernel_type type = KT_KERNEL;
+
+		/* cmdline contains type specifier */
+		if (me->cmdline[0] == '.')
+			type = KT_NONE;
+
+		execute(me->cmdline, type);
 		/* We shouldn't return */
 		goto bad_kernel;
 	}



More information about the Syslinux-commits mailing list