Linux kernel module problems-General Linux technology-Linux programming and kernel information, the following is a detailed description. This is my query information.
Linux kernel module problem insmod: error inserting './hello. ko':-1 Invalid module format
Root @ a123-virtual-machine: // mnt/hgfs/Win/device/04/hello # modinfo hello. ko
I changed 2.6.30.4 to 2.6.30-8-generic de according to the method found on the Internet, but the problem still persists. on the Internet, I also said that the same source code as the kernel needs to be downloaded, but I have not found 2.6.38-8-generic kernel source code, which man to give an address or send to the mailbox 635432187@qq.com. Or give a successful solution.
Makfile
Obj-m: = hello. o
Code: /* ===================================================== ======================================
A simple kernel module: "hello world"
The initial developer of the original code is Baohua Song
. All Rights Reserved.
========================================================== ===================================== */
# Include
# Include
MODULE_LICENSE ("Dual BSD/GPL ");
Static int hello_init (void)
{
Printk (KERN_INFO "Hello World enter \ n ");
Return 0;
}
Static void hello_exit (void)
{
Printk (KERN_INFO "Hello World exit \ n ");
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service