[syslinux] Syslinux-4.03.exe?

Paulo Cezar pcacjr at gmail.com
Mon Oct 10 08:37:13 PDT 2011


Hi Bryan,

On Sun, Oct 9, 2011 at 9:33 AM, <Bryan.James.Krone-EXT at jci.com> wrote:

> syslinux-bounces at zytor.com wrote on 09/01/2011 01:50:56 PM:
>
> > [image removed]
> >
> > Re: [syslinux] Syslinux-4.03.exe?
> >
> > Paulo Cezar
> >
> > to:
> >
> > For discussion of Syslinux and tftp-hpa
> >
> > 09/01/2011 01:53 PM
> >
> > Sent by:
> >
> > syslinux-bounces at zytor.com
> >
> > Please respond to For discussion of Syslinux and tftp-hpa
> >
> > On Thu, Sep 1, 2011 at 3:30 PM, <Bryan.James.Krone-EXT at jci.com> wrote:
> >
> > > I'm using SYSLINUX 4.03 from Linux and setting data in the ADV. I then
> run
> > > "C:\Syslinux-4.03.exe --reset-adv C:\" from Windows and I get this:
> > >
> > > "At least one specified option not yet implemented for this
> installer."
> > >
> > > Is the --reset-adv option not implemented in the Windows version??
> > >
> > >
> > Yes - there are many command-line options that are missing on the
> > Windows installer.
> >
> > I pretend to implement these missing options in the mean time.
> >
> >
> >                       Paulo
> >
> >
>
> Would this work for windows to --reset-adv:
>
>
Apparently yes.


> #include <cstdlib>
> #include <iostream>
>
> int clearAdv();
> int clearAdvInFile(FILE * advFile);
>
> ////
> // Summary: Entry point for the application.. just calls clearAdv
> int main(int argc, char *argv[])
> {
>        return clearAdv();
> }
>
> ////
> // Summary: Opens the ldlinux file and clears the adv sectors out of it.
> int clearAdv()
> {
>        // Open the file that needs to be edited.
>        FILE * advFile = fopen("c:\\ldlinux.sys", "rb+");
>        if(advFile == NULL) return -1;
>
>        // Clear the adv data in the file.
>        int retVal = clearAdvInFile(advFile);
>
>        // Close the file.
>        fclose(advFile);
>        return retVal;
> }
>
> ////
> // Summary: Clears the adv sectors out of the ldlinux file.
> int clearAdvInFile(FILE * advFile)
> {
>        // This is the data that needs to be written to clear the adv
> sector.
>        unsigned char newData[16] = { 0xA5, 0x2F, 0x2D, 0x5A, 0x67, 0x17,
> 0x04, 0xA3,
>                                      0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> 0x00, 0x00 };
>
>        // Seek to 0x7C00 and write the new data.
>        if(fseek(advFile, 0x7c00, 0) != 0)
>                return -2;
>        if(fwrite(&newData, sizeof(newData), 1, advFile) != 1)
>                return -3;
>
>        // Seek to 0x7E00 and write the new data.
>        if(fseek(advFile, 0x7e00, 0) != 0)
>                return -4;
>        if(fwrite(&newData, sizeof(newData), 1, advFile) != 1)
>                return -5;
>
>        // Everything seemed to work. Success.
>        return 0;
> }
> _______________________________________________
> Syslinux mailing list
> Submissions to Syslinux at zytor.com
> Unsubscribe or set options at:
> http://www.zytor.com/mailman/listinfo/syslinux
> Please do not send private replies to mailing list traffic.
>
>
There is an attached patch. You might want to test in and then tell
me if that patch worked there.



                            Paulo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-win-implement-missing-reset-adv-option.patch
Type: text/x-patch
Size: 1699 bytes
Desc: not available
URL: <http://www.zytor.com/pipermail/syslinux/attachments/20111010/01495cf1/attachment.bin>


More information about the Syslinux mailing list