Thread: File System Implementation

  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    4

    File System Implementation

    below u'll find all the details pertaining to my problem:
    Implement a file system on top of a file of 100KB called “abcFS”(replace abc by your
    id).You have to develop a library of the following functions.
    filehandler
    myopen(“filename”,”r/w”); open
    for read or write
    int
    myread(void *out,int NoOfBytes,filehandler fh); –out
    is preallocated memory
    int
    mywrite(void *in,int NoOfBytes,filehandler fh); in
    is input buffer
    int
    myseek(int pos,filehandler fh); current
    pointer placed at pos
    int
    delete(“filename”); delete
    the file and release the space allocated.
    void
    myclose(filehandler fh); close
    the file
    Copy these 5 functions into a header file “abclib.h”(replace abc by your id) and develop a C
    implementation of them.
    Assume that there is no directory structure. Filenames are unique.User must not be able to
    create a file with already existing filename.
    Write a program abcFSformat.c that creates your filesystem of 100KB size and formats it.
    Test your file system library by using the calls in a separate test program.
    The file system should be persistent. Test your filesystem through many invocations of the test
    program.

    This file system has to be implemented on a linux kernel..using the concept of superblocks,bitmap inodes,datablock files.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    OK, so what is your actual question?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Nov 2007
    Posts
    4
    well my actual question is to make the files format.c, read and open

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    This is a typical "assignment", which means it applies to Homework policy.

    This means, "you write the code, we help you", NOT "you present the problem, we write the code".

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    Registered User
    Join Date
    Nov 2007
    Posts
    4
    man the main problem is i have no clues as to what to write....i have tried hard enough...man i am an amateur..

  6. #6
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    So, didn't you get a book or some such at the beginning of your class, that describes how a typical filesystem works?

    What I mean by this is two things:
    1. It seams to me like this is not a beginner assignment, so if you have "no clue", then you've either jumped in the deep end with no ability to swim and no floatation aid... You will probably sink if you don't start learning quickly.
    2. Filesystem writing is non-trivial. This is not a 2-hour project for a novice. It is a 2-3 day [full-time] project for somone with plenty of programming experience, and much more than that for someone with little or no experience.

    If you've really been given this task with no previous programming experience, you are probably in the wrong course!

    If you have some programming experience, but you don't quite know where to start, then explain what your thoughts are on how a file-system works, and then we'll help you out.

    I have never created a file-system myself, but I have a fair understanding of how one works.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  7. #7
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > using the concept of superblocks,bitmap inodes,datablock files.
    http://www.nondot.org/sabre/os/articles/FileSystems/
    http://en.wikipedia.org/wiki/Unix_File_System

    I agree with matsp, this isn't going to be something you can rattle off in a few hours.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  8. #8
    Devil™
    Join Date
    Oct 2007
    Location
    IIT-Kharagpur, India
    Posts
    104
    I have done something like this in OS lab course 2years back.. the last assignment and highest weightage
    it is exactly implementation of the standard functions read(),write() etc on linux.. without using high level system calls..
    ya.. this is not going to be easy.. as the disks come into picture
    you can only use lseek and its sister functions..
    first, this will take a long time for you to make a design of how you want to implement..
    and after that.. coding it with lseek is real tough job..
    you need to get down to the bytes and bits.. (its suxx )
    if you want some sort of help you can get a lot of material of the filesystem.. if possible I will find that code if it exists on my system and post little more help

    hey!! I am not going to give the assignment to you.. lol homework policy
    C's Motto: who cares what it means? I just compile it!!

  9. #9
    Registered User
    Join Date
    Nov 2007
    Posts
    4
    thanks a million man....i want to be very honest...i have all the ideas of how a file system works and i have worked out a very formidable design approach...but my weak point is coding and i need all the help in the world...

  10. #10
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    So start somewhere - perhaps the code to create the root directory?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem building Quake source
    By Silvercord in forum Game Programming
    Replies: 16
    Last Post: 07-11-2010, 09:13 AM
  2. Can we have vector of vector?
    By ketu1 in forum C++ Programming
    Replies: 24
    Last Post: 01-03-2008, 05:02 AM
  3. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 08:39 AM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  5. archive format
    By Nor in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 08-05-2003, 07:01 PM