This is part-1 of the Embedded Linux Questions which surely gonna help you in your professional interviews. Here we are going to discuss about Toolchain, Kernel headers, blacklist the builtin driver, EXPORT_SYMBOL and EXPORT_SYMBOL_GPL, etc...
What is Toolchain?
- The Toolchain is a collection of the compiler, library, and other tools to generate executable as per the target architecture.
- It is a cross-compilation utility that installs on the host system.
What is the use of Kernel headers?
- Kernel headers are used to compile and build the kernel module. It provides the various function and data structure declaration that is used for the modules.
- Kernel header's version should be the same with the host Linux kernel.
Can I disable the builtin drivers from loading?
- For the loadable modules:
- in file /etc/modprobe.d/blacklist.conf, add below line to disable the modules form loading.
- blacklist <module name>
- For built-in module:
- In the device tree file, which module you want to disable.
- status = "disabled"
What is the advantage of adding __init and __exit to init/exit functions of the Linux Kernel Modules?
- __init macro has been used to initialize the kernel module. The kernel can reclaim the memory allocated to this module after the initialization process.
- __exit macro used to remove the module. The kernel can be reclaimed the memory during the shutdown.
Difference between EXPORT_SYMBOL and EXPORT_SYMBOL_GPL.
- Both are Macros.
- EXPORT_SYMBOL- This macro is used when you want to export the (function/variables) of the current module in any other module (whether it has a GPL license or not ).
- EXPORT_SYMBOL_GPL- It exports the (function/variables) of the current module to only GPL licensed Kernel module.