Chameleon

Chameleon Commit Details

Date:2011-06-26 23:34:51 (8 years 21 days ago)
Author:Evan Lojewski
Commit:1091
Parents: 1090
Message:Initial FDisk Partiton scheme implimentation.
Changes:
M/branches/rewrite/i386/modules/Disk/include/FDiskPartition.hpp
M/branches/rewrite/i386/modules/Disk/FDiskPartition.cpp

File differences

branches/rewrite/i386/modules/Disk/include/FDiskPartition.hpp
1616
1717
1818
19
20
21
22
1923
2024
2125
~FDiskPartition();
protected:
bool isMBRDisk();
struct disk_blk0 mLBA0;
struct fdisk_part* mFdiskEntry;
private:
};
branches/rewrite/i386/modules/Disk/FDiskPartition.cpp
44
55
66
7
7
88
99
1010
......
1212
1313
1414
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
1543
1644
1745
1846
47
48
1949
20
50
51
52
53
*/
#include <FDiskPartition.hpp>
FDiskPartition::FDiskPartition(Disk* disk, UInt8 partitionNumber) : Partition(disk, partitionNumber)
{
mDisk = disk;
mBeginSector = 0;
mPartitionNumber = partitionNumber;
mNumPartitions = 0;
mFdiskEntry = NULL;
if(mDisk)
{
// read in lba0, this contains the partition map if it's FDisk / MBR
mDisk->Read(0, 1, (UInt8*)&mLBA0);
if(isMBRDisk())
{
// Determine number of partition. TODO: Extended partitions
UInt8 i = 0;
for(i = 0; i < DISK_NPART; i++)
{
if(mLBA0.parts[i].systid != 0)
{
if(mPartitionNumber == mNumPartitions) mFdiskEntry = &mLBA0.parts[i];
mNumPartitions++;
}
}
if(mFdiskEntry)
{
mNumSectors = mFdiskEntry->numsect;
mBeginSector = mFdiskEntry->relsect;
}
}
}
}
FDiskPartition::~FDiskPartition()
{
}
}
bool FDiskPartition::isMBRDisk()
{
return mLBA0.signature == DISK_SIGNATURE;
}

Archive Download the corresponding diff file

Revision: 1091