Partition table BERT interface ------------------------------ 01B6 = partition rights 01C0 = partition entry 0 01D0 = partition entry 1 01E0 = partition entry 2 01F0 = partition entry 3 Partition Entry --------------- +00 = not used +01 = not used +02 = system byte 1 = DOS 12-bit fat 5 = extended partition (partition start contains sector of next partition table) +06 = LSB partition start/LSB next partition sector +07 = ... +08 = ... +09 = MSB partition start/LSB next partition sector +0A = LSB no of sectors within partition +0B = ... +0C = ... +0D = MSB no of sectors within partition +0E = not used / 0x55 +0F = not used / 0xAA Rights Entry ------------ +00 = Access rights id 0 .. +07 = Access rights id 7 Rights: 0 = all 1 = read 2 = write 3 = none Read of the partition table --------------------------- sector=0; while (sector!=-1) { sector_data=readSector(sector); sector=-1; /* note! i start 2 bytes before the entry! */ index = 0x01BE; while ( sector_data[index+0x00] != 0x55 && sector_data[index+0x01] != 0xAA ) { if (sector_data[index+0x04]==5) { sector = sector_data[index+0x06] + sector_data[index+0x07]<<8 + sector_data[index+0x08]<<16 + sector_data[index+0x09]<<24; } if (sector_data[index+0x04]==1) { start = sector_data[index+0x06] + sector_data[index+0x07]<<8 + sector_data[index+0x08]<<16 + sector_data[index+0x09]<<24; length = sector_data[index+0x0a] + sector_data[index+0x0b]<<8 + sector_data[index+0x0c]<<16 + sector_data[index+0x0d]<<24; addPartition(start,length); } } }