summaryrefslogtreecommitdiff
path: root/mbr.h
diff options
context:
space:
mode:
authorsrs5694 <srs5694@users.sourceforge.net>2010-03-07 22:16:07 -0500
committersrs5694 <srs5694@users.sourceforge.net>2010-03-07 22:16:07 -0500
commit55d926192adc984462509b2966e23bc0d1129bbd (patch)
treebff8bea805e3fb0e15f7f3a0cd26a20fa12c5f29 /mbr.h
parentea17cffd083c839b7af3560d55ba697667277901 (diff)
downloadsgdisk-55d926192adc984462509b2966e23bc0d1129bbd.tar.gz
Updated project files for 0.6.5 release version.
Diffstat (limited to 'mbr.h')
-rw-r--r--mbr.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/mbr.h b/mbr.h
index 01cabcb..1e838a6 100644
--- a/mbr.h
+++ b/mbr.h
@@ -6,6 +6,7 @@
#include <stdint.h>
#include <sys/types.h>
#include "gptpart.h"
+#include "partnotes.h"
#include "diskio.h"
#ifndef __MBRSTRUCTS
@@ -21,6 +22,8 @@
using namespace std;
+class PartNotes;
+
/****************************************
* *
* MBRData class and related structures *
@@ -30,13 +33,17 @@ using namespace std;
// Data for a single MBR partition record
// Note that firstSector and lastSector are in CHS addressing, which
// splits the bits up in a weird way.
+// On read or write of MBR entries, firstLBA is an absolute disk sector.
+// On read of logical entries, it's relative to the EBR record for that
+// partition. When writing EBR records, it's relative to the extended
+// partition's start.
#pragma pack(1)
struct MBRRecord {
uint8_t status;
uint8_t firstSector[3];
uint8_t partitionType;
uint8_t lastSector[3];
- uint32_t firstLBA;
+ uint32_t firstLBA; // see above
uint32_t lengthLBA;
}; // struct MBRRecord
@@ -90,9 +97,11 @@ public:
int WriteMBRData(void);
int WriteMBRData(DiskIO *theDisk);
int WriteMBRData(const string & deviceFilename);
+ int WriteMBRData(struct TempMBR & mbr, DiskIO *theDisk, uint64_t sector);
+ void SetDisk(DiskIO *theDisk) {myDisk = theDisk; canDeleteMyDisk = 0;}
// Display data for user...
- void DisplayMBRData(void);
+ void DisplayMBRData(int maxParts = 4);
void ShowState(void);
// Functions that set or get disk metadata (size, CHS geometry, etc.)
@@ -115,6 +124,7 @@ public:
void DeletePartition(int i);
int DeleteByLocation(uint64_t start64, uint64_t length64);
void OptimizeEESize(void);
+ int CreateLogicals(PartNotes& notes);
// Functions to find information on free space....
uint32_t FindFirstAvailable(uint32_t start = 1);