Ignore:
Timestamp:
Aug 9, 2013, 12:17:15 AM (12 years ago)
Author:
David Azarewicz
Message:

Added a check for bad geometries reported by the BIOS and fix them.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/os2ahci/trace.c

    r166 r169  
    226226      ai->bios_config[HOST_VERSION / sizeof(u32)]);
    227227
    228     for (p = 0; p <= ai->port_max; p++) {
     228    for (p = 0; p < ai->hw_ports; p++) {
    229229      P_INFO *pi = &ai->ports[p];
    230230
     
    232232
    233233      for (d = 0; d <= pi->dev_max; d++) {
    234         if (!pi->devs[d].present) continue;
    235 
    236         ntprintf("    Drive %d:", d);
    237         if (pi->devs[d].atapi) ntprintf(" atapi");
    238         if (pi->devs[d].removable) ntprintf(" removable");
    239         if (pi->devs[d].dev_info.Method != NULL)
    240           ntprintf(" %d cylinders, %d heads, %d sectors per track (%ldMB) (%s)",
    241             pi->devs[d].dev_info.Cylinders, pi->devs[d].dev_info.HeadsPerCylinder, pi->devs[d].dev_info.SectorsPerTrack,
    242             pi->devs[d].dev_info.TotalSectors/2048, pi->devs[d].dev_info.Method);
    243         ntprintf("\n");
    244       }
    245     }
    246   }
    247 }
    248 
     234        if (!pi->devs[d].present) {
     235          ntprintf("    No drive present\n");
     236        } else {
     237          ntprintf("    Drive %d:", d);
     238          if (pi->devs[d].atapi) ntprintf(" atapi");
     239          if (pi->devs[d].removable) ntprintf(" removable");
     240          if (pi->devs[d].dev_info.Method != NULL) {
     241            ntprintf(" %ld cylinders, %d heads, %d sectors per track (%ldMB) (%s)",
     242              (u32)pi->devs[d].dev_info.Cylinders, pi->devs[d].dev_info.HeadsPerCylinder, pi->devs[d].dev_info.SectorsPerTrack,
     243              pi->devs[d].dev_info.TotalSectors/2048, pi->devs[d].dev_info.Method);
     244          } else ntprintf(" Drive present but no information available. Not queried by OS.");
     245          ntprintf("\n");
     246        } /* if */
     247      } /* for d */
     248    } /* for p */
     249  } /* for a */
     250}
     251
Note: See TracChangeset for help on using the changeset viewer.