From b715b67f2c653060630e3aef4ce75d6c49efa9c3 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Thu, 19 May 2005 13:33:21 +0000 Subject: [PATCH] Explain the magic --- tools/tools/nanobsd/i386.diskimage | 6 ++++++ 1 file changed, 6 insertions(+) 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