public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Accessing File from host system's OS filesystem
@ 2004-08-11 22:28 Samie Hassan Ghauri
  2004-08-12  7:40 ` Andrew Lunn
  0 siblings, 1 reply; 6+ messages in thread
From: Samie Hassan Ghauri @ 2004-08-11 22:28 UTC (permalink / raw)
  To: ecos-discuss

Hi
I am running eCos on my PC on which Windows XP is installed. I want to parse 
a BMP file in an application I wrote in ANSI C, which I now want to port to 
eCos. I have read how fileio system in the reference guide, but still not 
sure how to read the BMP file that is saved in host system's OS filesystem.

Can anyone share some fragment of code if somebody ever opened a file from 
native hard disk so that will serve as an example for me to follow?

Thanks
Samie

_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
http://join.msn.com/?page=features/virus


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] Accessing File from host system's OS filesystem
  2004-08-11 22:28 [ECOS] Accessing File from host system's OS filesystem Samie Hassan Ghauri
@ 2004-08-12  7:40 ` Andrew Lunn
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Lunn @ 2004-08-12  7:40 UTC (permalink / raw)
  To: Samie Hassan Ghauri; +Cc: ecos-discuss

On Wed, Aug 11, 2004 at 10:28:31PM +0000, Samie Hassan Ghauri wrote:
> Hi
> I am running eCos on my PC on which Windows XP is installed. I want to 
> parse a BMP file in an application I wrote in ANSI C, which I now want to 
> port to eCos. I have read how fileio system in the reference guide, but 
> still not sure how to read the BMP file that is saved in host system's OS 
> filesystem.
>
> Can anyone share some fragment of code if somebody ever opened a file from 
> native hard disk so that will serve as an example for me to follow?

There is no support for NTFS in eCos. Only FAT is supported. So this
is not possible. Maybe you can make a romfs and put the BMP file into
that and make it part of the image. Take a look at the romfs test case
for an example how to do this.

        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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] Accessing File from host system's OS filesystem
  2004-08-13 14:28 Samie Hassan Ghauri
@ 2004-08-14 10:32 ` Bart Veer
  0 siblings, 0 replies; 6+ messages in thread
From: Bart Veer @ 2004-08-14 10:32 UTC (permalink / raw)
  To: samiehg; +Cc: ecos-discuss

>>>>> "Samie" == Samie Hassan Ghauri <samiehg@hotmail.com> writes:

    Samie> i successessfully compiled the code in test file "file
    Samie> I01.c" that included testRomss.h. I built the Ecos library
    Samie> using template for leon which is my target processor.But
    Samie> when I run it on GRrMon, the simulator for leon, it seems
    Samie> the root directory is not been picked up because the
    Samie> following error come: OpenDirreturned-1,No such entity

    Samie> Any idea???

Are you using current anoncvs? There was a problem with that testcase
which meant it would not work on big-endian processors. I fixed that
recently, running mk_romfs with the -b option when building for a
big-endian target.

Bart

-- 
Bart Veer                       eCos Configuration Architect
http://www.ecoscentric.com/     The eCos and RedBoot experts

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] Accessing File from host system's OS filesystem
@ 2004-08-13 14:28 Samie Hassan Ghauri
  2004-08-14 10:32 ` Bart Veer
  0 siblings, 1 reply; 6+ messages in thread
From: Samie Hassan Ghauri @ 2004-08-13 14:28 UTC (permalink / raw)
  To: andrew; +Cc: ecos-discuss


Thanks for your help.
i successessfully compiled the code in test file "file I01.c" that included 
testRomss.h. I built the Ecos library using template for leon which is my 
target processor.But when I run it on GRrMon, the simulator for leon, it 
seems the root directory is not been picked up because the following error 
come:
OpenDirreturned-1,No such entity

Any idea???

Regards Samie.
>From: Andrew Lunn <andrew@lunn.ch>
>To: Samie Hassan Ghauri <samiehg@hotmail.com>
>CC: ecos-discuss@sources.redhat.com
>Subject: Re: [ECOS] Accessing File from host system's OS filesystem
>Date: Thu, 12 Aug 2004 18:09:31 +0200
>
>On Thu, Aug 12, 2004 at 03:58:15PM +0000, Samie Hassan Ghauri wrote:
> > I have made the romfs including the bmp file using the utility given 
>with
> > the ecos package. But the image file is romfs.img.  How can make it part 
>of
> > my image? When it IS finally included, can I then use fdopen() and 
>ssize_t
> > read(int fd, void *buf, size_t nbyte) to extract bytes from the file, as
> > they are POSIX defined APIs?
>
>Take a closer look at the test case. It does exactly this. The cdl
>file contains some magic to uses some tcl to convert the binary to a
>char array in a header file which is compiled into the test case
>image.
>         Andrew

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] Accessing File from host system's OS filesystem
  2004-08-12 15:58 Samie Hassan Ghauri
@ 2004-08-12 16:09 ` Andrew Lunn
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Lunn @ 2004-08-12 16:09 UTC (permalink / raw)
  To: Samie Hassan Ghauri; +Cc: ecos-discuss

On Thu, Aug 12, 2004 at 03:58:15PM +0000, Samie Hassan Ghauri wrote:
> I have made the romfs including the bmp file using the utility given with 
> the ecos package. But the image file is romfs.img.  How can make it part of 
> my image? When it IS finally included, can I then use fdopen() and ssize_t 
> read(int fd, void *buf, size_t nbyte) to extract bytes from the file, as 
> they are POSIX defined APIs?

Take a closer look at the test case. It does exactly this. The cdl
file contains some magic to uses some tcl to convert the binary to a
char array in a header file which is compiled into the test case
image.
        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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] Accessing File from host system's OS filesystem
@ 2004-08-12 15:58 Samie Hassan Ghauri
  2004-08-12 16:09 ` Andrew Lunn
  0 siblings, 1 reply; 6+ messages in thread
From: Samie Hassan Ghauri @ 2004-08-12 15:58 UTC (permalink / raw)
  To: andrew; +Cc: ecos-discuss

I have made the romfs including the bmp file using the utility given with 
the ecos package. But the image file is romfs.img.  How can make it part of 
my image? When it IS finally included, can I then use fdopen() and ssize_t 
read(int fd, void *buf, size_t nbyte) to extract bytes from the file, as 
they are POSIX defined APIs?

Sorry for asking, perhaps quite basic questions but I am new to the world of 
RTOS, especially to eCos.

Thanks
Samie




>From: Andrew Lunn <andrew@lunn.ch>
>To: Samie Hassan Ghauri <samiehg@hotmail.com>
>CC: ecos-discuss@sources.redhat.com
>Subject: Re: [ECOS] Accessing File from host system's OS filesystem
>Date: Thu, 12 Aug 2004 09:40:58 +0200
>
>On Wed, Aug 11, 2004 at 10:28:31PM +0000, Samie Hassan Ghauri wrote:
> > Hi
> > I am running eCos on my PC on which Windows XP is installed. I want to
> > parse a BMP file in an application I wrote in ANSI C, which I now want 
>to
> > port to eCos. I have read how fileio system in the reference guide, but
> > still not sure how to read the BMP file that is saved in host system's 
>OS
> > filesystem.
> >
> > Can anyone share some fragment of code if somebody ever opened a file 
>from
> > native hard disk so that will serve as an example for me to follow?
>
>There is no support for NTFS in eCos. Only FAT is supported. So this
>is not possible. Maybe you can make a romfs and put the BMP file into
>that and make it part of the image. Take a look at the romfs test case
>for an example how to do this.
>
>         Andrew

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-08-14 10:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-11 22:28 [ECOS] Accessing File from host system's OS filesystem Samie Hassan Ghauri
2004-08-12  7:40 ` Andrew Lunn
2004-08-12 15:58 Samie Hassan Ghauri
2004-08-12 16:09 ` Andrew Lunn
2004-08-13 14:28 Samie Hassan Ghauri
2004-08-14 10:32 ` Bart Veer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).