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

Robert Jordan rjordan at notampering.com
Mon Sep 20 10:40:10 PDT 2010


On Mon, Sep 20, 2010 at 6:27 AM, Pierre-Alexandre Meyer
<pierre at mouraf.org>wrote:

> On Sun, Sep 19, 2010 at 9:23 PM, Robert Jordan <rjordan at notampering.com>wrote:
>
>> 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.
>
>
> Sorry, I've sent you a half-cooked patch:
>
> diff --git a/com32/gpllib/disk/write.c b/com32/gpllib/disk/write.c
> index 89e530d..b1b12e0 100644
> --- a/com32/gpllib/disk/write.c
> +++ b/com32/gpllib/disk/write.c
> @@ -37,9 +37,9 @@ int write_sectors(const struct driveinfo *drive_info,
> const unsigned int lba,
>  {
>      com32sys_t inreg, outreg;
>      struct ebios_dapa *dapa = __com32.cs_bounce;
> -    void *buf = (char *)__com32.cs_bounce + size;
> +    void *buf = (char *)__com32.cs_bounce + SECTOR * size;
>
> -    memcpy(buf, data, size);
> +    memcpy(buf, data, SECTOR * size);
>      memset(&inreg, 0, sizeof inreg);
>
>      if (drive_info->ebios) {
> @@ -97,7 +97,7 @@ int write_sectors(const struct driveinfo *drive_info,
> const unsigned int lba,
>  int write_verify_sector(struct driveinfo *drive_info,
>                         const unsigned int lba, const void *data)
>  {
> -    return write_verify_sectors(drive_info, lba, data, SECTOR);
> +    return write_verify_sectors(drive_info, lba, data, 1);
>  }
>
>  /**
>
>
>
>> Meanwhile I'll see if I can figure anything out on my own.
>>
>
> I'll try to reproduce it here as well.
>
> Thanks,
>
> --
> Pierre-Alexandre Meyer
> http://pub.mouraf.org/blog
>


Hi Pierre,

Using this patch write_verify_sector now succeeds, but the disk still does
not seem to be written.  For example if I write a new boot sector and reboot
the system the old boot sector is still intact.  Could there be a cache that
needs to be flushed?  I looked at the int 13h documentation and there are
several cache functions, but they all seem to be proprietary and deprecated.



More information about the Syslinux mailing list