This action will force synchronization from linuxkerneltravel/LearningLinuxKernel, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
/*********************************************************** Author : 梁金荣* Email : Liangjinrong111@163.com* Last modified : 2019年09月14日 13:00* Filename : exnum.c* Description : 模块初始化函数中求最大数(使用内核中的代码)* *******************************************************//***必要的头文件*/#include<linux/kernel.h>#include<linux/module.h>#include<linux/init.h>static int a,b ;module_param(a, int, 0644);MODULE_PARM_DESC(a, "data of a");module_param(b, int, 0644);MODULE_PARM_DESC(b, "data of b");/***模块的初始化函数,模块的入口函数,加载模块,需超级用户权限*/static int __init lk_exnum(void){printk("Linux kernel param max number module is starting here!\n");printk("a = %d, b = %d\n", a, b);printk("max=%d\n", max(a,b));return 0;}/***出口函数,卸载模块,需超级用户权限*/static void __exit lk_exit(void){printk("Linux kernel param max number moudle has exited!\n");}module_init(lk_exnum); //内核入口点,调用初始化函数,包含在module.h中module_exit(lk_exit); //出口点MODULE_LICENSE("GPL"); //许可证MODULE_AUTHOR("ljr"); //作者(非必须)MODULE_DESCRIPTION("Linux kernel param max number"); //模块描述(非必须)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。