The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: wkt@tuhs.org (Warren Toomey)
Subject: [Unix-jun72] Anyone working on V1 mkfs?
Date: Fri, 2 May 2008 12:31:22 +1000	[thread overview]
Message-ID: <20080502023122.GA82050@minnie.tuhs.org> (raw)
In-Reply-To: <20080502005808.GA79200@minnie.tuhs.org>

On Fri, May 02, 2008 at 10:58:08AM +1000, Warren Toomey wrote:
> On another note, I thought of taking V6 mkfs.c as a start-point to rewrite
> V1 mkfs.

I gave up and decided to write mkfs from scratch :-)

I'm a bit baffled on the i-node map and list. The V1 filesystem(5) manual says:

	I-numbers below 41 (base 10) are reserved for special files, and
	are never allocated; the first bit in the i-node free map refers
	to i-number 41. Therefore the byte number in the i-node map for
	i-node i is (i-41)/8 and offset (i-41)%8 bits from the right...

	I-numbers begin at 1, and the storage for i-nodes begins at block 2.
	Also, i-nodes are 32 bytes long, so 16 of them fit into a block.
	Therefore, i-node i is located in block (i+31)/16 of the file system,
	and begins 32*((i+31)%16) from its start.

	I-node 41 (base 10) is reserved for the root directory.

Now, I am assuming that this means:

  a) the i-mode bitmap is missing bits 0 to 40, but
  b) the actual i-nodes 0 to 40 do exist, and
  c) the system can still "read i-node 7", even if it can't allocate i-node 7.

Following the manual, the root directory i-node is number 41, so its
bit in the bitmap is (41-41)/8==0, offset (41-41)%8== bit 0. But the
actual i-node used is still i-node 41, so that is on block (41+31)/16==block4,
offset 256.

Let me know if that sounds right, or if I'm off-base somewhere.

Thanks,
	Warren



  parent reply	other threads:[~2008-05-02  2:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-01 23:42 Warren Toomey
2008-05-01 23:45 ` Tim Newsham
2008-05-02  0:33 ` Brad Parker
2008-05-02  0:58   ` Warren Toomey
2008-05-02  2:08     ` Tim Newsham
2008-05-02  2:31     ` Warren Toomey [this message]
2008-05-02  2:45       ` Tim Newsham
2008-05-02  3:21       ` Tim Newsham
2008-05-02  3:51         ` Warren Toomey

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=20080502023122.GA82050@minnie.tuhs.org \
    --to=wkt@tuhs.org \
    /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).