Ticket #6301: intel-partitioning-system-unused-chs.diff

File intel-partitioning-system-unused-chs.diff, 1.6 KB (added by bonefish, 14 years ago)

patch for setting CHS to 0xffffff as suggested

  • src/add-ons/kernel/partitioning_systems/intel/PartitionMap.cpp

     
    500500        descriptor->size = Size() / BlockSize();
    501501        descriptor->type = Type();
    502502        descriptor->active = Active() ? 0x80 : 0x00;
    503         descriptor->begin.Unset();
    504         descriptor->end.Unset();
     503        descriptor->begin.SetUnused();
     504        descriptor->end.SetUnused();
    505505    }
    506506}
    507507
     
    654654
    655655    descriptor->size = Size() / BlockSize();
    656656    descriptor->active = 0x00;
    657     descriptor->begin.Unset();
    658     descriptor->end.Unset();
     657    descriptor->begin.SetUnused();
     658    descriptor->end.SetUnused();
    659659}
    660660
    661661
  • src/add-ons/kernel/partitioning_systems/intel/PartitionMap.h

     
    5252void get_partition_type_string(uint8 type, char* buffer);
    5353
    5454// chs
    55 // NOTE: The CHS cannot express locations within larger disks and is therefor
     55// NOTE: The CHS cannot express locations within larger disks and is therefore
    5656// mostly obsolete.
    5757struct chs {
    5858    uint8   cylinder;
    5959    uint16  head_sector;    // head[15:10], sector[9:0]
    60     void Unset() { cylinder = 0; head_sector = 0; }
     60    void SetUnused()    { cylinder = 0xff; head_sector = 0xffff; }
     61    void Unset()        { cylinder = 0; head_sector = 0; }
    6162} _PACKED;
    6263
    6364// partition_descriptor