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: Local file system access with Linux Synthetic target

On Fri, Sep 19, 2008 at 09:20:08AM -0700, Tyler Wilson wrote:
> Good day,
> I would like to perform file io from my eCos application in the
> synthetic target for testing. I did some searching for the answer to
> this question, but all I saw was a reference to 'you have to mount'. I
> am hoping someone here might have a more concrete example I could use
> for this. 
> Also, when searching for the mount command in the default linux
> template, I could find one. What are the minimal additional packages I
> need to enable local file IO in the synthetic target?

There is no access from eCos into the host filesystem via mount etc.

There are a few things you can however do

1) Include the fatfs support in eCos. You can create a fat filesystem
in a file. This can be mounted in Linux using the loopback device. In
eCos you can mount it using the synthetic flash device. See 


However don't have the mounted in eCos and Linux at the same
time. Doing so will lead to corruption of the filesystem.

2) eCos can call host system calls. So you can call the kernel open
system call, followed by the kernel read system call, write system
call etc. There are functions

cyg_hal_sys_open(), cyg_hal_sys_write(), cyg_hal_sys_read() and

However, be careful with blocking calls. They will block the whole of
eCos, not just one eCos thread.


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]