if(bd->bios_heads == 0 || bd->bios_sectors == 0) return("failed to read disklabel");
bios_getdisklabel(bd, label)	bios_diskinfo_t *bd;	struct disklabel *label;{	daddr_t off = LABELSECTOR;	char *buf;	struct dos_mbr mbr;	int cyl, head, sect;	int error, i;	/* Read MBR */	btochs(DOSBBSECTOR, cyl, head, sect, bd->bios_heads, bd->bios_sectors);	error = biosd_io(F_READ, bd->bios_number, cyl, head, sect, 1, &mbr);	if(error)		return(biosdisk_err(error));	/* check mbr signature */	if (mbr.dmbr_sign != DOSMBR_SIGNATURE)		return("bad MBR signature\n");	/* Search for OpenBSD partition */	for (off = 0, i = 0; off == 0 && i < NDOSPART; i++)		if (mbr.dmbr_parts[i].dp_typ == DOSPTYP_OPENBSD)			off = mbr.dmbr_parts[i].dp_start + LABELSECTOR;	/* just in case */	if (off == 0)		for (off = 0, i = 0; off == 0 && i < NDOSPART; i++)			if (mbr.dmbr_parts[i].dp_typ == DOSPTYP_NETBSD)				off = mbr.dmbr_parts[i].dp_start + LABELSECTOR;	if (off == 0)		return("no BSD partition\n");	/* Load BSD disklabel */	buf = alloca(DEV_BSIZE);#ifdef BIOS_DEBUG	if (debug)		printf("loading disklabel @ %u\n", off);#endif	/* read disklabel */	btochs(off, cyl, head, sect, bd->bios_heads, bd->bios_sectors);	error = biosd_io(F_READ, bd->bios_number, cyl, head, sect, 1, buf);	if(error)		return("failed to read disklabel");	/* Fill in disklabel */	return (getdisklabel(buf, label));}