lkml.org 
[lkml]   [2008]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Does anyone run AXFS in 2.4 version of kernel ? I am trying my best to apply AXFS patches into 2.4.18
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 .


\
 
 \ /
  Last update: 2008-06-17 17:29    [W:0.222 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site