Root/
Source at commit 1164 created 13 years 12 days ago. By azimutz, Add some pauses to nvidia.c and ati.c to help user feedback collection. | |
---|---|
1 | /*␊ |
2 | * Copyright (c) 2011 Evan Lojewski. All rights reserved.␊ |
3 | *␊ |
4 | */␊ |
5 | #include <FDiskPartition.hpp>␊ |
6 | ␊ |
7 | ␊ |
8 | FDiskPartition::FDiskPartition(Disk* disk, UInt8 partitionNumber) : Partition(disk, partitionNumber)␊ |
9 | {␊ |
10 | mDisk = disk;␊ |
11 | mNumSectors = 0;␊ |
12 | mBeginSector = 0;␊ |
13 | mPartitionNumber = partitionNumber;␊ |
14 | mNumPartitions = 0;␊ |
15 | mFdiskEntry = NULL;␊ |
16 | ␊ |
17 | if(mDisk)␊ |
18 | {␊ |
19 | // read in lba0, this contains the partition map if it's FDisk / MBR␊ |
20 | mDisk->Read(0, 1, (UInt8*)&mLBA0);␊ |
21 | ␊ |
22 | if(isMBRDisk())␊ |
23 | {␊ |
24 | // Determine number of partition. TODO: Extended partitions␊ |
25 | UInt8 i = 0;␊ |
26 | for(i = 0; i < DISK_NPART; i++)␊ |
27 | {␊ |
28 | if(mLBA0.parts[i].systid != 0)␊ |
29 | {␊ |
30 | if(mPartitionNumber == mNumPartitions) mFdiskEntry = &mLBA0.parts[i];␊ |
31 | mNumPartitions++;␊ |
32 | }␊ |
33 | ␊ |
34 | }␊ |
35 | ␊ |
36 | if(mFdiskEntry)␊ |
37 | {␊ |
38 | mNumSectors = mFdiskEntry->numsect;␊ |
39 | mBeginSector = mFdiskEntry->relsect;␊ |
40 | }␊ |
41 | }␊ |
42 | } ␊ |
43 | }␊ |
44 | ␊ |
45 | FDiskPartition::~FDiskPartition()␊ |
46 | {␊ |
47 | ␊ |
48 | }␊ |
49 | ␊ |
50 | bool FDiskPartition::isMBRDisk()␊ |
51 | {␊ |
52 | return mLBA0.signature == DISK_SIGNATURE;␊ |
53 | }␊ |
54 |