Hi!
Thank you Rual. I followed your advice to look at thread
makefile for simple linux device driver (
http://www.niosforum.com/forum/index.php?showtopic=2411)
And I change my makefile in this way:
ifneq ($(KERNELRELEASE),)# kbuild part of makefile
obj-m := hello.o
else# Normal Makefile
KERNEL_PLUGIN:= /cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0
KERNELDIR := $(KERNEL_PLUGIN)/linux-2.6.x
BUILDDIR := /cygdrive/c/Entwicklung/NIOS/workspace3/hello_driver_linux
all::
$(MAKE) -C $(KERNELDIR) M=`pwd` O=$(BUILDDIR) -o $@
endif
I have set the variables
ARCH := nios2nommu
CROSS_COMPILE := nios2-elf-
as enviroment variables.
These all cause a lot of compiler errors, which are propably caused by path problems. I show you only the start and the end of all compiler errors:
/cygdrive/c/../linux/sched.h:1174: error: `task_unmapped_base' undeclared (first use in this function)
/cygdrive/c/../linux/sched.h:1175: error: dereferencing pointer to incomplete type
/cygdrive/c/../linux/sched.h:1176: error: dereferencing pointer to incomplete type
/cygdrive/c/../linux/sched.h: at top level:
/cygdrive/c/../linux/sched.h:1180: error: parse error before "pid"
/cygdrive/c/../linux/sched.h:1180: warning: function declaration isn't a prototype
/cygdrive/c/../linux/sched.h:1181: error: parse error before "pid"
/cygdrive/c/../linux/sched.h:1181: warning: function declaration isn't a prototype
/cygdrive/c/../linux/sched.h: in function `freeze_processes':
/cygdrive/c/../linux/sched.h:1209: warning: implicit declaration of function `bug'
in file included from /cygdrive/c/../linux/module.h:13,
from /cygdrive/c/entwicklung/nios/workspace3/hello_driver_linux/hello.c:1:
/cygdrive/c/../linux/stat.h:6:22: asm/stat.h: no such file or directory
in file included from /cygdrive/c/../linux/module.h:13,
from /cygdrive/c/entwicklung/nios/workspace3/hello_driver_linux/hello.c:1:
.............
.............
.............
/cygdrive/c/../linux/stat.h:70: error: storage size of `ctime' isn't known
{standard input}: assembler messages:
{standard input}:359: error: symbol `seq' is already defined
{standard input}:407: error: symbol `sem_nsems' is already defined
{standard input}:428: error: symbol `lock' is already defined
{standard input}:1159: error: symbol `flags' is already defined
{standard input}:1504: error: symbol `files' is already defined
{standard input}:1696: error: symbol `blocks' is already defined
make[3]: *** [/cygdrive/c/entwicklung/nios/workspace3/hello_driver_linux/hello.o] error 1
make[3]: target `__build' not remade because of errors.
make[2]: *** [_module_/cygdrive/c/entwicklung/nios/workspace3/hello_driver_linux] error 2
make[2]: target `_all' not remade because of errors.
make[1]: leaving directory `/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x'
make[1]: *** [_all] error 2
make: *** [all] error 2
Do somebody have an idea how can I avoid these errors?
Bye, Lothar.