FreeBSD/sys/pc98/pc98/pc98_machdep.c
/*
 * Read a geometry information of SCSI HDD from BIOS work area.
 *
 * XXX - Before reading BIOS work area, we should check whether
 * host adapter support it.
 */
Read a geometry information of SCSI HDD from BIOS work area.
XXX - Before reading BIOS work area, we should check whether
host adapter support it.
Read a geometry information of SCSI HDD from BIOS work area . XXX - Before reading BIOS work area we should check whether host adapter support it .
int
scsi_da_bios_params(struct ccb_calc_geometry *ccg)
{
	u_char *tmp;
	int	target;
	target = ccg->ccb_h.target_id;
	tmp = (u_char *)&PC98_SYSTEM_PARAMETER(0x460 + target*4);
	if ((PC98_SYSTEM_PARAMETER(0x482) & ((1 << target)&0xff)) != 0) {
		ccg->secs_per_track = *tmp;
		ccg->cylinders = ((*(tmp+3)<<8)|*(tmp+2))&0xfff;
#if 0
		switch (*(tmp + 3) & 0x30) {
		case 0x00:
			disk_parms->secsiz = 256;
			printf("Warning!: not supported.\n");
			break;
		case 0x10:
			disk_parms->secsiz = 512;
			break;
		case 0x20:
			disk_parms->secsiz = 1024;
			break;
		default:
			disk_parms->secsiz = 512;
			printf("Warning!: not supported. But force to 512\n");
			break;
		}
#endif
		if (*(tmp+3) & 0x40) {
			ccg->cylinders += (*(tmp+1)&0xf0)<<8;
			ccg->heads = *(tmp+1)&0x0f;
		} else {
			ccg->heads = *(tmp+1);
		}
		return (1);
	}
	return (0);
}
int scsi_da_bios_params ( struct ccb_calc_geometry * ccg ) { u_char * tmp ; int target ; target = ccg -> ccb_h . target_id ; tmp = ( u_char * ) & PC98_SYSTEM_PARAMETER ( 0x460 + target * 4 ) ; if ( ( PC98_SYSTEM_PARAMETER ( 0x482 ) & ( ( 1 << target ) & 0xff ) ) != 0 ) { ccg -> secs_per_track = * tmp ; ccg -> cylinders = ( ( * ( tmp + 3 ) << 8 ) | * ( tmp + 2 ) ) & 0xfff ; #if 0 switch ( * ( tmp + 3 ) & 0x30 ) { case 0x00 : disk_parms -> secsiz = 256 ; printf ( " \n " ) ; break ; case 0x10 : disk_parms -> secsiz = 512 ; break ; case 0x20 : disk_parms -> secsiz = 1024 ; break ; default : disk_parms -> secsiz = 512 ; printf ( " \n " ) ; break ; } #endif if ( * ( tmp + 3 ) & 0x40 ) { ccg -> cylinders += ( * ( tmp + 1 ) & 0xf0 ) << 8 ; ccg -> heads = * ( tmp + 1 ) & 0x0f ; } else { ccg -> heads = * ( tmp + 1 ) ; } return ( 1 ) ; } return ( 0 ) ; }
Read a geometry information of SCSI HDD from BIOS work area.
Read a geometry information of SCSI HDD from BIOS work area .