aboutsummaryrefslogtreecommitdiffstats
path: root/com32/cmenu/libmenu/syslnx.c
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2012-06-08 14:07:37 +0100
committerMatt Fleming <matt.fleming@intel.com>2012-06-08 14:07:37 +0100
commitb1b44de1264c40f806f672012bac590cf87eca92 (patch)
tree158a0f5b18260e65e6a68a24afc667786a0e37f8 /com32/cmenu/libmenu/syslnx.c
parente33c487c3930357a4f53455e019c72be0477ef98 (diff)
downloadsyslinux-b1b44de1264c40f806f672012bac590cf87eca92.tar.gz
syslinux-b1b44de1264c40f806f672012bac590cf87eca92.tar.xz
syslinux-b1b44de1264c40f806f672012bac590cf87eca92.zip
Delete all references to __com32.cs_bounce
The COM32 cs_bounce buffer is not usable with ELF modules, as we're trying to move to an environment where memory is dynamically allocated. All users of __com32.cs_bounce have been converted to using lmalloc() to allocate low memory. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'com32/cmenu/libmenu/syslnx.c')
-rw-r--r--com32/cmenu/libmenu/syslnx.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/com32/cmenu/libmenu/syslnx.c b/com32/cmenu/libmenu/syslnx.c
index 53e2401b..27823df8 100644
--- a/com32/cmenu/libmenu/syslnx.c
+++ b/com32/cmenu/libmenu/syslnx.c
@@ -28,10 +28,16 @@ char issyslinux(void)
void runsyslinuxcmd(const char *cmd)
{
- strcpy(__com32.cs_bounce, cmd);
+ char *bounce;
+
+ bounce = lmalloc(strlen(cmd) + 1);
+ if (!bounce)
+ return;
+
+ strcpy(bounce, cmd);
REG_AX(inreg) = 0x0003; // Run command
- REG_BX(inreg) = OFFS(__com32.cs_bounce);
- REG_ES(inreg) = SEG(__com32.cs_bounce);
+ REG_BX(inreg) = OFFS(bounce);
+ REG_ES(inreg) = SEG(bounce);
__intcall(0x22, &inreg, &outreg);
}
@@ -62,6 +68,7 @@ void runsyslinuximage(const char *cmd, long ipappend)
{
unsigned int numfun = 0;
char *ptr, *cmdline;
+ char *bounce;
(void)ipappend; // XXX: Unused?!
@@ -71,8 +78,12 @@ void runsyslinuximage(const char *cmd, long ipappend)
runsyslinuxcmd(cmd);
// Try the Run Kernel Image function
// Split command line into
- strcpy(__com32.cs_bounce, cmd);
- ptr = __com32.cs_bounce;
+ bounce = lmalloc(strlen(cmd) + 1);
+ if (!bounce)
+ return;
+
+ strcpy(bounce, cmd);
+ ptr = bounce;
// serach for first space or end of string
while ((*ptr) && (*ptr != ' '))
ptr++;
@@ -87,8 +98,8 @@ void runsyslinuximage(const char *cmd, long ipappend)
// Now call the interrupt
REG_BX(inreg) = OFFS(cmdline);
REG_ES(inreg) = SEG(cmdline);
- REG_SI(inreg) = OFFS(__com32.cs_bounce);
- REG_DS(inreg) = SEG(__com32.cs_bounce);
+ REG_SI(inreg) = OFFS(bounce);
+ REG_DS(inreg) = SEG(bounce);
REG_EDX(inreg) = 0;
__intcall(0x22, &inreg, &outreg); // If successful does not return