Ady Ady
2017-Feb-20 19:17 UTC
[syslinux] [PATCH] Correct chain.c32 v. 6.04-pre1 for Reactos
Correct the "seg=" value(s) corresponding to the "reactos=" option for chain.c32. The correct segment parameter should be "seg=0x0F80", instead of the incorrect / failing ones "seg=0:0x8000:0x8100". References: https://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/notes.txt?revision=73859&view=markup&pathrev=73859#l24 https://git.reactos.org/?p=reactos.git;a=blob;f=reactos/boot/freeldr/notes.txt;hb=HEAD https://git.reactos.org/?p=reactos.git&a=search&h=HEAD&st=grep&s=FREELDR_BASE https://git.reactos.org/?p=reactos.git;a=blob;f=reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h;h=c747d145cb3b35f68caab5291dc65dcdca21f17d;hb=HEAD#l17 https://git.reactos.org/?p=reactos.git;a=blob;f=reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h;hb=HEAD At the time of writing this patch, the up-to-date bootsectors referring to the above 'define' ("FREELDR_BASE") have a filename extension ending with ".S". There is also "multiboot.S", FWIW. Regards, Ady. diff U3 com32/chain/options.c com32/chain/options.c --- com32/chain/options.c Wed Mar 02 07:06:29 2016 +++ com32/chain/options.c Mon Feb 18 19:19:29 2017 @@ -224,15 +224,9 @@ opt.setbpb = true; opt.hand = false; } else if (!strncmp(argv[i], "reactos=", 8)) { - /* - * settings based on commit - * ad4cf1470977f648ee1dd45e97939589ccb0393c - * note, conflicts with: - * http://reactos.freedoors.org/Reactos%200.3.13/ReactOS-0.3.13-REL-src/boot/freeldr/notes.txt - */ - opt.fseg = 0; - opt.foff = 0x8000; - opt.fip = 0x8100; + opt.fseg = 0x0F80; + opt.foff = 0; + opt.fip = 0; opt.file = argv[i] + 8; opt.setbpb = true; opt.hand = false; diff U3 doc/chain.txt doc/chain.txt --- doc/chain.txt Wed Mar 02 07:06:02 2016 +++ doc/chain.txt Mon Feb 18 18:45:10 2017 @@ -296,7 +296,7 @@ patched with "cmdcons\0". Remarks the same as in 'ntldr='. reactos=<file> - sets: file=<file> seg=0:0x8000:0x8100 setbpb nohand + sets: file=<file> seg=0x0F80 setbpb nohand Prepares to load ReactOS's freeldr directly. You might want to add 'save' option to store corrected BPB values. --
Gene Cumm
2017-Feb-23 18:00 UTC
[syslinux] [PATCH] Correct chain.c32 v. 6.04-pre1 for Reactos
On Mon, Feb 20, 2017 at 2:17 PM, Ady Ady via Syslinux <syslinux at zytor.com> wrote:> Correct the "seg=" value(s) corresponding to the "reactos=" option > for chain.c32. > > The correct segment parameter should be "seg=0x0F80", > instead of the incorrect / failing ones "seg=0:0x8000:0x8100". > > References: > https://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/notes.txt?revision=73859&view=markup&pathrev=73859#l24 > > https://git.reactos.org/?p=reactos.git;a=blob;f=reactos/boot/freeldr/notes.txt;hb=HEAD > > https://git.reactos.org/?p=reactos.git&a=search&h=HEAD&st=grep&s=FREELDR_BASE > > https://git.reactos.org/?p=reactos.git;a=blob;f=reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h;h=c747d145cb3b35f68caab5291dc65dcdca21f17d;hb=HEAD#l17 > > https://git.reactos.org/?p=reactos.git;a=blob;f=reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h;hb=HEAD > > At the time of writing this patch, the up-to-date bootsectors referring to > the above 'define' ("FREELDR_BASE") have a filename extension ending with ".S". > > There is also "multiboot.S", FWIW. > > Regards, > Ady.It's a bit more complex. At the time of writing, the data was perfect. https://git.reactos.org/?p=reactos.git;a=blob;f=reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h;hb=28e58e6d01892c1f2f0e1d323745e6463cb9e6c9 dated 2011-06-14 https://git.reactos.org/?p=reactos.git;a=blob;f=reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h;hb=1dabbdfa6bbe244cd74bc912b94e514b85d63bbe https://git.reactos.org/?p=reactos.git;a=blob;f=reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h;hb=0eb6daaf66127de803d36d45a4eea29d30a7ca36 dated 2011-06-18 finalized the shuffle.> diff U3 com32/chain/options.c com32/chain/options.c > --- com32/chain/options.c Wed Mar 02 07:06:29 2016 > +++ com32/chain/options.c Mon Feb 18 19:19:29 2017 > @@ -224,15 +224,9 @@ > opt.setbpb = true; > opt.hand = false; > } else if (!strncmp(argv[i], "reactos=", 8)) { > - /* > - * settings based on commit > - * ad4cf1470977f648ee1dd45e97939589ccb0393c > - * note, conflicts with: > - * http://reactos.freedoors.org/Reactos%200.3.13/ReactOS-0.3.13-REL-src/boot/freeldr/notes.txt > - */ > - opt.fseg = 0; > - opt.foff = 0x8000; > - opt.fip = 0x8100; > + opt.fseg = 0x0F80; > + opt.foff = 0; > + opt.fip = 0; > opt.file = argv[i] + 8; > opt.setbpb = true; > opt.hand = false; > diff U3 doc/chain.txt doc/chain.txt > --- doc/chain.txt Wed Mar 02 07:06:02 2016 > +++ doc/chain.txt Mon Feb 18 18:45:10 2017 > @@ -296,7 +296,7 @@ > patched with "cmdcons\0". Remarks the same as in 'ntldr='. > > reactos=<file> > - sets: file=<file> seg=0:0x8000:0x8100 setbpb nohand > + sets: file=<file> seg=0x0F80 setbpb nohand > > Prepares to load ReactOS's freeldr directly. You might want to add 'save' > option to store corrected BPB values.This should have been put in place years ago by the looks but it's going to need a big glaring warning in the release notes. -- -Gene
Ady Ady
2017-Feb-23 19:22 UTC
[syslinux] [PATCH] Correct chain.c32 v. 6.04-pre1 for Reactos
> On Mon, Feb 20, 2017 at 2:17 PM, Ady Ady via Syslinux > <syslinux at zytor.com> wrote: > > Correct the "seg=" value(s) corresponding to the "reactos=" option > > for chain.c32. > > > > The correct segment parameter should be "seg=0x0F80", > > instead of the incorrect / failing ones "seg=0:0x8000:0x8100". > > > > References: > > https://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/notes.txt?revision=73859&view=markup&pathrev=73859#l24 > > > > https://git.reactos.org/?p=reactos.git;a=blob;f=reactos/boot/freeldr/notes.txt;hb=HEAD > > > > https://git.reactos.org/?p=reactos.git&a=search&h=HEAD&st=grep&s=FREELDR_BASE > > > > https://git.reactos.org/?p=reactos.git;a=blob;f=reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h;h=c747d145cb3b35f68caab5291dc65dcdca21f17d;hb=HEAD#l17 > > > > https://git.reactos.org/?p=reactos.git;a=blob;f=reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h;hb=HEAD > > > > At the time of writing this patch, the up-to-date bootsectors referring to > > the above 'define' ("FREELDR_BASE") have a filename extension ending with ".S". > > > > There is also "multiboot.S", FWIW. > > > > Regards, > > Ady. > > It's a bit more complex. At the time of writing, the data was perfect. > > https://git.reactos.org/?p=reactos.git;a=blob;f=reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h;hb=28e58e6d01892c1f2f0e1d323745e6463cb9e6c9 > dated 2011-06-14 > > https://git.reactos.org/?p=reactos.git;a=blob;f=reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h;hb=1dabbdfa6bbe244cd74bc912b94e514b85d63bbe > > https://git.reactos.org/?p=reactos.git;a=blob;f=reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h;hb=0eb6daaf66127de803d36d45a4eea29d30a7ca36 > dated 2011-06-18 finalized the shuffle. >Regarding the patch for chain.c32 (which is what it matters here now), I don't see complexity, nor the need to "extra" emphasize the change in the Syslinux changelog (see the end of this email). Regarding prior versions of chain.c32, the "reactos=file" option never worked, as the assumed values for the corresponding "seg=" option were never _effectively_ correct (independently of what Reactos' source code seemingly said circa 2010-2011). In part, this can be seen in the (prior) source code itself (see "options.c" for the "chain" module), which mentions a conflicting information regarding adequate "seg=" values. The effect is that, for prior Syslinux versions, the "reactos=file" option for chain.c32 should be considered invalid (or non-existent). It is only unfortunate that the "reactos=file" option was publicly announced years ago without having a more clear and stable information from the part of Reactos (and relevant testing), but that's history now. The incorrect behavior of the "reactos=file" option (generated by inadequate segment values) has been reported in the past, several times by diverse channels. This patch corrects the "seg=" values for Reactos. The correct "seg=" values for the "reactos=file" option have been confirmed by developers of Reactos and also successfully tested using VMs. In the same way(s), the prior (incorrect) "seg=" values have been also confirmed to fail. Please keep in mind that this patch corrects the usage of the "reactos=file" option for SYSLINUX, but it is not enough for PXELINUX, as Reactos needs "keeppxe" (also reported to The Syslinux Project several times by diverse channels), and the latter is not working since Syslinux 5.00 till today. Perhaps the patch for "keeppxe" sent by Adam Goldman during 2016June ( http://www.syslinux.org/archives/2016-June/025216.html "Fix recognition of keeppxe option") might solve that matter (I wouldn't know). (snip)> > This should have been put in place years ago by the looks but it's > going to need a big glaring warning in the release notes. > > -- > -GeneOf course, if my patch is applied to chain.c32, then it should (and will) be part of the next Syslinux changelog, and I already have the item added in my local copy, for a future "NEWS" patch. As soon as I have confirmation of the Syslinux commit, I will also correct the Syslinux wiki for chain.c32 and the changelog wiki page. If the "keeppxe" problem gets to be solved too (to be proven by tests from different users) in the Syslinux official code, I'll also add it to the relevant places. Thank you and Best Regards, Ady.
Ady Ady
2017-Mar-04 08:40 UTC
[syslinux] [PATCH] Update chain.c32 v. 6.04-pre1 for current Reactos
(snip)> > It's a bit more complex. At the time of writing, the data was perfect. > > https://git.reactos.org/?p=reactos.git;a=blob;f=reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h;hb=28e58e6d01892c1f2f0e1d323745e6463cb9e6c9 > dated 2011-06-14 > > https://git.reactos.org/?p=reactos.git;a=blob;f=reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h;hb=1dabbdfa6bbe244cd74bc912b94e514b85d63bbe > > https://git.reactos.org/?p=reactos.git;a=blob;f=reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h;hb=0eb6daaf66127de803d36d45a4eea29d30a7ca36 > dated 2011-06-18 finalized the shuffle. >(snip)> > This should have been put in place years ago by the looks but it's > going to need a big glaring warning in the release notes. > > -- > -Gene* 2009Dec Reactos 0.3.11 - OK * 2010Oct Reactos 0.3.12 - KO * 2011Mar Reactos 0.3.13 - KO * 2011Dec Syslinux 4.05 containing Shao's patch ("freeldr=") * 2012Feb Reactos 0.3.14 - KO * 2012Oct Syslinux 4.06 containing Michal Soltys' patch ("reactos=") * 2013May Reactos 0.3.15 - KO The above OK/KO results are from my own tests using chain.c32. There is always a chance that someone else might get different results. Reactos is "alpha", so the only version of Reactos that its devs support is the "latest" at each time. Older versions of Reactos are not relevant / supported by Reactos' devs. At the time the respective official release binaries were available, Syslinux's chain.c32 has never effectively supported chainloading (the "latest") Reactos with "built-in" options (neither "freeldr=" nor "reactos=", depending on Syslinux's version). Below, I am re-posting my patch (and its comments and title) with a slightly different wording in comparison to the one I posted during 2017Feb. Regards, Ady. Update the "seg=" value(s) corresponding to the "reactos=" option for chain.c32, according to newer/current versions of Reactos. The updated segment parameter should be "seg=0x0F80", instead of the older ones "seg=0:0x8000:0x8100". References: https://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/notes.txt?revision=73859&view=markup&pathrev=73859#l24 https://git.reactos.org/?p=reactos.git;a=blob;f=reactos/boot/freeldr/notes.txt;hb=HEAD https://git.reactos.org/?p=reactos.git&a=search&h=HEAD&st=grep&s=FREELDR_BASE https://git.reactos.org/?p=reactos.git;a=blob;f=reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h;h=c747d145cb3b35f68caab5291dc65dcdca21f17d;hb=HEAD#l17 https://git.reactos.org/?p=reactos.git;a=blob;f=reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h;hb=HEAD At the time of writing this patch, the up-to-date bootsectors referring to the above 'define' ("FREELDR_BASE") have a filename extension ending with ".S". There is also "multiboot.S", FWIW. diff U3 com32/chain/options.c com32/chain/options.c --- com32/chain/options.c Wed Mar 02 07:06:29 2016 +++ com32/chain/options.c Mon Feb 18 19:19:29 2017 @@ -224,15 +224,9 @@ opt.setbpb = true; opt.hand = false; } else if (!strncmp(argv[i], "reactos=", 8)) { - /* - * settings based on commit - * ad4cf1470977f648ee1dd45e97939589ccb0393c - * note, conflicts with: - * http://reactos.freedoors.org/Reactos%200.3.13/ReactOS-0.3.13-REL-src/boot/freeldr/notes.txt - */ - opt.fseg = 0; - opt.foff = 0x8000; - opt.fip = 0x8100; + opt.fseg = 0x0F80; + opt.foff = 0; + opt.fip = 0; opt.file = argv[i] + 8; opt.setbpb = true; opt.hand = false; diff U3 doc/chain.txt doc/chain.txt --- doc/chain.txt Wed Mar 02 07:06:02 2016 +++ doc/chain.txt Mon Feb 18 18:45:10 2017 @@ -296,7 +296,7 @@ patched with "cmdcons\0". Remarks the same as in 'ntldr='. reactos=<file> - sets: file=<file> seg=0:0x8000:0x8100 setbpb nohand + sets: file=<file> seg=0x0F80 setbpb nohand Prepares to load ReactOS's freeldr directly. You might want to add 'save' option to store corrected BPB values. --