External RAM filesystem

Joel Sherrill joel.sherrill at oarcorp.com
Wed Nov 14 14:15:07 UTC 2007


I don't remember if there is an example in the source
tree anywhere of doing this.  If you can put together
something, it would be appreciated.  Just declared
some large byte array and use it as the RAM for the
purposes of an example.

--joel

Aitor.Viana.Sanchez at esa.int wrote:
>
> Hi Thomas,
>
> I managed to configure the RAMDISK, and also accessing it but i got 
> couple of questions.
>
>         - I didn't use the msdos_initialize function at all and I 
> don't know what this function does exactly and why it is needed.
>         - I had also to initialize the rtems_bdbuf_configuration 
> structure and the rtems_bdbuf_configuration_size variable, but i don't 
> know what is this structure/variable is for.
>         - I can access to the RAMDISK by means of 
> fopen("/dev/ramdisk0") for instance. But this allows me to write/read 
> in the RAMDISK area using the file API. But apparently does not allow 
> me to create files in the RAMDISK area (which is my intention). Lets 
> say, I want to allocate a RAMDISK area, mount it, and then access it 
> like a filesystem.
>
> Here is my configuration file:
>
> #ifndef RTEMSCONFIG_H_
> #define RTEMSCONFIG_H_
>
> /* configuration information */
>
> rtems_task Init( rtems_task_argument argument);
>
> #define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
>
> #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
>
> #define CONFIGURE_MAXIMUM_TASKS 10
> #define CONFIGURE_MAXIMUM_SEMAPHORES 10
> #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 4
>
> rtems_bdbuf_config rtems_bdbuf_configuration[] = {
>   { 512, 20, (void *) 0 }
> };
> int rtems_bdbuf_configuration_size = 1;
>
> rtems_ramdisk_config rtems_ramdisk_configuration[] = {
>   {
>      512, 20, (void *) 0
>   }
> };
>
> int rtems_ramdisk_configuration_size = 1;
>
> #define CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE
> rtems_driver_address_table Device_drivers[] = {
>   CONSOLE_DRIVER_TABLE_ENTRY,
>   CLOCK_DRIVER_TABLE_ENTRY,
>   RAMDISK_DRIVER_TABLE_ENTRY
> };
> #define CONFIGURE_NUMBER_OF_DRIVERS \
>   ((sizeof(Device_drivers) / sizeof(rtems_driver_address_table)))
> #define CONFIGURE_MAXIMUM_DRIVERS 10
>
> #define CONFIGURE_INIT
>
> #include <confdefs.h>
>
> #endif /*RTEMSCONFIG_H_*/
>
>
> Cheers,
>
> Aitor
>
>
> -----------------------------
> Aitor Viana Sánchez
>
> ESA - European Space Technology Centre (ESTEC)
> TEC-EDD - Computer and Data Systems Section
> ESA/ESTEC P.O. Box 299 / 2200AG Noordwijk ZH, The Netherlands
> Tel (+31) 71 565 6727
> Email: aitor.viana.sanchez at esa.int
>
>
> *Thomas Doerfler <Thomas.Doerfler at embedded-brains.de>*
>
> 11/13/2007 05:47 PM
>
> 	
> To
> 	Aitor.Viana.Sanchez at esa.int
> cc
> 	rtems-users at rtems.org
> Subject
> 	Re: External RAM filesystem
>
>
>
> 	
>
>
>
>
> Hi,
>
> yes, it should be possible. There still exists a ram disk driver, which
> performs this function, see:
>
> cpukit/libblock/src/ramdisk.c
>
> We used it for our very first tests of the FATFS. If I recall correctly,
> these are the steps to work with it:
>
> - define a rtems_ramdisk_config data structure (e.g. in the init module)
> with the fixed name "rtems_ramdisk_configuration".
>
> - you can/must define the block size, the number of blocks and location
> in this structure
>
> - If you add the RAMDISK_DRIVER_TABLE_ENTRY to your device driver table,
> it will initialize automatically when your system comes up
>
> - Or, you can initialize the ramdisk with "ramdisk_initialize".
>
> - Next, you must format the ramdisk (use msdos_format function in
> cpukit/libfs/src/dosfs/msdos_format.c).
>
> - Then you can mount the ramdisk as a (unpartitioned) volume with
> msdos_initialze().
>
> I hope I am rather acurate on these steps.
>
> It would be nice if you could give us feedback, when things work.
>
> And it would be even nicer, if you could write a wiki entry on this
> under www.rtems.com/wiki
>
> wkr,
> Thomas.
>
>
>
>
>
> Aitor.Viana.Sanchez at esa.int schrieb:
> >
> > Hi all,
> >
> >
> > is it possible to configure RTEMS somehow to access and external RAM
> > memory address where a FAT32 (for instance) file system is placed? Is it
> > possible to configure the address and size?
> >
> > Thanks in advance.
> >
> >
> > Aitor
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > rtems-users mailing list
> > rtems-users at rtems.com
> > http://rtems.rtems.org/mailman/listinfo/rtems-users
>
>
> --
> --------------------------------------------
> embedded brains GmbH
> Thomas Doerfler           Obere Lagerstr. 30
> D-82178 Puchheim          Germany
> Tel. : +49-89-18 90 80 79-2
> Fax  : +49-89-18 90 80 79-9
> email: Thomas.Doerfler at embedded-brains.de
> PGP public key available on request
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
> ------------------------------------------------------------------------
>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users
>   




More information about the users mailing list