Linux kernel module problems

Source: Internet
Author: User
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

Filename: hello. ko

Alias: a simplest module

Description: A simple Hello World Module

Author: Song Baohua

License: Dual BSD/GPL

Srcversion: AF31C8A811E72E11F852B3E

Depends:

Vermagic: 2.6.38-8-generic mod_unload modversions ARMv5

Root @ a123-virtual-machine: // mnt/hgfs/Win/device/04/hello # uname-r

2.6.38-8-generic

Where

Vermagic: 2.6.38-8-generic mod_unload modversions ARMv5

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 ");
}

Module_init (hello_init );
Module_exit (hello_exit );

MODULE_AUTHOR ("Song Baohua ");
MODULE_DESCRIPTION ("A simple Hello World Module ");
MODULE_ALIAS ("a simplest module ");

Solving

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.