diff --git a/tools/tools/nanobsd/i386.diskimage b/tools/tools/nanobsd/i386.diskimage index b21f47cee68..6ede3d8dd1f 100644 --- a/tools/tools/nanobsd/i386.diskimage +++ b/tools/tools/nanobsd/i386.diskimage @@ -58,11 +58,17 @@ MD=`mdconfig -a -t vnode -f ${TMPFILE0} -x ${SC} -y ${HD}` rm -f ${TMPFILE0} echo ${SECTS} ${SC} ${HD} ${DATASIZE} | awk ' { + # size of cylinder in sectors cs = $2 * $3 + # number of full cylinders cyl = $1 / cs print "g c" cyl " h" $3 " s" $2 + # Size of data/conf patition, round up to full cylinder dsl = int (($4 + cs - 1) / cs) + # Size of code partition cylinder = half the remainder csl = int ((cyl - dsl) / 2) + # ... But that could round down, so make the data/conf + # use whatever the code partitions do not use. dsl = cyl - csl * 2 print "p 1 165 " $2, csl * cs - $2 print "p 2 165 " $2 + csl * cs, csl * cs - $2