aboutsummaryrefslogtreecommitdiffstats
path: root/com32
diff options
context:
space:
mode:
authorShao Miller <shao.miller@yrdsb.edu.on.ca>2011-05-01 13:49:43 -0400
committerShao Miller <shao.miller@yrdsb.edu.on.ca>2011-05-01 14:14:24 -0400
commitad4cf1470977f648ee1dd45e97939589ccb0393c (patch)
tree715d923128ca439c15e472ef3acc75deca816c79 /com32
parentf4367fdef3146cf6a90a8d13c433b27429b78ddd (diff)
downloadsyslinux-ad4cf1470977f648ee1dd45e97939589ccb0393c.tar.gz
syslinux-ad4cf1470977f648ee1dd45e97939589ccb0393c.tar.xz
syslinux-ad4cf1470977f648ee1dd45e97939589ccb0393c.zip
chain: Support loading ReactOS' FreeLdr
Use something like: LABEL freeldr COM32 chain.c32 APPEND freeldr=freeldr.sys Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Diffstat (limited to 'com32')
-rw-r--r--com32/modules/chain.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/com32/modules/chain.c b/com32/modules/chain.c
index b4ee6269..0e289f6f 100644
--- a/com32/modules/chain.c
+++ b/com32/modules/chain.c
@@ -107,6 +107,9 @@
*
* keeppxe
* keep the PXE and UNDI stacks in memory (PXELINUX only).
+ *
+ * freeldr=<loader>
+ * loads ReactOS' FreeLdr.sys to 0:8000 and jumps to the PE entry-point
*/
#include <com32.h>
@@ -132,6 +135,7 @@ static struct options {
bool isolinux;
bool cmldr;
bool grub;
+ bool freeldr;
bool grldr;
const char *grubcfg;
bool swap;
@@ -1278,6 +1282,7 @@ Options: file=<loader> Load and execute file, instead of boot sector\n\
ntldr=<loader> Load Windows NTLDR, SETUPLDR.BIN or BOOTMGR\n\
cmldr=<loader> Load Recovery Console of Windows NT/2K/XP/2003\n\
freedos=<loader> Load FreeDOS KERNEL.SYS\n\
+ freeldr=<loader> Load ReactOS' FREELDR.SYS\n\
msdos=<loader> Load MS-DOS IO.SYS\n\
pcdos=<loader> Load PC-DOS IBMBIO.COM\n\
drmk=<loader> Load DRMK DELLBIO.BIN\n\
@@ -1346,6 +1351,11 @@ int main(int argc, char *argv[])
opt.seg = 0x60; /* FREEDOS wants this address */
opt.loadfile = argv[i] + 8;
opt.sethidden = true;
+ } else if (!strncmp(argv[i], "freeldr=", 8)) {
+ opt.loadfile = argv[i] + 8;
+ opt.sethidden = true;
+ /* The FreeLdr PE wants to be at 0:8000 */
+ opt.freeldr = true;
} else if (!strncmp(argv[i], "msdos=", 6) ||
!strncmp(argv[i], "pcdos=", 6)) {
opt.seg = 0x70; /* MS-DOS 2.0+ wants this address */
@@ -1418,6 +1428,13 @@ int main(int argc, char *argv[])
regs.ip = regs.esp.l = 0x7c00;
}
+ if (opt.freeldr) {
+ /* Load to 0800:0000, which happens to be 0000:8000 */
+ opt.seg = 0x800;
+ /* TODO: Properly parse the PE. Right now, this is hard-coded */
+ regs.ip = 0x8100;
+ }
+
hd = 0;
if (!strncmp(drivename, "mbr", 3)) {
drive = find_disk(strtoul(drivename + 4, NULL, 0));