mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Bob Zhang" <zhanglinbao@gmail.com>
To: "Jared Hulbert" <jaredeh@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Does anyone run AXFS in 2.4 version of kernel ? I am trying my best to apply AXFS patches into 2.4.18
Date: Tue, 17 Jun 2008 23:26:56 +0800	[thread overview]
Message-ID: <85e7c2fc0806170826r66ea6f52nccb1f5b3edf1eda@mail.gmail.com> (raw)
In-Reply-To: <85e7c2fc0806170757t66a1167m9683fd4ad1c36f71@mail.gmail.com>

Following is what I have known about AXFS implement .If I am not
right, please Jared Hulbert cto correct what I have said.


Honestly speaking , AXFS orgnization is pure complex , and no any
valuable document to help to understand the source code . if you want
to make clear what happned ,it is not easy .

I have spent over 2 days to read the mkfs.axfs.c , this is what I have known .
---
For axfs super block ,the best valuable infomation is some offset of regions ,
axfs image has many regions , such as node_type regions , node_index
regions,especially X
IP region,Compressed region and Byte Aligned region which are the most
important for us.

Important info is that once you have read the superblock into a buffer
head , you can get all the offset info of all regions. thus , you can
get the address of regions in the file image .
once you get the region structure , you can get the "region->fsoffset"
and "region->virt_addr" , the "region->fsoffset" present that the real
location region in the image .
For example , for XIP region , you can get all the pages of data
through "xip_region->fsoffset" . and then through node_index, you can
get responding pages.

Another key parameter is "virt_addr" ,

++++

First ,pages are of XIP or Compressed is decided by mkfs.axfs -i xml.txt
if no the xml.txt provided , mkfs.axfs should compress all the files
in the image by default.

in the main() of mkfs.axfs.c
the axfs will compute the number of files , there are some global
variables to record these .
in function named  parese_directory() it will generate many entries
reponding with these files ,and at last , it will call "is_xipfile()"
function to call "set_page_state" function to set some files and pages
to be XIP if these names occur in the xml file as parameter of
mkfs.axfs -i .

In fact , for XIP files and pages , axfs handling is simple , for
example , I want to set rootfs/init 's 0~4095 bytes to be XIP  ,the
length of block of data must be aligned with PAGE_SIZE .
you can set the
<chunk>
  <size>4096</size>
  <offset>0</offset>
</chunk>

In fact , the data of XIP and that of compressed will be stored
respectively different regions .
for example , a file size is large , you know ,for example ,3MB .
it will have many pages of data , only the XIP pages will be stored
into XIP region
node_index[node_count] = xip_rd.size/PAGE_SIZE . THIS INDEX is valid for XIP

For every page , it will have node_index. this node_index will be
added when parsing the root directory . that is also said that, every
page has its own unique index number . Future , in kernel ,the axfs
code will use it. the kernel axfs code will use some macros to get
detailed infomation about a page , for example , this page is of XIP
or Compressed .

  reply	other threads:[~2008-06-17 15:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-09 16:19 Bob Zhang
2008-05-12 16:23 ` Jared Hulbert
2008-05-14  0:46   ` Bob Zhang
2008-05-14  1:01     ` Jared Hulbert
     [not found]       ` <85e7c2fc0805190842v6ee5f4f3jef7790b0fa459a21@mail.gmail.com>
2008-06-16 14:20         ` Bob Zhang
2008-06-17 14:57           ` Bob Zhang
2008-06-17 15:26             ` Bob Zhang [this message]
2008-06-18 14:43               ` Bob Zhang
2008-06-16 14:55       ` Bob Zhang

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=85e7c2fc0806170826r66ea6f52nccb1f5b3edf1eda@mail.gmail.com \
    --to=zhanglinbao@gmail.com \
    --cc=jaredeh@gmail.com \
    --cc=linux-kernel@vger.kernel.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

Powered by JetHome