From: "Michael Teichgräber" <mt@wmipf.in-berlin.de>
To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: Re: [9fans] using opendisk on a sd partition
Date: Tue, 14 Nov 2006 01:49:35 +0100 [thread overview]
Message-ID: <1163465375.4559129f881cc@webmail.in-berlin.de> (raw)
In-Reply-To: <ee9e417a0611131505m5a664839vb20c37859c20167f@mail.gmail.com>
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 == 0 && strcmp(type, "hard") == 0) {
t->sectors = disk->s;
t->heads = disk->h;
t->tracks = disk->c;
}
...
if(fflag){
disk->size = t->bytes*t->sectors*t->heads*t->tracks;
disk->secsize = t->bytes;
disk->secs = 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 == 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
prev parent reply other threads:[~2006-11-14 0:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-13 19:34 Michael Teichgräber
2006-11-13 23:05 ` Russ Cox
2006-11-14 0:49 ` Michael Teichgräber [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1163465375.4559129f881cc@webmail.in-berlin.de \
--to=mt@wmipf.in-berlin.de \
--cc=9fans@cse.psu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).