General Info

Interface: DiskPartition
Files: diskpartition.h
Last change: 21/03/2004
Author: Luiz Henrique Shigunov
System Functions

0x00 - Read - Read disk partitions


This page describes the DiskPartition interface which provides services to access disk partitions.


typedef struct {
    unsigned int startBlock;
    unsigned int nBlocks;
    unsigned short id;
    unsigned short flags;
} DiskPartition_Partition;

Where startBlock is the number of the partition start block, nBlocks the number of blocks in the partition, id the partition type ID (Linux, FAT, etc) and flags is the OR (0x01 | 0x08, for example) of the following:

typedef struct {
    unsigned int nParts;
    DiskPartition_Partition parts[1];
} DiskPartition_Description;

Where nParts is the number of partitions and parts the array of partitions.

System Functions

These functions are exclusive for system modules.

0x00 - Read


int DiskPartition_Read(SysModManager_Imp *imp, unsigned int unit, DiskPartition_Description *desc, unsigned int descSize, unsigned int partSize);



This function reads the partitions of unit from imp, which must be the implementation of the BlockDev interface, into desc which is descSize bytes long.

partSize must be the size of DiskPartition_Partition and is used to know which structure version to use when other versions are created.

Return value