One of requirements of Linux device driver development in 2.6 kernel series is that we need its header (and some of its object files). Therefore, it’s necessary to compile the kernel first before it can be used as kernel header for device driver development.
For TS-7260, download the kernel from TS-Logic site (here). Note that you need the exact version of the kernel that run on your board to develop device driver that’s running on it.
Configuring The Kernel
- Untar the kernel: tar xvzf tskernel-2.6.21-ts-src.tar.gz
- Configure the kernel:
kunil@cerpelai$ cd linux-2.6.21-ts/ kunil@cerpelai$ make CROSS_COMPILE=$PREFIX distclean kunil@cerpelai$ make CROSS_COMPILE=$PREFIX ts72xx_defconfig
Note: Replace $PREFIX with the correct prefix of the cross compiler.
- For cross-compiler with old-EABI, you need to turn off the new EABI features in the kernel. Otherwise, it won’t compile
kunil@cerpelai$ make CROSS_COMPILE=$PREFIX menuconfig
Disable the ‘Kernel Features’->’Use the ARM EABI to compile the kernel’. Save and exit.
- Compile the kernel
kunil@cerpelai$ make CROSS_COMPILE=$PREFIX -j 50 all
That’s it. Your kernel tree now can be used as device driver development tree.
If you want to save space for your harddisk, you can extract the objects and headers that is needed for device driver development
kunil@cerpelai$ make CROSS_COMPILE=$PREFIX INSTALL_HDR_PATH=<your choosen header directory> headers_install
Leave a comment