So I have spent waaaay too much time this holiday trying to do something useful with the Samsung sources. But it's all in a state of misery.
1. CodeSourcery (CS) compiler works great and is very easy to use to install and compile "HelloWorld" program.
2. Samsung VDLinux toolchain is completely useless in Cygwin environment...
3. Trying to use CS + Cygwin (Windows) to compile a HelloWorld kernel
module has failed big time. I just have no idea what the hell is so messed up!? It seem that the Samsung sources (UExxES6xxx.zip) seem FUBAR and simple shit like make fails miserably... This is where I have wasted all my time... They have hardcoded weird shit into the Makefile.
At this point I have not managed to produce a single module using make and the Samsung sources! :( I'm quite sure I've been following most standards procedures for doing it. I have read hundreds of pages on this the last few days. In theory this should be close to trivial...
What I'm trying to do is just compiling the hello world kernel module: hellok1.c
Code: Select all
#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_ALERT */
MODULE_LICENSE("GPL");
MODULE_AUTHOR("E:V:A 2013");
MODULE_DESCRIPTION("Demo kernel module for MST-X10P (ARM Cortex A9)");
int init_module(void) {
printk(KERN_ALERT "E:V:A is in the Kernel!\n");
return 0;
}
void cleanup_module(void) {
printk(KERN_ALERT "Goodbye TV Kernel!\n");
}
using this Makefile:
Code: Select all
ifneq ($(KERNELRELEASE),)
# Kbuild part
obj-m += hellok1.o
else
PWD := $(shell pwd)
KERNELDIR := /cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11
MOREHEADS := /cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11/include
EXTRA_CFLAGS += -march=armv7-a -mcpu=cortex-a9 -marm -mlittle-endian -mglibc -static -I$(MOREHEADS)
default:
$(MAKE) -C $(KERNELDIR) M=$(PWD) O=$(PWD) modules
endif
Then after having edited in/out all sort of garbage the top level Makefile, referring directly to faulty $CC links, VDLinux toolchains, and crappy ARCH detection code. I get this:
Code: Select all
$ make -w V=1
make: Entering directory `/cygdrive/d/zarm/myarm/kernel_modules'
make -C /cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11 M=/cygdrive/d/zarm/myarm/kernel_modules O=/cygdrive/d/zarm/myarm/kernel_modules modules
make[1]: Entering directory `/cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11'
make -C /cygdrive/d/zarm/myarm/kernel_modules \
KBUILD_SRC=/cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11 \
KBUILD_EXTMOD="/cygdrive/d/zarm/myarm/kernel_modules" -f /cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11/Makefile modules
test -e include/generated/autoconf.h -a -e include/config/auto.conf || ( \
echo; \
echo " ERROR: Kernel configuration is invalid."; \
echo " include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
echo; \
/bin/false)
ERROR: Kernel configuration is invalid.
include/generated/autoconf.h or include/config/auto.conf are missing.
Run 'make oldconfig && make prepare' on kernel src to fix it.
mkdir -p /cygdrive/d/zarm/myarm/kernel_modules/.tmp_versions ; rm -f /cygdrive/d/zarm/myarm/kernel_modules/.tmp_version
s/*
WARNING: Symbol version dump /cygdrive/d/zarm/myarm/kernel_modules/Module.symvers
is missing; modules will have no dependencies and modversions.
make -f /cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11/scripts/Makefile.build obj=/cygdrive/d/zarm/myarm/kernel_modul
es
(cat /dev/null; ) > /cygdrive/d/zarm/myarm/kernel_modules/modules.order
make -f /cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11/scripts/Makefile.modpost
scripts/mod/modpost -i /cygdrive/d/zarm/myarm/kernel_modules/Module.sym
vers -I /cygdrive/d/zarm/myarm/kernel_modules/Module.symvers -o /cygdrive/d/zarm/myarm/kernel_modules/Module.
symvers -S -w -s
/bin/sh: scripts/mod/modpost: No such file or directory
/cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11/scripts/Makefile.modpost:91: recipe for target `__modpost' failed
make[3]: *** [__modpost] Error 127
/cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11/Makefile:1351: recipe for target `modules' failed
make[2]: *** [modules] Error 2
Makefile:126: recipe for target `sub-make' failed
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11'
Makefile:91: recipe for target `default' failed
make: *** [default] Error 2
make: Leaving directory `/cygdrive/d/zarm/myarm/kernel_modules'
The ERROR and WARNING above seem FUBAR as all those files ARE present.
I also tried to put the include directory in my local (hellok1.c) directory. No go!
So could someone please send me:
1. a correct local Makefile for a working compilation of the hellok1.c module above?
2. some instruction of what files (config, Makefile etc) that need changing.
3. A short description of the compilation procedure... - I.e. What files goes where? etc. The instructions provided in "HOW_TO_BUILD_X9X10.txt" obviously doesn't work!
Cheers!
PS. This will be part of the Wiki entry...