Linux Kernel Developing
U-boot and Kernel Compilation
a. Ubuntu: sudo apt-get install gcc-arm-linux-gnueabi/gcc-arm-linux-gnueabihf
or
b. Get from linaro.org : wget -c https://releases.linaro.org/14.04/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.8-2...
2. Get U-boot code source
3. Get Kernel source with Wandboard support
or
git checkout wandboard_imx_3.0.35_4.1.0
b. Kernel Configuration ( load the wandboard config )
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- wandboard_defconfig
or
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- menuconfig
c. Kernel Compilation
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
4. Prepare the sdcard:
I. Copy the u-boot on the sdcard
II. Partitionating the sdcard
|||. Download a RFS and put on the sdcard
wget -c
https://rcn-ee.net/deb/minfs/wheezy/debian-7.5-minimal-armhf-2014-07-07.tar.xzIV. Setup the u-boot:
Kernel devices
Realise a kernel device controlled from user space. The following steps will be done on the virtual machine.
NEEDED: Get the Virtual Box softwarte: https://www.virtualbox.org/wiki/Downloads
a . First determine the kernel version from target platform:
b. Now go to the directory tasks/kernel. Create a function void hello() which prints “Hello World”. It should be called when the device is inserted.
c. Compile the module : make
d. Insert the module on the virtual machine : insmod lec_cdev.ko
e. See if the module is inserted
f. Remove the kernel module : rmmod lec_cdev.ko
2. Create the device lec_cdev using mknod /dev/lec_cdev c 243 0
3. Implement the read function of the device in order to have the following effect:
If command is
HINT: use functions
* copy_to_user(user_buffer, kernel_buffer, size)
* copy_from_user(kernel_buffer, user_buffer , size)