From: Shao Miller Date: Sun, 1 May 2011 17:49:43 +0000 (-0400) Subject: chain: Support loading ReactOS' FreeLdr X-Git-Tag: syslinux-4.05-pre1~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ad4cf1470977f648ee1dd45e97939589ccb0393c;p=platform%2Fupstream%2Fsyslinux.git chain: Support loading ReactOS' FreeLdr Use something like: LABEL freeldr COM32 chain.c32 APPEND freeldr=freeldr.sys Signed-off-by: Shao Miller --- diff --git a/NEWS b/NEWS index 443e1a5..88adba1 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,7 @@ Changes in 4.05: * ISOLINUX: remove the .img file support; it has been broken on virtually all systems since the beginning, and has been totally broken since 4.00 at least. Use MEMDISK instead. + * chain.c32: Support chaining ReactOS' FreeLdr (Shao Miller) Changes in 4.04: * PXELINUX: Fix handling of unqualified DNS names. diff --git a/com32/modules/chain.c b/com32/modules/chain.c index b4ee626..0e289f6 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= + * loads ReactOS' FreeLdr.sys to 0:8000 and jumps to the PE entry-point */ #include @@ -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= Load and execute file, instead of boot sector\n\ ntldr= Load Windows NTLDR, SETUPLDR.BIN or BOOTMGR\n\ cmldr= Load Recovery Console of Windows NT/2K/XP/2003\n\ freedos= Load FreeDOS KERNEL.SYS\n\ + freeldr= Load ReactOS' FREELDR.SYS\n\ msdos= Load MS-DOS IO.SYS\n\ pcdos= Load PC-DOS IBMBIO.COM\n\ drmk= 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));