IMFS question
Chris Johns
cjohns at cybertec.com.au
Fri May 10 04:08:03 UTC 2002
Glen M Cornell wrote:
> Is there a utility or procedure to convert a directory of files into an
> in-memory file system?
>
What I have done with a m68k target is make a tar file (not compressed) of the files to serve. Then run:
m68k-rtems-ld -r -o pages-tar.o -b binary pages.tar
linking pages-tar.o to my application. In the code do:
#include <ftpd.h>
#include <rtems/untar.h>
#include <rtems_webserver.h>
#include <rtems/monitor.h>
/*
* These are created by the linker when linking a binary file.
*/
extern int _binary_pages_tar_start;
extern int _binary_pages_tar_size;
struct rtems_ftpd_configuration rtems_ftpd_configuration = {
175, /* FTPD task priority */
1024, /* Maximum buffersize for hooks */
21, /* Well-known port */
NULL /* List of hooks */
};
int main(int argc, char **argv)
{
Untar_FromMemory ((unsigned char *) (&_binary_pages_tar_start),
(int) &_binary_pages_tar_size);
rtems_initialize_webserver ();
rtems_initialize_ftpd ();
rtems_monitor_init (0);
rtems_task_suspend (RTEMS_SELF);
return 0;
}
--
Chris Johns, cjohns at cybertec.com.au
More information about the users
mailing list