Forum Discussion
Altera_Forum
Honored Contributor
20 years agoproblem with modules
I follow http://nioswiki.jot.com/wikihome/operating...duleprogarmming (http://nioswiki.jot.com/wikihome/operatingsystems/moduleprogarmming) but when I type in "modprobe hello" what I get is "modprobe...
Altera_Forum
Honored Contributor
20 years ago --- Quote Start --- originally posted by abg@Jul 20 2006, 10:16 AM ...
i have a question regarding the makefile posted by wgoosens. i've tried to compile a module with this makefile, but it seems to me that there is something missing in it, because when i try to run make, it says
<div class='quotetop'>quote
--- quote end ---
--- quote start ---
make -k all
make: nothing to be done for `all'. --- Quote End --- Maybe it's very simple, but I don't know what to add. To my eyes, it seems that I should add the objects to be compiled, for example, but I don't exactly how to do it. What am I missing? Thank you AleX <div align='right'><{post_snapback}> (index.php?act=findpost&pid=17035)</div> [/b] --- Quote End --- You should name your objects in the obj-m variable. If your module is named module.c make sure you have
# If KERNELRELEASE is defined, we've been invoked from the# kernel build system and can use its language.
ifneq ($(KERNELRELEASE),)
obj-m := module.o# Otherwise we were called directly from the command# line; invoke the kernel build system.
else
KERNELDIR = /usr/src/cross/linux-2.6.11
PWD := $(shell pwd)
default:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
endif Is see that in the Makefile I posted I listed hello.ko and it should be .o NOT .ko Next execute make as you would when compiling the kernel: ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc- make I hope these two steps will help you!