RAMDISK in FAT format

Pavel Pisa ppisa4lists at pikron.com
Wed Dec 14 21:46:00 UTC 2005


On Wednesday 14 December 2005 10:59, Wilfried Busalski wrote:
> Hi
>
> I need a little help to use a FAT RAMDISK.
>
> Is there an example to see how it is to use?
>
> Regards
> W.Busalski

Hello Wilfried,

I have time only for glimpse answer. But I have teaching
MMC/SD to work with FAT last week, so some code fragments could help.

I have found next lines in some former RTEMS post.
I have not author name on hand to credit him so excuse me.
This is slightly updated, to correct function names etc.

Steps to mount and create file:

1. msdos_format("/dev/ramdisk0", NULL);
2. ide_part_table_initialize("/dev/ramdisk0");
3. binary fstab 

  fstab_t fs_table[] = {
    {
      "/dev/ramdisk0", "/mnt/ramdisk0",
      &msdos_ops, RTEMS_FILESYSTEM_READ_WRITE,
      FSMOUNT_MNT_OK | FSMOUNT_MNTPNT_CRTERR | FSMOUNT_MNT_FAILED,
      0
    }
  };

4. rtems_fsmount( fs_table,
                  sizeof(fs_table)/sizeof(fs_table[0]),
                  NULL);

5. creat("/mnt/ramdisk0/file1", S_IREAD | S_IWRITE);

The examples with already working MMC/SD driver can be taken from my homepage

http://cmp.felk.cvut.cz/~pisa/rtems/rtems-mx1-mmcsd-051212.tar.gz

Look at file mmcsd_rtems.c for examples.

Best wishes

            Pavel Pisa






More information about the users mailing list