u_int rv, bm, sgn;
u_int rv, bm; #ifdef BIOS_DEBUG printf("getinfo: try #8, %x,%p\n", dev, pdi); #endif BIOS_regs.biosr_ds = BIOS_regs.biosr_es = 0;
bios_getinfo(dev, pdi)	int dev;	bios_diskinfo_t *pdi;{	u_int rv, bm, sgn;	__asm __volatile (DOINT(0x13) "\n\t"			  "setc %b0; movzbl %h1, %1\n\t"			  "movzbl %%cl, %3; andb $0x3f, %b3\n\t"			  "xchgb %%cl, %%ch; rorb $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++;	if (rv & 0xff)		return(1);	/* EDD support check */	__asm __volatile(DOINT(0x13) "; setc %b0"		 : "=a" (rv), "=c" (bm), "=b" (sgn)		 : "0" (0x4400), "2" (0x55aa) : "%edx", "cc");	if (!(rv & 0xff) && (sgn & 0xffff) == 0xaa55)		pdi->bios_edd = bm & 0xffff;	else		pdi->bios_edd = -1;	/*	 * NOTE: This seems to hang on certain machines.  Use function #8	 * first, and verify with #21 IFF #8 succeeds first.	 */	__asm __volatile (DOINT(0x13) "; setc %b0"		: "=a" (rv) : "0" (0x1500), "d" (dev) : "%ecx", "cc");	if(!(rv & 0xff00))		return(1);	if(rv & 0x00ff)		return(1);	return(0);}