aboutsummaryrefslogtreecommitdiffstats
path: root/com32/menu
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2012-03-13 09:58:26 +0000
committerMatt Fleming <matt.fleming@intel.com>2012-03-23 16:56:16 +0000
commit3dfe95eb4c8729d479043710a9f43456a2f6bf1d (patch)
tree895512a65116d4d408c2654a230322196f098e57 /com32/menu
parent6b28c0cfec3ecc43c9718fafbfd19297c3768701 (diff)
downloadsyslinux-3dfe95eb4c8729d479043710a9f43456a2f6bf1d.tar.gz
syslinux-3dfe95eb4c8729d479043710a9f43456a2f6bf1d.tar.xz
syslinux-3dfe95eb4c8729d479043710a9f43456a2f6bf1d.zip
com32: Delete execute.c and use the one from ldlinux
ldlinux provides us with an execute.c and all the functions that we need, there's no point in duplicating the code in com32/menu. Also, the copy in ldlinux doesn't use __com32.cs_bounce. Using cs_bounce no longer works with dynamic ELF modules because we don't have such tight control over the address space. Instead, memory must be allocated dynamically or reserved as part of the object file. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'com32/menu')
-rw-r--r--com32/menu/Makefile2
-rw-r--r--com32/menu/execute.c69
2 files changed, 1 insertions, 70 deletions
diff --git a/com32/menu/Makefile b/com32/menu/Makefile
index e1c700b2..b7719456 100644
--- a/com32/menu/Makefile
+++ b/com32/menu/Makefile
@@ -24,7 +24,7 @@ MODULES = menu.c32 vesamenu.c32
TESTFILES =
COMMONOBJS = menumain.o readconfig.o passwd.o drain.o printmsg.o colors.o \
- background.o refstr.o execute.o
+ background.o refstr.o
all: $(MODULES) $(TESTFILES)
diff --git a/com32/menu/execute.c b/com32/menu/execute.c
deleted file mode 100644
index c2de7353..00000000
--- a/com32/menu/execute.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/* ----------------------------------------------------------------------- *
- *
- * Copyright 2004-2008 H. Peter Anvin - All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
- * Boston MA 02110-1301, USA; either version 2 of the License, or
- * (at your option) any later version; incorporated herein by reference.
- *
- * ----------------------------------------------------------------------- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <com32.h>
-#include "menu.h"
-
-void execute(const char *cmdline, enum kernel_type type)
-{
- com32sys_t ireg;
- const char *p, *const *pp;
- char *q = __com32.cs_bounce;
- const char *kernel, *args;
-
- memset(&ireg, 0, sizeof ireg);
-
- kernel = q;
- p = cmdline;
- while (*p && !my_isspace(*p)) {
- *q++ = *p++;
- }
- *q++ = '\0';
-
- args = q;
- while (*p && my_isspace(*p))
- p++;
-
- strcpy(q, p);
-
- if (kernel[0] == '.' && type == KT_NONE) {
- /* It might be a type specifier */
- enum kernel_type type = KT_NONE;
- for (pp = kernel_types; *pp; pp++, type++) {
- if (!strcmp(kernel + 1, *pp)) {
- execute(p, type); /* Strip the type specifier and retry */
- }
- }
- }
-
- if (type == KT_LOCALBOOT) {
- ireg.eax.w[0] = 0x0014; /* Local boot */
- ireg.edx.w[0] = strtoul(kernel, NULL, 0);
- } else {
- if (type < KT_KERNEL)
- type = KT_KERNEL;
-
- 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);
-
- /* If this returns, something went bad; return to menu */
-}