This is the mail archive of the mailing list for the eCos project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to incorporate a file system image when building eCos app

Ok, made some progress.

>> My problem is that I don't know how to get my files into an
>> appropriate file system image and how to get it built into the eCos
>> image. If someone has a howto they can point me to or to some other
>> documentation, it would be greatly appreciated.
> You can mkfs.jffs2 the file system on the host computer:
> Then you can either copy separately the binary file of the file system
> to the target, or you can transform it into a .h file and compile and
> link it with your application (assuming the application is a ROM or a
> ROMRAM application).

I made the file system image with:

$ mkfs.jffs2 -r myfs -o myfs.jffs2

where the myfs directory contains the contents of my file system.

$ find myfs -iname "*"

So, the 'test' directory is at the root of the jffs2 fs image.
Confirmed this by mounting the image on my host.

Then, I converted the jffs2 image to a '.h' to be included in my test
app. I have file2c.tcl script for such purposes.

I build the Linux Synthetic target with the required supporting
packages. In my working directory, where the root of the ecos tree is,
I do the following:

$ mkdir synthbuild
$ cd synthbuild
$ ecosconfig new linux
$ ecosconfig add posix fileio net freebsd_net eth_drivers linux_compat
flash crc jffs2
$ ecosconfig tree
$ make

Everything builds without issue.

The last part is to get the file system image hooked into the test
app. In my test app, I try to make the linkage to the file system

#  include "myfs_jffs2.h"
MTAB_ENTRY( myfs_mte1,
            (CYG_ADDRWORD) &myfs_jffs2[0] );

The test builds without any problems. However, when I run it, I get a
'No such entity' error when trying to open the file.

error:02001002:system library:fopen:No such entity:fopen('/test/file1.txt','r')

Any idea what I seem to be missing?



Before posting, please read the FAQ:
and search the list archive:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]