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

Pierre-Alexandre Meyer pierre at mouraf.org
Sun Sep 19 18:25:25 PDT 2010


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