I found and corrected the problem with the “insmod: ERROR: could not insert module ./altera_dma.ko: Invalid module format” error. The /usr/src/linux-headers-3.10.96+/ directory is an exact copy of the original /usr/src/linux-headers-3.10.96-tegra/ directory and the Makefile contains the line
EXTRAVERSION = -tegra
which should be
EXTRAVERSION = +
This was causing a version magic mismatch.
I’m now past that, but still not out of the woods. Now I get
insmod: ERROR: could not insert module ./altera_dma.ko: Unknown symbol in module
with driver messages
[ 1383.130947] altera_dma: Unknown symbol copy_from_user (err 0)
[ 1383.130978] altera_dma: Unknown symbol kzalloc (err 0)
[ 1383.130995] altera_dma: Unknown symbol copy_to_user (err 0)
References to these functions show up throughout the Linux headers in /usr/src/linux-headers-3.10.96+/. Any thoughts on making these known to insmod?
Symbols are created any time features are enabled in a kernel. One symbol may depend on another, e.g., perhaps you need a block device feature before a loopback encryption feature can work. The missing symbol is likely due to needing to enable some other feature which your module depends on. If the altera_dma module was enabled via the “make menuconfig” or “make nconfig” type editor, then dependencies such as this should have also been enabled…but if you build modules outside of the main kernel source you will need to manually determine which config provides the missing symbol and build that module as well…followed by inserting the dependency module prior to the altera_dma module.
The trick is to find the feature name (“CONFIG_something”) providing that symbol :P
You need to run make modules_prepare. See nvl4t_docs/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide/l4t_getting_started.html#wwpID0E0DE0HA in the Tegra Linux Driver Package Development Guide for more information.