Re: [kbuild-devel] Link lib to a kernel module
Hello Dipti, * Dipti Ranjan Tarai [EMAIL PROTECTED] [24-10-06 16:42]: As per my knowledge kernel module can not access to a library function. Library function are only accessible to user level program. Module can access exported symbol only. hm, it seems that it is possible to build a lib statically against a kernel module. So it whould be possible to link a kernel against a lib (not a shared lib). Best regards, Matthias -- Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning. -- Rich Cook - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ kbuild-devel mailing list kbuild-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kbuild-devel
Re: [kbuild-devel] Link lib to a kernel module
Hello Oleg, * Oleg Verych [EMAIL PROTECTED] [24-10-06 12:11]: `Documentation/kbuild' directory in your linux sources. `makefiles.txt' about `lib-y', `modules.txt' about modules. I was now successfull with: hello_lib.h: int printHello(int); hello_lib.c int printHello(int count) { int i; for(i=0;i=count;i++) { printk(Hello World\n); } return 0; } hello.c: #include linux/kernel.h #include linux/module.h #include hello_lib.h MODULE_LICENSE(GPL); int init_module(void) { printk(call function\n); printHello(5); return 0; } void cleanup_module(void) { printk(KERN_INFO remove module\n); return; } Makefile: KDIR:= /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) obj-m += test.o test-y := hello.o libhello_lib.a all: gcc -I/usr/include -c -o hello_lib.o hello_lib.c rm -f libhello_lib.a ar cru libhello_lib.a hello_lib.o $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules KBUILD_VERBOSE=1 Best regards, Matthias -- Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning. -- Rich Cook - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ kbuild-devel mailing list kbuild-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kbuild-devel
Re: [kbuild-devel] Link lib to a kernel module
On 2006-10-25, Matthias Fechner wrote: [] Makefile: KDIR:= /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) there's $(CURDIR), just in case... - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ kbuild-devel mailing list kbuild-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kbuild-devel
Re: [kbuild-devel] Link lib to a kernel module
Hallo, Matthias. On 2006-10-24, Matthias Fechner wrote: I tried today to link a lib (.a) to my kernel module but I could not found howto do it. `Documentation/kbuild' directory in your linux sources. `makefiles.txt' about `lib-y', `modules.txt' about modules. Good luck. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ kbuild-devel mailing list kbuild-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kbuild-devel