diff -r -u5 -N -x CVS ecos_orig/packages/io/disk/current/ChangeLog ecos_dev/packages/io/disk/current/ChangeLog
--- ecos_orig/packages/io/disk/current/ChangeLog	2005-12-02 20:03:30.000000000 +0000
+++ ecos_dev/packages/io/disk/current/ChangeLog	2006-08-19 13:13:32.328125000 +0100
@@ -1,5 +1,11 @@
+2006-08-18  Andy Jackson  <andy@xylanta.com>
+
+	* cdl/io_disk.cdl:
+	* src/disk.c: Made debugging CDL controlled. Added support to
+	allow non-CHS disk devices to use LBA information in MBR.
+
 2005-12-02  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* src/disk.c: Add comments that bread/bwrite take the position and
 	len in terms of blocks, not bytes.
 
diff -r -u5 -N -x CVS ecos_orig/packages/io/disk/current/cdl/io_disk.cdl ecos_dev/packages/io/disk/current/cdl/io_disk.cdl
--- ecos_orig/packages/io/disk/current/cdl/io_disk.cdl	2004-01-19 14:35:04.000000000 +0000
+++ ecos_dev/packages/io/disk/current/cdl/io_disk.cdl	2006-08-17 09:15:32.968750000 +0100
@@ -77,10 +77,19 @@
         description   "
             This option enables the hardware disk drivers
 	        for the current platform."
     }
 
+    cdl_component CYGDBG_IO_DISK_DEBUG {
+        display       "Enable debugging output"
+        flavor        bool
+        default_value 0
+        description   "
+            This option enables debugging information from
+	        the disk driver package."
+    }
+
     cdl_component CYGPKG_IO_DISK_OPTIONS {
         display "Disk device driver build options"
         flavor  none
         description   "
 	        Package specific build options including control over
diff -r -u5 -N -x CVS ecos_orig/packages/io/disk/current/src/disk.c ecos_dev/packages/io/disk/current/src/disk.c
--- ecos_orig/packages/io/disk/current/src/disk.c	2005-12-02 20:03:30.000000000 +0000
+++ ecos_dev/packages/io/disk/current/src/disk.c	2006-08-19 11:12:14.609375000 +0100
@@ -56,11 +56,13 @@
 #include <cyg/infra/cyg_ass.h>      // assertion support
 #include <cyg/infra/diag.h>         // diagnostic output
 
 // ---------------------------------------------------------------------------
 
-//#define DEBUG 1
+#ifdef CYGDBG_IO_DISK_DEBUG
+#define DEBUG 1
+#endif
 
 #ifdef DEBUG
 # define D(_args_) diag_printf _args_
 #else
 # define D(_args_)
@@ -158,22 +160,39 @@
 static void 
 read_partition(cyg_uint8            *data,
                cyg_disk_info_t      *info,
                cyg_disk_partition_t *part)
 {
+    cyg_disk_identify_t *ident = &info->ident;
     cyg_uint16 c, h, s;
 
+    // Retrieve basic information
     part->type  = data[4];
     part->state = data[0];
-
-    READ_CHS(&data[1], c, h, s);
-    CHS_TO_LBA(&info->ident, c, h, s, part->start);
-
-    READ_CHS(&data[5], c, h, s);
-    CHS_TO_LBA(&info->ident, c, h, s, part->end);
-    
     READ_DWORD(&data[12], part->size);
+
+    // If disk doesn't have cylinders/heads, use LBA data rather than CHS
+    if (ident->cylinders_num == 0 && ident->heads_num == 0 &&
+                                                    ident->sectors_num== 0)
+    {
+        // Use LBA data to determine disk size
+        READ_DWORD(&data[8], part->start);
+        part->end = (part->start + part->size) - 1;
+        D(("LBA partition data (%d,%d,%d)\n", part->start, part->end, part->size));
+    }
+    else
+    {
+        // Use CHS data to determine disk size
+        READ_CHS(&data[1], c, h, s);
+        D(("partition start CHS %d,%d,%d\n", c, h, s));
+        CHS_TO_LBA(ident, c, h, s, part->start);
+
+        READ_CHS(&data[5], c, h, s);
+        D(("partition end CHS %d,%d,%d\n", c, h, s));
+        CHS_TO_LBA(ident, c, h, s, part->end);
+        D(("CHS partition data (%d,%d,%d)\n", part->start, part->end, part->size));
+    }
 }
 
 //
 // Read Master Boot Record (partitions)
 //
