From 11b3c08b53320c274fe3b1b665618f0fb7180d5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Thu, 18 Sep 2008 09:22:06 +0000 Subject: [PATCH] More comments about things that got me confused. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27616 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../intel/PartitionMapWriter.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/add-ons/kernel/partitioning_systems/intel/PartitionMapWriter.cpp b/src/add-ons/kernel/partitioning_systems/intel/PartitionMapWriter.cpp index b488f87722..db69c1d332 100644 --- a/src/add-ons/kernel/partitioning_systems/intel/PartitionMapWriter.cpp +++ b/src/add-ons/kernel/partitioning_systems/intel/PartitionMapWriter.cpp @@ -199,6 +199,7 @@ PartitionMapWriter::_WritePrimary(partition_table_sector* pts) } partition->GetPartitionDescriptor(descriptor, 0); + // TODO: Should this be fSessionOffset?! } return B_OK; @@ -226,8 +227,9 @@ PartitionMapWriter::_WriteExtended(partition_table_sector *pts, } // write the table - partition_descriptor *descriptor = &(pts->table[0]); + partition_descriptor* descriptor = &(pts->table[0]); partition->GetPartitionDescriptor(descriptor, partition->PTSOffset()); + // location is relative to this partitions PTS offset // setting offset and size of the next partition in the linked list descriptor = &(pts->table[1]); @@ -236,13 +238,20 @@ PartitionMapWriter::_WriteExtended(partition_table_sector *pts, extended.SetPTSOffset(partition->PTSOffset()); extended.SetOffset(next->PTSOffset()); extended.SetSize(next->Size() + next->Offset() - next->PTSOffset()); + // TODO: The size calculation looks suspicious. + // Isn't next->Offset() relative to primary extended patition while + // next->PTSOffset() is not? extended.SetType(partition->GetPrimaryPartition()->Type()); + // TODO: Weird. + extended.GetPartitionDescriptor(descriptor, 0); + + // Unsetting to get an empty descriptor for the remaining slots. extended.Unset(); } else extended.GetPartitionDescriptor(descriptor, 0); - // last two descriptors are empty + // last two descriptors are empty ("extended" is unset) for (int32 i = 2; i < 4; i++) { descriptor = &(pts->table[i]); extended.GetPartitionDescriptor(descriptor, 0);