| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Downloads

This version was saved 16 years, 1 month ago View current version     Page history
Saved by PBworks
on February 9, 2008 at 1:35:54 pm
 

NGFS ( Downloads )

 

All the source code, samples for downloads should be kept here.  You may wish to upload your non-working code too for others to review, debug. In that case please make sure you upload it under "sandbox" section. Only the working code should be kept under "working" section.

 

Following codes need kernel 2.6 source code on your machine. Get it from here.

 

 NOTE : If you get compilation errors regarding the inode->u.generic_ip, Replace it with inode->i_private and also you will need to add an extra member "struct vfs_mount *mnt" in the call of function "ngfs_get_super" and call get_sb_bdev as get_sb_bdev(fs, flags, dev_name, data, ngfs_fill_super,mnt); 

  See http://lkml.org/lkml/2006/7/2/168

 

Working

 

      The codes below have been tested but still may not have taken enough care and may cause the kernel to crash on some systems. Better use UML (User Mode Linux) or VMware to test it.

  1.  Learn how to register your filesystem with the kernel. Make sure you read the MUST_README. 
  2. Here is the next working version of ngfs. It actually mounts your "ngfs" and you will be able to see it running the mount command. You will also be able to see some debugging info in "dmesg" which i just added to debug.

              Output something as after mounting

          [root@windce7 myfs]# mount

           /dev/hda2 on / type ext3 (rw)

           /home/katiyar/myfs/test_mount on /home/katiyar/myfs/test type ngfs (rw,loop=/dev/loop0)

           To test it perform the following commands

  •  dd if=/dev/zero of=test_mount bs=4096 count=10
  • ./mkngfs test_mount 4096
  • insmod ngfs.ko
  • mount -t ngfs /home/katiyar/myfs/test_mount test -o loop

      Download  mount_v1.tar.gz    ----- edited by Manish, Aug 22, 07

 

     3. With this version you can cleanly do a mount, unmount, cd , ls , ls -al, ls -ali (in the mounted directory). Some debugging info is there too in "dmesg" which might help you understand what is going on. you will not be able to create any new files. Will add that support soon. Also don't worry about the timestamp of the files shown in the output of "ls -al" as we dont keep a note of timestamp in our filesystem, you will see anything random there. See the physical layout of NGFS

     Download ngfs.zip      ----- edited by Manish, Sept 01, 07

 

     4. Working version which also supports creating new __FILES__ in the directory. Download nngfs_v1.tar.gz

                                                                                                                                      ---- edited by Manish, 26 Jan, 08

     5. Added the support for removing files. Download nngfs_v2.tar.gz

         Following commands are supported -- mount, umount, cd, ls (with options), touch, rm (with options) . Following commands dont work as of now but will be added soon ( mkdir, read or write to files, cat etc. )

                                                                                                                                                                                                                                                                                           ---- edited by Manish 30th Jan, 08

 

Sandbox

 

      If you are downloading from here chances are that most of the code under this will crash your kernel. It is your discretion to download, test and fix it. Will appreciate if you send the fixes though :-)

  1. Ok.....here goes the next version. Doesn't do anything useful other than i have added a utility to create NGFS filesystem and then there is the kernel module which loads, registers the filesystem and while mounting gives error :-) ...... I am still working on it to fix. As before the files are arranged as below
  • init.c      -- Main kernel module. Download its Makefile and how to build it from above.
  • utils/super.c  -- Functions to create the NGFS file system
  • utils/mkngfs.c -- Entry point for the mkngfs utility.

        Note that mkngfs right now just creates the super block ( not the root inode) and that also in a very raw fashion. We will optimize it later. Some functions like "ngfs_read_inode" are still incomplete. Perform the below steps to test.

  • Build init.c using the above Makefile
  • Build utils by issuing "make"
  • Create a filesystem by

               a) dd if=/dev/zero of=test_ngfs bs=512 count=10

               b) insmod ngfs.ko

               c) mkdir test

               d) mount -t ngfs test_ngfs /home/katiyar/test -o loop

               e) After this you should see an error message in reading root inode in your "dmesg".

      Download source

                                      ----- edited by Manish , August 21,07

 

    2. One more working version based on kernel version 2.6.23.11. Rewritten everything once again pretty much based on older version. specially the inode format (i_private). Can do mount, unmount, cd , ls -ali. It has lots of dirty debugging statements. Trying to use caches for inode allocation but isnt working right now. Fixing it. Download the source

                                                               --------- edited by Manish, December 29, 07

 

    3. Download this if you need to understand how to implement read and write in a basic filesystem. Note that it currently doesnt work. you will have to fix certain things. nngfs_sb_v2.tar.gz

                                                                                                                                                                                                       -------- edited by Manish Feb 9 , 08

Comments (0)

You don't have permission to comment on this page.