[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RAMDISK in FAT format



Pavel.. could you add this to the Wiki?

And if you don't mind, I will try to grab your example tomorrow and move it to at least contrib. It is probably more useful in the examples I buidl all the time but one step at a time.

--joel

Pavel Pisa wrote:
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





--
Joel Sherrill, Ph.D.             Director of Research & Development
joel@OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985