summaryrefslogtreecommitdiff
path: root/com32/lib/syslinux/shuffle_rm.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-03-14 21:50:36 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-03-14 21:50:36 -0700
commita80b07e7fb8feec668a435101659e3ed94015a23 (patch)
treee756f82c2156a7d1a813d142a2541b696004a153 /com32/lib/syslinux/shuffle_rm.c
parentab6acefe649751b072fd9be21ff5de7733c1370e (diff)
downloadsyslinux-a80b07e7fb8feec668a435101659e3ed94015a23.tar.gz
Add a register-setting shuffle and boot for real mode; clean up headers.syslinux-3.40-pre14
- Add an API function to shuffle and boot which sets *all* RM registers; - Move those structures to <syslinux/bootpm.h> and <syslinux/bootrm.h>
Diffstat (limited to 'com32/lib/syslinux/shuffle_rm.c')
-rw-r--r--com32/lib/syslinux/shuffle_rm.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/com32/lib/syslinux/shuffle_rm.c b/com32/lib/syslinux/shuffle_rm.c
index e676e1dd..e87028aa 100644
--- a/com32/lib/syslinux/shuffle_rm.c
+++ b/com32/lib/syslinux/shuffle_rm.c
@@ -28,7 +28,7 @@
/*
* shuffle_rm.c
*
- * Shuffle and boot to real mode code
+ * Shuffle and boot to protected mode code
*/
#include <stdlib.h>
@@ -36,31 +36,33 @@
#include <com32.h>
#include <string.h>
#include <syslinux/movebits.h>
+#include <syslinux/bootrm.h>
int syslinux_shuffle_boot_rm(struct syslinux_movelist *fraglist,
struct syslinux_memmap *memmap,
uint16_t bootflags,
- uint32_t edx, uint32_t esi, uint16_t ds,
- uint16_t cs, uint16_t ip)
+ struct syslinux_rm_regs *regs)
{
int nd;
com32sys_t ireg;
+ char *regbuf;
nd = syslinux_prepare_shuffle(fraglist, memmap);
if (nd < 0)
return -1;
+ regbuf = (char *)__com32.cs_bounce + (12*nd);
+ memcpy(regbuf, regs, sizeof(*regs));
+
memset(&ireg, 0, sizeof ireg);
- ireg.eax.w[0] = 0x0012;
+ ireg.eax.w[0] = 0x001b;
ireg.edx.w[0] = bootflags;
ireg.es = SEG(__com32.cs_bounce);
ireg.edi.l = OFFS(__com32.cs_bounce);
ireg.ecx.l = nd;
- ireg.ebx.l = edx;
- ireg.esi.l = esi;
- ireg.ds = ds;
- ireg.ebp.l = (cs << 16) + ip;
+ ireg.ds = SEG(regbuf);
+ ireg.esi.l = OFFS(regbuf);
__intcall(0x22, &ireg, NULL);
return -1; /* Too many descriptors? */