This is the mail archive of the ecos-discuss@sourceware.org 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


Thank you for the quick response. I would prefer option number 1, but I
am still unclear on how this is hooked up in the application code. What
I would like to do is get a closer synthetic emulation to our device, so
we would do the following:

- mount a file using FAT fs to simulate the SD Card
- mount a file using JFFS2 to simulate our internal flash

You say below that the first can be done. Can we do the same for JFFS2?
If so, I am unsure of the mechanism. For example:

mount_table {
	{ "/sd0", "fatfs", "/dev/sd/0" },
	{ "/df0", "jffs2fs", "/dev/flash/0" },
}

Questions:

- How do I tell eCos what files to associate with what file system /
mount point? (I see in the 'Synthetic FLASH memory support" a file name
- how do I set this for each mount)?
- What function do I call to get these guys mounted? Or it automatic?
- In the above example, I want "/" to be the parent of both file
systems. Is this possible? How would I specify it?

Thank you,
Tyler

> -----Original Message-----
> From: Andrew Lunn [mailto:andrew@lunn.ch]
> Sent: Friday, September 19, 2008 1:38 PM
> To: Tyler Wilson
> Cc: ecos-discuss@ecos.sourceware.org
> Subject: Re: [ECOS] 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
> 
> packages/fs/fat/current/doc/README.txt
> 
> 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
> cyg_hal_sys_close.
> 
> However, be careful with blocking calls. They will block the whole of
> eCos, not just one eCos thread.
> 
>         Andrew

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


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