Hi, Thanks for the many replies. The code is compiling as a kernel module... and is also getting inserted ...however the printk doesn't seem to print to the linux console...i have used printk("<1> ....\n"); i am using linux 2.4.9. Is there any option i have to set to enable printing from kernel modules.. thanks in advance chester btw .. i intended to say pci_find_device in my previous mail. On Mon, 17 Sep 2001, Chester Rebeiro wrote: > Hi, > I'm trying to use the linux kernel API's for PCI in a program as shown > below.. The code is compiling but not linking... > it is giving the following linker error > ---------------------------------------------------------------------- > /tmp/cce56FvJ.o: In function `main': > /tmp/cce56FvJ.o(.text+0x29): undefined reference to `pci_find_deivice' > ----------------------------------------------------------------------- > #include <linux/config.h> > #include <linux/pci.h> > #define VENDOR_ID 0x8086 > #define DEVICE_ID 0x1234 > > int main(int argc, char **argv) { > struct pci_dev* d; > d = (struct pci_dev *) pci_find_deivice(VENDOR_ID,DEVICE_ID,d); > return 0; > } > --------------------------------------------------------------------- > I would appriciate it if someone could tell me how to link it or what > libraries i need to link this program > > Thanks in advance !!! > Chester > > - Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ IRC Channel: irc.openprojects.net / #kernelnewbies Web Page: http://www.kernelnewbies.org/