Final Year Project:
Using Linux Filesystems Under Windows
Chris Bryden
BEng. Electronics and Software Engineering
School of Computer Science
University of Birmingham
71
The elements of this structure provide the following
·
=uParts is the total number of partitions found
·
=lpPartTbl is a far pointer to the location in memory of the partition table
The partition table held in memory is made up of a sequence of the
following PARTITION entries, each representing a partition on disk.
As can be seen the partition_nice structure has elements for the disk drive and
partition number, uDisk and uPart. These are in the format of 1 is the 1st HDD
or Partition, 2 the second, etc. The uPartType is the hex value for the partition
type and sPartType is a small string describing the partition. The supported
partition types are shown below:
uPartType
sPartType
Partition Type
0x05
DOSEXT
DOS Extended Partition
0x06
DOS
DOS Primary Partition
0x83
LINUXSWP
Linux Swapfile Partition
0x82
LINUX
Linux filesystem Partition
The ulSize element gives the size of the partition in bytes.
These structures are used to display the partition information to the user,
the implementation is straightforward as the following example shows:
typedef struct partinfo {
unsigned short uParts;
PARTITION far *lpPartTbl;
} PARTINFO;
typedef struct partition_nice {
unsigned uDisk;
unsigned uPart;
unsigned uPartType;
char sPartType[11];
unsigned long ulSize;
} PARTITION;