[syslinux] can't get write_sectors to work...

Robert Jordan rjordan at notampering.com
Sun Sep 19 21:23:02 PDT 2010


Thanks for the patch Pierre.  Unfortunately it doesn't seem to have changed
the behavior at all.  If you have any other ideas let me know.  Meanwhile
I'll see if I can figure anything out on my own.

Thanks,
Robert

On Sun, Sep 19, 2010 at 6:25 PM, Pierre-Alexandre Meyer
<pierre at mouraf.org>wrote:

> On Sun, Sep 19, 2010 at 4:39 PM, Robert Jordan <rjordan at notampering.com>wrote:
>
>> Hi,
>>
>
> Hello Robert,
>
> When run, the error case is always executed, but disk_errno is always zero.
>>  If I switch to write_sectors() the call succeeds (returns the same number
>> of sectors requested), but the disk is not written.  I can't find any
>> examples of using the disk write functions anywhere in the code.
>
>
> disk.c was basically a functional test for the new disklib library. The
> write_* functions, originally written in chain.c, were extracted. Plan was
> to rewrite chain.c with this library but this was never done, this is the
> reason no code is using these functions (the read_* ones are used by HDT
> though).
>
>
>>  Any suggestions would be appreciated.
>>
>
> If write_verify_sectors fails and doesn't set errno, it means that the
> verify part failed (as expected since the disk is not written).
>
> Could you try the following patch?
>
> diff --git a/com32/gpllib/disk/write.c b/com32/gpllib/disk/write.c
> index 89e530d..4ed612a 100644
> --- a/com32/gpllib/disk/write.c
> +++ b/com32/gpllib/disk/write.c
> @@ -39,7 +39,7 @@ int write_sectors(const struct driveinfo *drive_info,
> const unsigned int lba,
>      struct ebios_dapa *dapa = __com32.cs_bounce;
>      void *buf = (char *)__com32.cs_bounce + size;
>
> -    memcpy(buf, data, size);
> +    memcpy(buf, data, SECTOR * size);
>      memset(&inreg, 0, sizeof inreg);
>
>      if (drive_info->ebios) {
>
>
> Thanks,
>
> --
> Pierre-Alexandre Meyer
> http://pub.mouraf.org/blog
>
>



More information about the Syslinux mailing list