Today, the infrared module found a strange phenomenon. When we compile the infrared source code in the module mode, we cannot say hkvs_root_dir undefined, but there is no problem in compiling in the build-in mode. At first we couldn't figure it out, I just bought this new book ildd. The first chapter is about the kernel module loading principle. I looked at it and understood that the original kernel build-in can be regarded as a big module, if the infrared module is compiled in build-in mode, it is of course no problem. He can access all global variables in this module. However, when the infrared module is compiled in this module, because hkvs_root_dir is only the global variable of the built-in kernel module, this global variable does not have an export and cannot be used by other modules, the above problem occurs. If the above conclusion is correct, the same is true for the functions of the build-in module. If you do not need to use the export, you only need to define the function without static. If you need to use the extern statement, you can declare that the kernel is a large module, different drivers are considered to be different modules. The ildd figure above shows the search path of the find_symbol symbol when the module is loaded to know that the kernel is a module, the exported symbols are all placed in the same section. The system suddenly occurred. the map content is indeed like this. The address of the exported symbol is connected. I didn't think about this in map.