From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <1163465375.4559129f881cc@webmail.in-berlin.de> Date: Tue, 14 Nov 2006 01:49:35 +0100 From: Michael =?iso-8859-1?b?VGVpY2hncuRiZXI=?= To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] using opendisk on a sd partition References: <1163446457.4558c8b9db16b@webmail.in-berlin.de> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 User-Agent: Internet Messaging Program (IMP) 3.2.6 Content-Transfer-Encoding: quoted-printable Topicbox-Message-UUID: dde910bc-ead1-11e9-9d60-3106f5b1d025 It seems that disk/format is using the c/h/s values under a certain condition. If type is `hard' and you provide the -f option (which I did following some examples), disk->c/h/s will have an influence on the size of the created fat system: if(t->sectors =3D=3D 0 && strcmp(type, "hard") =3D=3D 0) { t->sectors =3D disk->s; t->heads =3D disk->h; t->tracks =3D disk->c; } ... if(fflag){ disk->size =3D t->bytes*t->sectors*t->heads*t->tracks; disk->secsize =3D t->bytes; disk->secs =3D disk->size / disk->secsize; } I'm wondering whether `fflag' somehow is used with different meanings in format.c. The first is explained for `-f' in the man-page: don't low-level format a floppy, for other devices it's a no-op. Moreover, in the context above it seems to be used as `is-a-file' flag: The code makes sure that the size-related members of `disk' are set to proper values, in case it is perhaps a file that is too small to contain an image of the selected fd type. Some lines later the file would be expanded to meet disk->size. Perhaps the condition above should read if(disk->type =3D=3D Tfile){ then -f resp. fflag would really be a no-op for non-floppy devices (and disk->c would be ignored, while h and s still are stored into the fat parameter block). Michael