开发者

Using ext2 file system variant on Linux

I'm a newbie to kernel programming, and I'm stuck on something, so I'd appreciate some help. I appologize in advance if something similar was asked before, I did not find any relevant post, and could find explanations on the web which were simple enough for someone unexperienced as myself in this field to understand.

I want to experiment with my own version of ext2. I've got the source files from kernel.org, and made the proper changes. Nothing fancy, just to check something I had in mind.

Now I want to 开发者_开发百科insert it to my linux kernel (ubuntu 2.6.31-14-generic-pae if it matters). How can I do this?

My (obviously naive) initial thought was to simply use the makefile that comes along with it (after manually setting various flags there so it has obj-m/obj-y where needed) and compile it as a kernel module.

However I keep getting errors during compile time about redifining macros, implicit declarations of functions etc. For example

    ext2.h:181:1: warning: "ext2_find_first_zero_bit" redefined
    balloc.c:574: error: implicit declaration of function dquot_free_block_nodirty

Obviously this is not the way to go. I guess worst case scenario is compiling the entire kernel again (with my modified ext2 code instead of the original) so it creates the relevant library with my own ext2, and rebooting from the new image. I find it hard to believe this is the best approach.

Is it even possible for a new file system to be inserted as a kernel module?

Myabe I should put my modified ext2 code in /usr/src and somehow compile only the relevant library which contains the current ext2 code?

Anyway, I'd appreciate any help on what should I be doing.

Thank you


Do a search and replace of ext2 with my_awesome_filesystem or some such.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜