2012年7月3日 星期二

[Linux] Kernel Module with no symbol version

Situation:
Compiling Kernel Module with hierarchy / cross module dependency (say there are EXPORT_SYMBOL in the kernel)
when you insert the child-module, it may cause you following error:
.... Unknown Symbol

You may call the following for further information
$ dmesg
...

[19729.170980] xrawdata0: no symbol version for DmaRegister
[19729.170984] xrawdata0: Unknown symbol DmaRegister

This may occur for all kernel module with kernel version >= 2.6.26

Solution:
1. Divide the Makefile according to the Hierarchy.
2. Make the Base first and let it generate the "Module.symvers".
3. Copy the "Module.symvers" to the directory of the child modules
4.Continue your Compilation and keep renewl the Module.Symvers.

OR
You can make a link of "Module.Symvers" to your kernel source Directory at all your modules source directory to keep your Module.Sysmvers being updated.

Make sure you have run "make vmlinux" before any kernel module compilation. 

[Xilinx] ISE & Impact

Simply, DONT USE UBUNTU over 10.10 if you want your impact function well.

2012年7月1日 星期日

[Linux] Xilinx Cable Driver Can't be Compiled


Situation:

When you compile Xilinx Cable Drier with Linux Kernel >= 2.6.36
(when you run: $Xilinx/14.1/ISE_DS/common/bin/lin/install_script/install_drivers/install_drivers)

This may cause the following problem:

/vlsi/Xilinx/14.1/ISE_DS/common/bin/lin/install_script/install_drivers/linux_drivers/xpc4drvr2_6/xpc4drvr/xpc4.c:241:2: error: unknown field ‘ioctl’ specified in initializer

Solution:

Open:
$Xilinx/14.1/ISE_DS/common/bin/lin/install_script/install_drivers/linux_drivers/xpc4drvr2_6/xpc4drvr/xpc4.c

Add @ top:
#include <linux/slab.h>

@Line 163:
- int xpc4_ioctl (struct inode *inode, struct file *filp,
+ int xpc4_ioctl (struct file *filp,

@Line 240:
- .ioctl = xpc4_ioctl,
+ .unlocked_ioctl = xpc4_ioctl,



========

This may be useful while you try to install Xilinx Cable Driver.
The Kernel Module Driver is not compile-able after 2.6.36

Hacking Material

http://lwn.net/Articles/119652/
http://hi.baidu.com/kkernel/item/ea0ae8f4abb46929743c4c96