First module

Create directory to keep your modules:
cd ~/proj
mkdir modules/hello-world

Copy Yocto’s hello world example or download from here: hello-world
cp ~/fsl-community-bsp/sources/poky/meta-skeleton/recipes-kernel/hello-mod/files/* ~/proj/modules/hello-world

Setup environment to use cross compile toolchain:
. /opt/poky/1.8.1/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi

Build the module:
make ARCH=arm KERNEL_SRC=~/proj/linux-wandboard-3.14.28 CROSS_COMPILE=arm-poky-linux-gnueabi-

Copy the module to the target device:
scp hello.ko root@wandboard-solo.local
(wandboard-solo.local is the target device hostname)

Login on target device the root and load module:
ssh root@wandboard-solo.local
insmod hello.ko

If module was loaded correctly “Hello World!” message should be logged. Type dmesg and verify that at the end of log entry “Hello World!” appears.  Now remove the module:
rmmod hello.ko
Verify that “Goodbye Cruel World!” entry appeared in the system log.

We are now ready to write a real device driver!