+ // Booting from a CD with an UFS filesystem embedded
+ // in a booter partition.
+
+ if ( booterUFS )
+ {
+ if ( map->bvrcnt == 0 )
+ {
+ map->bvr = booterUFS;
+ map->bvrcnt++;
+ }
+ else free( booterUFS );
+ }
+ }
+ } while (0);
+
+ if (countPtr) *countPtr = map ? map->bvrcnt : 0;
+
+ return map ? map->bvr : NULL;
+}
+
+//==========================================================================
+
+static const struct NamedValue fdiskTypes[] =
+{
+ { 0x07, "Windows NTFS" },
+ { 0x0c, "Windows FAT32" },
+ { 0x83, "Linux" },
+ { FDISK_UFS, "Apple UFS" },
+ { FDISK_HFS, "Apple HFS" },
+ { FDISK_BOOTER, "Apple Boot/UFS" },
+ { 0x00, 0 } /* must be last */
+};
+
+static void getVolumeDescription( BVRef bvr, char * str, long strMaxLen )
+{
+ unsigned char type = (unsigned char) bvr->part_type;
+ const char * name = getNameForValue( fdiskTypes, type );
+
+ if ( name )
+ sprintf( str, "hd(%d,%d) %s",
+ BIOS_DEV_UNIT(bvr->biosdev), bvr->part_no, name );
+ else
+ sprintf( str, "hd(%d,%d) TYPE %02x",
+ BIOS_DEV_UNIT(bvr->biosdev), bvr->part_no, type );
+}
+
+//==========================================================================
+
+int readBootSector( int biosdev, unsigned int secno, void * buffer )
+{
+ struct disk_blk0 * bootSector = (struct disk_blk0 *) buffer;
+ int error;
+
+ if ( bootSector == NULL )
+ {
+ if ( gBootSector == NULL )
+ {
+ gBootSector = (struct disk_blk0 *) malloc(sizeof(*gBootSector));
+ if ( gBootSector == NULL ) return -1;