From: Matt Fleming Date: Tue, 13 Mar 2012 09:39:14 +0000 (+0000) Subject: ldlinux: Make the default execute type KT_KERNEL X-Git-Tag: syslinux-5.00-pre1~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aa4544d4afdf576ca5e8e1581f968a9e41037ba9;p=platform%2Fupstream%2Fsyslinux.git 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 --- 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);