FreeBSD/sbin/fdisk_pc98/fdisk.c
/***********************************************\
* Change real numbers into strange dos numbers	*
\***********************************************/
\
Change real numbers into strange dos numbers
\
\ Change real numbers into strange dos numbers \
static void
dos(u_int32_t start, u_int32_t size, struct pc98_partition *partp)
{
	u_int32_t end;
	if (partp->dp_mid == 0 && partp->dp_sid == 0 &&
	    start == 0 && size == 0) {
		memcpy(partp, &mtpart, sizeof(*partp));
		return;
	}
	partp->dp_scyl = partp->dp_ipl_cyl = start / dos_cylsecs;
	partp->dp_shd = partp->dp_ipl_head = start % dos_cylsecs / dos_sectors;
	partp->dp_ssect = partp->dp_ipl_sct = start % dos_sectors;
	end = start + size - cylsecs;
	partp->dp_ecyl = end / dos_cylsecs;
	partp->dp_ehd = end % dos_cylsecs / dos_sectors;
	partp->dp_esect = end % dos_sectors;
}
static void dos ( u_int32_t start , u_int32_t size , struct pc98_partition * partp ) { u_int32_t end ; if ( partp -> dp_mid == 0 && partp -> dp_sid == 0 && start == 0 && size == 0 ) { memcpy ( partp , & mtpart , sizeof ( * partp ) ) ; return ; } partp -> dp_scyl = partp -> dp_ipl_cyl = start / dos_cylsecs ; partp -> dp_shd = partp -> dp_ipl_head = start % dos_cylsecs / dos_sectors ; partp -> dp_ssect = partp -> dp_ipl_sct = start % dos_sectors ; end = start + size - cylsecs ; partp -> dp_ecyl = end / dos_cylsecs ; partp -> dp_ehd = end % dos_cylsecs / dos_sectors ; partp -> dp_esect = end % dos_sectors ; }
\
Change real numbers into strange dos numbers
\
\ Change real numbers into strange dos numbers \
/* Start c/h/s. */ /* End c/h/s. */