21 #include "Partition.h" 22 #include "pedigree/kernel/Log.h" 23 #include "pedigree/kernel/machine/Disk.h" 24 #include "pedigree/kernel/processor/types.h" 25 #include "pedigree/kernel/utilities/String.h" 26 #include "pedigree/kernel/utilities/utility.h" 30 bool appleProbeDisk(
Disk *pDisk)
34 if ((buff = pDisk->
read(512ULL)) == 0)
36 WARNING(
"Disk read failure during Apple partition table search.");
46 if (pMap->pmSig != BIG_TO_HOST16(APPLE_PM_SIG))
48 NOTICE(
"Apple partition map not found on disk " << diskName);
52 NOTICE(
"Apple partition map found on disk " << diskName);
55 size_t nEntries = BIG_TO_HOST32(pMap->pmMapBlkCnt);
56 for (
size_t i = 0; i < nEntries; i++)
61 if ((buff = pDisk->
read(512ULL + i * 512ULL)) == 0)
64 "Disk read failure during partition table recognition.");
71 "Detected partition '" << pMap->pmPartName <<
"', type '" 72 << pMap->pmParType <<
"'");
77 static_cast<uint64_t>(BIG_TO_HOST32(pMap->pmPyPartStart)) * 512ULL,
78 static_cast<uint64_t>(BIG_TO_HOST32(pMap->pmPartBlkCnt)) * 512ULL);
79 pObj->
setParent(static_cast<Device *>(pDisk));
80 pDisk->
addChild(static_cast<Device *>(pObj));
virtual uintptr_t read(uint64_t location)
void addChild(Device *pDevice)
void setParent(Device *p)
virtual void getName(String &str)