1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-26 16:18:31 +00:00

Explain the magic

This commit is contained in:
Poul-Henning Kamp 2005-05-19 13:33:21 +00:00
parent 56f5aba2ca
commit b715b67f2c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=146386

View File

@ -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