Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
21 years ago

Filesystem for compact flash

I want to install a fat filesystem on the compact flash.

I am using the stratix evaluation board.

Can somebody tell me if i can use the files existing in the microtronix linux for this purpose.

If so how?

Or else is some code available which will help me in this matter.

8 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi,

    If you are using Linux, sure you can use FAT. Since the Compactflash from Altera is pre-formated as FAT, you only need to enable FAT support in kernel configuration. I tried this on Stratix, it worked fine.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi,

    I have already installed the linux with the fat support enabled.

    I want to know how to make use of this in my application to create a FAT system.

    I have seen your e2fs application.

    But there are lot many codes for that.

    so i couldn't follow what was actually happening there.

    So please could you tell me in detail how to proceed with for creating the fat filesystem in compact flash.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    When I tried FAT, the compact flash is a brand new one from Altera. I just simply mounted it and then copied files to it. I did not try to format a compact flash.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    You could create the file system using

    mkdosfs -F 16 /dev/<your_dev>

    on any PC running Linux.

    For a Windows PC, I&#39;m not sure they give you the option of creating a FAT16 filesystem, though there may be some utilities that will do it...

    wentao is right, most CF cards come fully formatted already.

    Cheers,

    - slacker
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I want to do the creation of the filesystem from an application ported on NIOS.

    i.e. it should be somewhat similar to the process we are following for creating an ext2 filesystem in the demo application.

    I don&#39;t want the pc side to do these.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I also wanted to know if there are some systems calls available for these functions.

    If so what is the header file to be included.

    I don&#39;w want the shell to do the function
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi reju_r,

    If I were you, I would go to get the source code of similar utilities, such as mkdosfs, as slacker pointed out, and see how they did.