Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Sample Ethernet driver compilation in QNX Momentics: (13 Items)
   
Sample Ethernet driver compilation in QNX Momentics  
Hi,

Please tell  me how to compile sam.c(sample ethernet driver in QNX Momentics).

The following steps i itried it throws error.

1. Copy the iopkt build header files in to /usr/include directory and i gave make \
   
Error:No rule to make target.

Thanks and Regards
K.Senthil
Re: Sample Ethernet driver compilation in QNX Momentics  
On Tue, Oct 20, 2009 at 06:35:34AM -0400, Senthil K wrote:
> Hi,
> 
> Please tell  me how to compile sam.c(sample ethernet driver in QNX Momentics).
> 
> The following steps i itried it throws error.
> 
> 1. Copy the iopkt build header files in to /usr/include directory and i gave make \

Which directions are those?  The build procedure
is documented here:

http://community.qnx.com/sf/wiki/do/viewPage/projects.networking/wiki/Source_Guide


>    
> Error:No rule to make target.

Which Makefile are you using?  Do you even
have a Makefile?

-seanb
Re: Sample Ethernet driver compilation in QNX Momentics  
Hi Sean,

I download the QNX 6.4.1 Source code.

I copied the sam(ethernet driver)  folder from the downloaded source code and create new project in QNX Momentics and 
add the sam folder.

After add the sam folder,make file is already present in the folder.

I right click and gave the make.

I faced the error.

Thanks and Regards
K.Senthil
Re: Sample Ethernet driver compilation in QNX Momentics  
On Sun, Oct 25, 2009 at 10:25:42AM -0400, Senthil K wrote:
> Hi Sean,
> 
> I download the QNX 6.4.1 Source code.
> 
> I copied the sam(ethernet driver)  folder from the downloaded source code and create new project in QNX Momentics and 
add the sam folder.
> 
> After add the sam folder,make file is already present in the folder.
> 
> I right click and gave the make.
> 
> I faced the error.

I've never tried compiling it via the ide.  Maybe
someone else has some ideas.

-seanb
Re: Sample Ethernet driver compilation in QNX Momentics  
I'm getting an error when compiling the sample driver sam.c under 6.4.1.  

I get the error 

In file included from C:/QNX641/target/qnx6/usr/include/io-pkt/iopkt_driver.h:35,
                 from C:/workspace/pci_network_driver/sam.c:20:
C:/QNX641/target/qnx6/usr/include/io-pkt/sys/systm.h:237: warning: 'struct lwp' declared inside parameter list
C:/QNX641/target/qnx6/usr/include/io-pkt/sys/systm.h:237: warning: its scope is only this definition or declaration, 
which is probably not what you want

In systm.h, 'struct lwp' is not defined.  Its definition is inside a #ifndef __QNXNTO__ .. #endif so it is excludes 
since __QNXNTO__ is defined during compilation.

Is the definition of 'struct lwp' supposed to be found somewhere other than systm.h?

Thanks,
Gary Anderson
Re: Sample Ethernet driver compilation in QNX Momentics  
If the only line in the file to be compiled is

  #include <io-pkt/iopkt_driver.h>

you get the same error.  It looks like the io-pkt header files may not work correctly with 6.4.1.
Re: Sample Ethernet driver compilation in QNX Momentics  
On Wed, Nov 25, 2009 at 12:44:22PM -0500, gary anderson wrote:
> If the only line in the file to be compiled is
> 
>   #include <io-pkt/iopkt_driver.h>
> 
> you get the same error.  It looks like the io-pkt header files may not work correctly with 6.4.1.
> 

I suspect you don't have _KERNEL defined.

-seanb
Re: Sample Ethernet driver compilation in QNX Momentics  
The header file inclusions for building drivers is somewhat... complicated... since it assumes that there's a lot of BSD
 kernel headers available for use.  It was simplified considerably by creation of a single header file that pulls in a 
number of others, but it does require a specific order to the includes.  Have you modified the sample driver at all?

If you 
#include <io-pkt/iopkt_driver.h> 
before the sys/io-pkt.h include, does it make any difference?

  R.
Re: Sample Ethernet driver compilation in QNX Momentics  
Oops.  Ignore that previous e-mail.  I can see that this is what you were doing.  Make sure that you've got a clean 
install in place as well and that none of the system headers have been modified.

  R.
Re: Sample Ethernet driver compilation in QNX Momentics  
On Tue, Nov 24, 2009 at 05:56:10PM -0500, gary anderson wrote:
> I'm getting an error when compiling the sample driver sam.c under 6.4.1.  
> 
> I get the error 
> 
> In file included from C:/QNX641/target/qnx6/usr/include/io-pkt/iopkt_driver.h:35,
>                  from C:/workspace/pci_network_driver/sam.c:20:
> C:/QNX641/target/qnx6/usr/include/io-pkt/sys/systm.h:237: warning: 'struct lwp' declared inside parameter list
> C:/QNX641/target/qnx6/usr/include/io-pkt/sys/systm.h:237: warning: its scope is only this definition or declaration, 
which is probably not what you want
> 
> In systm.h, 'struct lwp' is not defined.  Its definition is inside a #ifndef __QNXNTO__ .. #endif so it is excludes 
since __QNXNTO__ is defined during compilation.
> 
> Is the definition of 'struct lwp' supposed to be found somewhere other than systm.h?

Can you post the full make output?

Thanks,

-seanb
Re: Sample Ethernet driver compilation in QNX Momentics  
Sean,

Your suspicion about _KERNEL not being defined did the trick.  I simply added #define _KERNEL at the beginning of sam.c 
and it now compiles and produces a dot-so.

I'm trying to create an io-pkt driver for a shared memory (in PCIe space) interface between two processors so I'm 
starting with sam.c.

Thanks,
Gary
Re: Sample Ethernet driver compilation in QNX Momentics  
On Wed, Nov 25, 2009 at 04:46:23PM -0500, gary anderson wrote:
> Sean,
> 
> Your suspicion about _KERNEL not being defined did the trick.  I simply added #define _KERNEL at the beginning of sam.
c and it now compiles and produces a dot-so.
> 

Since you're making a driver it should probably go in
CCFLAGS or the equivalent in your Makefile so that all files
are affected.

-seanb
Re: Sample Ethernet driver compilation in QNX Momentics  
If you look in the prodroot_pkt.mk file one level above the sample directory, you can see 
CCFLAGS += -D_KERNEL 

the sample driver common.mk has

include $(PRODUCT_ROOT)/prodroot_pkt.mk

so this should be taken care of for you unless the makefiles have been modified somehow (?)

    Robert