public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] I have a problem about ecos support "opendir" function or not? thank you~
@ 2006-09-22  7:22 謝享金 
  2006-09-22  9:46 ` Gary Thomas
  2006-09-22  9:48 ` Andrew Lunn
  0 siblings, 2 replies; 3+ messages in thread
From: 謝享金  @ 2006-09-22  7:22 UTC (permalink / raw)
  To: ecos-discuss

Hi,

I was trying to run kvm (cldc 1.1) on ecos. And my host os is red hat9 running on VMware workstation 5. The target I choose when I install ecos is 癒禮i386-elf癒穡.

I will test on linux, so I created a configuration ecos.ecc for linux (ecosconfig new linux) and make the kernel. (include and lib)

After making the ecos kernel, I was changing the cc to i386-elf-gcc of preverify tool in cldc 1.1

When making the file, there will have problem that 癒禮DIR癒穡 is undeclared. As you can see below, the dirent.h in ecos kernel has extern 癒禮DIR癒穡. However, there is no lib for DIR in ecos kernel.(there is no lib which declare the struct of DIR in ecos kernel)
 
So I want to ask is ecos support opendir operation? I was check on google, but it is hardly to find the same problem with me. I think is the problem happened because my ecos kernel has building in a wrong way. Or actually, ecos does not support the directory operation like opendir or readdir, etc.
Thank you ~


the error message is :
[root@localhost linux]# make
i386-elf-gcc -c -I../../src -I/opt/ecos/work/helloworld/kernel/install/include/ -DUNIX -DLINUX -DJAVAVERIFY -DTRIMMED -Di386   ../../src/check_class.c
i386-elf-gcc -c -I../../src -I/opt/ecos/work/helloworld/kernel/install/include/ -DUNIX -DLINUX -DJAVAVERIFY -DTRIMMED -Di386   ../../src/main.c
../../src/main.c: In function 'recurse_dir':
../../src/main.c:95: error: 'DIR' undeclared (first use in this function)
../../src/main.c:95: error: (Each undeclared identifier is reported only once
../../src/main.c:95: error: for each function it appears in.)
../../src/main.c:95: error: 'dir' undeclared (first use in this function)
../../src/main.c:101: warning: assignment makes pointer from integer without a cast
../../src/main.c:101: warning: assignment makes pointer from integer without a cast
../../src/main.c:103: error: dereferencing pointer to incomplete type
../../src/main.c:128: error: 'S_IFDIR' undeclared (first use in this function)
../../src/main.c: In function 'ProcessInputs':
../../src/main.c:200: error: 'S_IFDIR' undeclared (first use in this function)
../../src/main.c: In function 'main':
../../src/main.c:289: warning: incompatible implicit declaration of built-in function 'strdup'
make: *** [main.o] Error 1
 

In /ecos/install/include/dirent.h
/* PROTOTYPES */
extern DIR *opendir( const char *dirname );
extern struct dirent *readdir( DIR *dirp );
extern int readdir_r( DIR *dirp, struct dirent *entry, struct dirent **result );                                                                                
extern void rewinddir( DIR *dirp );
extern int closedir( DIR *dirp );
 

the code in cldc preverifier:
static void recurse_dir(char *dirname, char *pkgname)
{
    struct dirent *ent;
        char buf[MAXPACKAGENAME];
        char pkgbuf[MAXPACKAGENAME];
    DIR *dir = opendir(dirname);
                                                                                
    if (dir == NULL) {
        fprintf(stderr, "Can't open dir %s\n", dirname);
        exit(1);
    }
    for (ent = readdir(dir); ent; ent = readdir(dir)) {
        struct stat stat_buf;
        char *name = ent->d_name;
        int len;
                                                                                
        if (strcmp(name, ".") == 0 || strcmp(name, "..") == 0) {
            continue;
        }




Best Regards,
Tom Hsieh

-- 
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] 3+ messages in thread

* Re: [ECOS] I have a problem about ecos support "opendir" function  or not? thank you~
  2006-09-22  7:22 [ECOS] I have a problem about ecos support "opendir" function or not? thank you~ 謝享金 
@ 2006-09-22  9:46 ` Gary Thomas
  2006-09-22  9:48 ` Andrew Lunn
  1 sibling, 0 replies; 3+ messages in thread
From: Gary Thomas @ 2006-09-22  9:46 UTC (permalink / raw)
  To: "謝享金(tom)"; +Cc: ecos-discuss

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=Big5, Size: 1563 bytes --]

Á¨ɪ÷(tom) wrote:
> Hi,
> 
> I was trying to run kvm (cldc 1.1) on ecos. And my host os is red hat9 running on VMware workstation 5. The target I choose when I install ecos is ¡§i386-elf¡¨.
> 
> I will test on linux, so I created a configuration ecos.ecc for linux (ecosconfig new linux) and make the kernel. (include and lib)
> 
> After making the ecos kernel, I was changing the cc to i386-elf-gcc of preverify tool in cldc 1.1
> 
> When making the file, there will have problem that ¡§DIR¡¨ is undeclared. As you can see below, the dirent.h in ecos kernel has extern ¡§DIR¡¨. However, there is no lib for DIR in ecos kernel.(there is no lib which declare the struct of DIR in ecos kernel)
>  
> So I want to ask is ecos support opendir operation? I was check on google, but it is hardly to find the same problem with me. I think is the problem happened because my ecos kernel has building in a wrong way. Or actually, ecos does not support the directory operation like opendir or readdir, etc.
> Thank you ~

Your eCos configuration is too limited - the 'default' template doesn't
have this support built in.  Try configuring eCos via:
  % ecosconfig new linux net


-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

-- 
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] 3+ messages in thread

* Re: [ECOS] I have a problem about ecos support "opendir" function or not? thank you~
  2006-09-22  7:22 [ECOS] I have a problem about ecos support "opendir" function or not? thank you~ 謝享金 
  2006-09-22  9:46 ` Gary Thomas
@ 2006-09-22  9:48 ` Andrew Lunn
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2006-09-22  9:48 UTC (permalink / raw)
  To: ??????; +Cc: ecos-discuss

On Fri, Sep 22, 2006 at 03:22:34PM +0800, ?????? wrote:
> Hi,
> 
> I was trying to run kvm (cldc 1.1) on ecos. And my host os is red
> hat9 running on VMware workstation 5. The target I choose when I
> install ecos is ??i386-elf??.
>
> I will test on linux, so I created a configuration ecos.ecc for
> linux (ecosconfig new linux) and make the kernel. (include and lib)
>
> After making the ecos kernel, I was changing the cc to i386-elf-gcc
> of preverify tool in cldc 1.1
>
> When making the file, there will have problem that ??DIR?? is
> undeclared. As you can see below, the dirent.h in ecos kernel has
> extern ??DIR??. However, there is no lib for DIR in ecos
> kernel.(there is no lib which declare the struct of DIR in ecos
> kernel)

Have you include the fileio package in your eCos configuration?

     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] 3+ messages in thread

end of thread, other threads:[~2006-09-22  9:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-22  7:22 [ECOS] I have a problem about ecos support "opendir" function or not? thank you~ 謝享金 
2006-09-22  9:46 ` Gary Thomas
2006-09-22  9:48 ` Andrew Lunn

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).