Can someone please tell me what version of software i have to use to build a kernel module.
Kernel version 3.10.49 perf .....aarch64

Dani AI

Generated

Short answer: building joydev.ko for a device running Linux 3.10.49 (aarch64) requires the kernel sources/headers that exactly match that running kernel plus a C toolchain. was right to call out the compiler + headers requirement; ’s pointer toward device-specific forums is sensible because the vendor/kernel tree for the K5 Vibe is the usual place to get a matching 3.10.49 source tree. The joystick frontend is the kernel’s joydev driver (CONFIG_INPUT_JOYDEV → joydev.ko). joydev documentation. (docs.kernel.org)

Checklist and build recipe (minimal, repeatable):

  • Record the exact kernel release and config from the phone: uname -r and, if available, zcat /proc/config.gz > running.config (or /boot/config-$(uname -r)). [how to get running kernel .config]. (baeldung.com)
  • Get the vendor/kernel source that matches that kernel (vendor GPL source or device tree on XDA/GitHub). Prepare the kernel tree (or use installed headers at /lib/modules/$(uname -r)/build). Build external module with kbuild. Example (on host or directly on device when headers are present):
# build against installed headers on device
make -C /lib/modules/$(uname -r)/build M=$PWD modules

# cross-compile for arm64 against a kernel source directory
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -C /path/to/kernel/src M=$PWD modules

See the kernel kbuild external-modules guide. (kernel.org)

Troubleshooting and cautions: the kernel must have modules enabled and the header tree/config must match exactly; if symbols are missing the build needs Module.symvers or a full kernel build (modules_prepare does not build full Module.symvers). Android phones can add extra hurdles (missing insmod/modprobe, SELinux policies, or module-signing enforcement in the kernel), so check dmesg for loader errors and the kernel config for CONFIG_MODULE_SIG/CONFIG_MODVERSIONS. Follow kbuild guidance on module versioning and symbol handling. (kernel.org)

Recommended Answers

All 2 Replies

You just need a standard GNU C compiler to build a kernel module. You have to learn how to unpackage kernel source with dependencies so you get the headers and such that you need to build the module. In any case, your question indicates that you have some serious studying and experimentation to do before you are ready for this, unless that module has already packaged it to build easily, much like nVidia kernel modules. Even in that case, you still need the kernel headers and such to build them.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.