⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hello.mod.c

📁 Linux 2.6版本下的简单的字符设备模块示例
💻 C
字号:
#include <linux/module.h>#include <linux/vermagic.h>#include <linux/compiler.h>MODULE_INFO(vermagic, VERMAGIC_STRING);struct module __this_module__attribute__((section(".gnu.linkonce.this_module"))) = { .name = KBUILD_MODNAME, .init = init_module,#ifdef CONFIG_MODULE_UNLOAD .exit = cleanup_module,#endif};static const struct modversion_info ____versions[]__attribute_used____attribute__((section("__versions"))) = {	{ 0x89e24b9c, "struct_module" },	{ 0xf2a644fb, "copy_from_user" },	{ 0x2da418b5, "copy_to_user" },	{ 0x5e22fdec, "cdev_add" },	{ 0xd2248aac, "cdev_init" },	{ 0x29537c9e, "alloc_chrdev_region" },	{ 0x19070091, "kmem_cache_alloc" },	{ 0xab978df6, "malloc_sizes" },	{ 0x37a0cba, "kfree" },	{ 0x7485e15e, "unregister_chrdev_region" },	{ 0x70ecc9b2, "cdev_del" },	{ 0x1b7d4074, "printk" },};static const char __module_depends[]__attribute_used____attribute__((section(".modinfo"))) ="depends=";MODULE_INFO(srcversion, "F99EC0260327081E1334014");

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -