I have install the QorIQ-SDK-V1.9-20151210-yocto at /home/Yocto/QorIQ_SDK_V1.9/Project/QorIQ-SDK-V1.9-20151210-yocto. In addition to making bitbake fsl-image-minimal/fsl-image-mfgtoo/fs-toolchain success, I have installed the standalone toolchain at /opt/fsl-qoriq/1.9/. I write a helloworld driver program :
#include <linux/module.h>
#include <linux/init.h>
MODULE_LICENSE("GPL");
static int __init hello_init(void)
{
printk("\r\n\r\n 1 Hello world, begin");
return 0;
}
static void __exit hello_exit(void)
{
printk("\r\n 1 Hello world, exit\r\n");
return;
}
module_init(hello_init);
module_exit(hello_exit);
the Makefile:
ifneq ($(KERNELRELEASE),)
obj-m := hello.o
else
KERNELDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
all:
make -C $(KERNELDIR) M=$(PWD) modules
clean:
rm -rvf *.o *.mod.c *.mod.o
endif
the question is where the location should i give to KERNELDIR, and make the hello,ko can runing success at the demo board
thanks
Solved! Go to Solution.
It looks like that you want to compile kernel module.
See the following pages for this task.
http://docs.oracle.com/cd/E19253-01/817-5789/emjjr/index.html
http://www.yoctoproject.org/docs/1.6.1/kernel-dev/kernel-dev.html
Have a great day,
Pavel Chubakov
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
It looks like that you want to compile kernel module.
See the following pages for this task.
http://docs.oracle.com/cd/E19253-01/817-5789/emjjr/index.html
http://www.yoctoproject.org/docs/1.6.1/kernel-dev/kernel-dev.html
Have a great day,
Pavel Chubakov
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Use the similar command sequence for toolchain installed and standalone file compiling using SDK 1.9.
$ source ./fsl-setup-poky -m <machine>
$ bitbake fsl-toolchain
$ cd build_<machine>_release/tmp/deploy/sdk
$ ./fsl-networking-eglibc-<host-system>-<core>-toolchain-<release>.sh
Note: The default installation path for standalone toolchain is /opt/fsl-networking/. The install folder can be specified during the installation procedure.
QorIQ P2020
source /opt/fsl-qoriq/1.9/environment-setup-ppce500v2-fsl-linux-gnuspe
gcc test.c --sysroot=/opt/fsl-qoriq/1.9/sysroots/ppce500v2-fsl-linux-gnuspe -o test.c
Have a great day,
Pavel Chubakov
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thanks Pavel for your answer,
you cross_compile the user program[test.c] with the standalone toolchain, but i want to cross_compile a driver program[hello.c] with the standalone toolchain, can you help me?