FreeBSD/sys/pc98/pc98/pc98_machdep.c
/* Compatible with the revision 1.28. */
Compatible with the revision 1.28.
Compatible with the revision 1 . 28 .
static	void
pc98_ata_disk_geom_adjust_cyl16bit(struct disk *disk)
{
	off_t totsec = disk->d_mediasize / disk->d_sectorsize;
	off_t cyl = totsec / disk->d_fwsectors / disk->d_fwheads;
	if (cyl > 65355) {
		if (totsec < 17*8*65535) {
			disk->d_fwsectors = 17;
			disk->d_fwheads = 8;
		} else if (totsec < 63*16*65535) {
			disk->d_fwsectors = 63;
			disk->d_fwheads = 16;
		} else if (totsec < 255*16*65535) {
			disk->d_fwsectors = 255;
			disk->d_fwheads = 16;
		} else {
			disk->d_fwsectors = 255;
			disk->d_fwheads = 255;
		}
	}
}
static void pc98_ata_disk_geom_adjust_cyl16bit ( struct disk * disk ) { off_t totsec = disk -> d_mediasize / disk -> d_sectorsize ; off_t cyl = totsec / disk -> d_fwsectors / disk -> d_fwheads ; if ( cyl > 65355 ) { if ( totsec < 17 * 8 * 65535 ) { disk -> d_fwsectors = 17 ; disk -> d_fwheads = 8 ; } else if ( totsec < 63 * 16 * 65535 ) { disk -> d_fwsectors = 63 ; disk -> d_fwheads = 16 ; } else if ( totsec < 255 * 16 * 65535 ) { disk -> d_fwsectors = 255 ; disk -> d_fwheads = 16 ; } else { disk -> d_fwsectors = 255 ; disk -> d_fwheads = 255 ; } } }
Compatible with the revision 1.28.
Compatible with the revision 1 . 28 .
/*
	 * It is impossible to have more than 65535 cylinders, so if
	 * we have more then try to adjust.  This is lame, but it is
	 * only POC.
	 */