From: Matt Fleming Date: Tue, 24 May 2011 10:54:10 +0000 (+0100) Subject: ldlinux: Add localboot support X-Git-Tag: syslinux-5.00-pre1~48 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eecc876ef99deb4cf753db5b31d5eb1f83600b6c;p=platform%2Fupstream%2Fsyslinux.git 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 --- 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; }