+ if( start > 0 && size > 0 )
+ {
+ READ_DWORD(&data[8], start);
+ end = start + size - 1;
+
+#ifdef DEBUG
+ diag_printf("Using LBA partition parameters\n");
+ diag_printf(" LBA start %d\n",start);
+ diag_printf(" LBA size %d\n",size);
+ diag_printf(" LBA end %d\n",end);
+#endif
+
+ }
+ else
+ {
+ READ_CHS(&data[1], c, h, s);
+ CHS_TO_LBA(ident, c, h, s, start);
+#ifdef DEBUG
+ diag_printf("Using CHS partition parameters\n");
+ diag_printf(" CHS start %d/%d/%d => %d\n",c,h,s,start);
+#endif
+
+ READ_CHS(&data[5], c, h, s);
+ CHS_TO_LBA(ident, c, h, s, end);
+#ifdef DEBUG
+ diag_printf(" CHS end %d/%d/%d => %d\n",c,h,s,end);
+ diag_printf(" CHS size %d\n",size);
+#endif
+
+ }
+
+ part->size = size;
+ part->start = start;
+ part->end = end;