J'ai une question concernant l'affichage de la version du noyau de mon programme C du module noyau. donc après l'insertion je suis capable de voir ma version de noyau quand j'affiche des messages de log par dmesg. Donc mon code C simple est comme ci-dessous et s'il vous plaît quelqu'un peut-il me dire comment je peux afficher la version du noyau après l'insertion et même si je veux insérer "who" dans le programme alors. alors ici vous me donnez une solution comment programmer ou quelle structure je dois inclure afin que je puisse afficher la version du nom d'hôte et du noyau après l'insertion du module.Comment afficher la version du noyau lorsque j'insère un module dans un fichier c uniquement?
Programme:
#include<linux/init.h> //for init modules
#include<linux/module.h> //for kernel modules
#include<linux/kernel.h> //for kernel function
MODULE_LICENSE("GPL"); //For giving licence to module
MODULE_AUTHOR("RAVI BHUVA"); //For authorization of module
static int __init init_hello(void) //for initialation of module this function is used
{
printk(KERN_INFO "Hello Master. \nYou are currently using linux ");
return(0);
}
static void __exit exit_hello(void) //for exiting from module this function is used
{
printk(KERN_INFO "Good Bye\n");
}
module_init(init_hello); //for initialation of module
module_exit(exit_hello); //for exiting from module