00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef PART_H
00023 #define PART_H
00024
00025 #include "global.h"
00026
00027
00028 #define PART_TYPE_UNKNOWN 0x00
00029 #define PART_TYPE_FAT12 0x01
00030 #define PART_TYPE_XENIX 0x02
00031 #define PART_TYPE_DOSFAT16 0x04
00032 #define PART_TYPE_EXTDOS 0x05
00033 #define PART_TYPE_FAT16 0x06
00034 #define PART_TYPE_NTFS 0x07
00035 #define PART_TYPE_FAT32 0x0B
00036 #define PART_TYPE_FAT32LBA 0x0C
00037 #define PART_TYPE_FAT16LBA 0x0E
00038 #define PART_TYPE_EXTDOSLBA 0x0F
00039 #define PART_TYPE_ONTRACK 0x33
00040 #define PART_TYPE_NOVELL 0x40
00041 #define PART_TYPE_PCIX 0x4B
00042 #define PART_TYPE_PHOENIXSAVE 0xA0
00043 #define PART_TYPE_CPM 0xDB
00044 #define PART_TYPE_DBFS 0xE0
00045 #define PART_TYPE_BBT 0xFF
00046
00047
00048 struct partrecord
00049 {
00050 BYTE prIsActive;
00051 BYTE prStartHead;
00052 WORD prStartCylSect;
00053 BYTE prPartType;
00054 BYTE prEndHead;
00055 WORD prEndCylSect;
00056 DWORD prStartLBA;
00057 DWORD prSize;
00058 } GNUC_PACKED;
00059
00060 struct partsector
00061 {
00062 CHAR psPartCode[512-64-2];
00063 struct partrecord psPartition[4];
00064 BYTE psBootSectSig0;
00065 BYTE psBootSectSig1;
00066 } GNUC_PACKED;
00067
00068 struct partsector_byte
00069 {
00070 CHAR psPartCode[512-64-2];
00071 BYTE psPart[64];
00072 BYTE psBootSectSig0;
00073 BYTE psBootSectSig1;
00074 } GNUC_PACKED;
00075
00076 #define PART_BOOTSIG0 0x55
00077 #define PART_BOOTSIG1 0xaa
00078
00079
00080 struct PartInfo
00081 {
00082 DiskInfo_t disk;
00083 DevDisk_t dev;
00084 unsigned long start;
00085 unsigned long sizeinsectors;
00086
00087 } GNUC_PACKED;
00088
00089 typedef struct PartInfo PartInfo_t;
00090
00091 extern PartInfo_t PartInfo;
00092
00093
00094 int partInit(DiskInfo_t* disk);
00095
00096 void partPrintEntry(struct partrecord *partition);
00097 void partPrintTable(struct partsector *buffer);
00098
00099 int partReadSector(unsigned long sector, int numsectors, u08* buffer);
00100 int partWriteSector(unsigned long sector, int numsectors, u08* buffer);
00101
00102 #endif