Find the answer to your Linux question:
Results 1 to 9 of 9
i would like to add time zone functionality to the linux vfat file system. I would like to know some tutorials for understanding linux source code for file systems. I ...
  1. #1
    Just Joined!
    Join Date
    Apr 2010
    Posts
    9

    How to Add Time Zone option to the VFAT

    i would like to add time zone functionality to the linux vfat file system.

    I would like to know some tutorials for understanding linux source code for file systems. I want to know where is the time attached to the newly created file etc in the code.

    I shall be really thankful for the quick responses.

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,961
    vfat is the Linux implementation of the MS FAT file system, but handles fat-12, fat-16, and fat-32 types. It is only capable of supporting features that the "standard" allows. I'm not sure if it stores dates in GMT and then uses the system time zone database to adjust the displayed time of a file based upon the date stamp it contains or not. In any case, if it is local time that is stored in the file's directory entry, then you are out of luck. FYI, Linux file systems such as ext2, etc. do store the date+time information about the file in GMT so it can be properly displayed based upon the system time zone settings. I know that I tested some of that recently. I could watch the time change if I switched time zones.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Apr 2010
    Posts
    9
    as i mentioned earlier, i wm new to linux but according to my information, date and time stored is local time. and i need to add the functionality for time zone conversions. I need help for that.

    I think i will have to store the time zone of the system will other information of the file and use that information when displaying file on some other system?

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,961
    Breaking standards is a dangerous thing. That said, you need to get the source code for the kernel and fat file system tools. Then you need to modify the fat file system driver so that date+time information for file creation, update, access are adjusted to GMT and stored that way, and converted to local time when someone reads the directory. Then, you need some way to determine when a FAT device is not using GMT as a time base because they were formatted or written by another system (Windows for example).

    The final (and very much non-trivial) problem will be when updates to the OS also update the driver and tools. You will then have to add your changes back to the new sources. Trust me, this is not very desirable. May I ask why you have to do this?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    Just Joined!
    Join Date
    Apr 2010
    Posts
    9
    Thanks for your quick reply.

    i might seem a little silly when answering your question "Why am i doing that"

    actually i am students of MS computer science and out teracher has assigned us project that we have to contribute to linux source code and fix nay two bugs. i used linux for the first time in this course so understanding even simple commands is yet difficult for mme. SO its almost impossible at this stage to understand bug reports at bugzilla.kernel.org. The bugs i understand included time zones functionality for VFat. So i started looking at its solution.

  6. #6
    Just Joined!
    Join Date
    Apr 2010
    Posts
    9
    and for your information, i have taken source code of linux kernel and compiled it on my machine. now looking to move to the next step i.e iunderstanding some bug and fixing it.

  7. #7
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,961
    Ok. Thanks for the clarification. A point to ponder: the terms of use for these forums includes the caveate that we don't do your class work for you. We can, however, provide general hints and such, so I will restrict my comments to that.

    First, now that you have the source code the kernel (make sure it is the source for your current kernel) and compiled it, if you didn't before, change the minor version number in the source so it will generate a new kernel that will not interfer with your current kernel, and rebuild it before you install it (make install). That should add it as a new (non-default) entry in your grub menu, though you might want to verify that. Then, reboot the system, selecting your new "custom" kernel. Assuming that works (boots without a kernel panic), then you are ready to start working on the actual vfat file system work. This is what is commonly known as preparation work, or to put it more gentilely, scut work... However, it is necessary to do before you really start digging into the guts of the operating system.

    So, I applaud your professor in "encouraging" you all to contribute to the community in this way as part of your professional training. One thing about kernel programming is that it is not simple stuff - truly the "rocket science" of programming. Understanding only comes with practice and effort. Trust me when I say that this sort of exercise is the best preparation for a career in the field of computer science and software engineering. So often I have had employees who had the letters after their name, often from prestigious schools, yet were woefully underprepared for real-world application of their newly won knowledge, and others with no degree who via dint of effort, some schooling, and rigorous self-teaching, were able to rise to the top of the profession, teaching those with the advanced degrees how to walk and chew gum at the same time.

    Best of luck in your endeavors. Advice is cheap, my time is not, but I am always willing to help.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  8. #8
    Just Joined!
    Join Date
    Apr 2010
    Posts
    9
    thanks a lot for your time.

    First thing you mentioned is that forums are not for class work. You are absolutely right and thats why i didnt ask for the parts i could do myself. Proof for this is that all i have already done the work you asked me in your last reply called "preparation work". i have successfully compiled and installed source code on my machine.

    As i mentioned earlier, next step is to select some relatively easy bugs and fix them. I have been struggling for last 15 days but could not succeed so looked for some forums and asked question.

    Anyways thanks a lot for your time and precious advice.

  9. #9
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,961
    There is quite a bit of online documentation and some free e-book versions of kernel programming books as well. They help in the main, but as I said, you really need to work thru the driver code yourself in order to understand what it is doing. Then, isolate the sections of code that deal with the directory structures and in particular the date/time fields. I know that you are probably already doing this, but as I said, advice is cheap!

    Anyway, the following sites have documentation and such to help in your learning process. The Linux Foundation site has online training course (not cheap - but occasionally free).
    The Linux Kernel Archives
    The Linux Foundation
    Linux.com | The source for Linux information
    The Linux Documentation Project
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •