if (!pdi->bios_cylinders || !pdi->bios_heads || !pdi->bios_sectors) return(1);   if (pdi->bios_heads < 2) return(1);
bios_getdiskinfo(dev, pdi)	int dev;	bios_diskinfo_t *pdi;{	u_int rv;	rv = biosdreset(dev);	if(rv)		return(1);#ifdef BIOS_DEBUG	printf("getinfo: try #8, %x,%p\n", dev, pdi);#endif	__asm __volatile (DOINT(0x13) "\n\t"			  "setc %b0; movzbl %h1, %1\n\t"			  "movzbl %%cl, %3; andb $0x3f, %b3\n\t"			  "xchgb %%cl, %%ch; rolb $2, %%ch"			  : "=a" (rv), "=d" (pdi->bios_heads),			    "=c" (pdi->bios_cylinders),			    "=b" (pdi->bios_sectors)			  : "0" (0x0800), "1" (dev) : "cc");	/* Fix up info */	pdi->bios_number = dev;	pdi->bios_heads++;	pdi->bios_cylinders &= 0x3ff;	pdi->bios_cylinders++;#ifdef BIOS_DEBUG	printf("getinfo: got #8\n");#endif	if (rv & 0xff || !pdi->bios_cylinders)		return(1);#if 0	/* NOTE:	 * This currently hangs/reboots some machines	 * The IBM Thinkpad 750ED for one.	 *	 * Funny that an IBM/MS extension would not be	 * implemented by an IBM system...	 */	if (dev & 0x80) {		int bm;		/* EDD support check */		__asm __volatile("int $2;" DOINT(0x13) "; setc %b0"			 : "=a" (rv), "=c" (bm)			 : "0" (0x4100), "2" (0x55aa), "d" (dev) : "cc");		DUMP_REGS;		if (!(rv & 0xff) && (BIOS_regs.biosr_bx & 0xffff) == 0xaa55)			pdi->bios_edd = bm & 0xffff;		else			pdi->bios_edd = -1;	} else		pdi->bios_edd = -1;#else	pdi->bios_edd = -1;#endif	/*	 * NOTE: This seems to hang on certain machines.  Use function #8	 * first, and verify with #21 IFF #8 succeeds first.	 * don't try this for a:	 */	if (dev) {		__asm __volatile (DOINT(0x13) "; setc %b0"			: "=a" (rv) : "0" (0x1500), "d" (dev) : "%ecx", "cc");		if(!(rv & 0xff00))			return(1);		if(rv & 0xff)			return(1);	}	return(0);}