Hello World for linux Kernel Module

This commit is contained in:
root
2025-02-16 12:30:21 +02:00
commit 4e4b515f78
17 changed files with 1969 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
#include <linux/module.h>
#define INCLUDE_VERMAGIC
#include <linux/build-salt.h>
#include <linux/elfnote-lto.h>
#include <linux/export-internal.h>
#include <linux/vermagic.h>
#include <linux/compiler.h>
BUILD_SALT;
BUILD_LTO_INFO;
MODULE_INFO(vermagic, VERMAGIC_STRING);
MODULE_INFO(name, KBUILD_MODNAME);
__visible struct module __this_module
__section(".gnu.linkonce.this_module") = {
.name = KBUILD_MODNAME,
.init = init_module,
#ifdef CONFIG_MODULE_UNLOAD
.exit = cleanup_module,
#endif
.arch = MODULE_ARCH_INIT,
};
#ifdef CONFIG_RETPOLINE
MODULE_INFO(retpoline, "Y");
#endif
static const struct modversion_info ____versions[]
__used __section("__versions") = {
{ 0xbdfb6dbb, "__fentry__" },
{ 0x92997ed8, "_printk" },
{ 0x5b8239ca, "__x86_return_thunk" },
{ 0xc9d7e676, "module_layout" },
};
MODULE_INFO(depends, "");