File system from list of files?

Till Straumann strauman at slac.stanford.edu
Wed Sep 22 23:11:09 UTC 2004


If I remember right, there's a catch to this: the memory where the
tar image resides is 'lost', i.e., forever used by the tar image.
Would be nice if it could be made available after untarring into
IMFS somehow...

-- Till

Chris Johns wrote:
> Peter Dufault wrote:
> 
>>
>> Is there a utility that I can run on Unix (or whatever development 
>> host I'm using) where I can specify a list of files, and the utility 
>> will generate C code that will implement a read-only POSIX filename 
>> file system under RTEMS?
>>
> 
> Yes but not directly from ROM and not using C code. The files are placed 
> into the IMFS (or what ever filesystem you have).
> 
> 1) Create a tar file of the files you wish to access:
>     $ tar cf files.tar config.c
> 
> 2) Turn the tar file into an object file (m68k target):
>     $ m68k-rtems-ld -r -o files.o -b binary files.tar
> 
> 3) Link the object file into your application.
> 
> 4) In you application untar the files using:
> 
>  #include <rtems.h>
>  #include <rtems/untar.h>
> 
>  /*
>   * These are created by the linker when linking a binary file.
>   */
>  extern int _binary_files_tar_start;
>  extern int _binary_files_tar_size;
> 
>  void
>  files_untar ()
>  {
>    Untar_FromMemory ((unsigned char *) (&_binary_files_tar_start),
>                     (int) &_binary_files_tar_size);
>  }
> 





More information about the users mailing list