How to compile a LINUX Device Driver

Source: Internet
Author: User
For details about how to compile a LINUX Device Driver-general Linux technology-Linux programming and kernel information, see the following. Http://www.it.com.cn/f/edu/0411/30/53811.htm
Follow the connection example above to write the device driver
The following error is returned.
Test. c: 13: warning: 'struct file' declared inside parameter list
Test. c: 13: warning: its scope is only this definition or declaration, which is probably not what you want
Test. c: 13: warning: 'struct inode' declared inside parameter list
Test. c: In function 'read _ test ':
Test. c: 18: 'verify _ write' undeclared (first use in this function)
Test. c: 18: (Each undeclared identifier is reported only once
Test. c: 18: for each function it appears in .)
Test. c: 21: parse error before ""
Test. c: At top level:
Test. c: 30: warning: 'struct file' declared inside parameter list
Test. c: 30: warning: 'struct inode' declared inside parameter list
Test. c: 35: warning: 'struct file' declared inside parameter list
Test. c: 35: warning: 'struct inode' declared inside parameter list
Test. c: In function 'open _ tibet ':
Test. c: 37: 'mod _ ING_USE_COUNT 'undeclared (first use in this function)
Test. c: At top level:
Test. c: 41: warning: 'struct file' declared inside parameter list
Test. c: 41: warning: 'struct inode' declared inside parameter list
Test. c: In function 'release _ tibet ':
Test. c: 43: union has no member named 'usecount'
Test. c: At top level:
Test. c: 46: variable 'test _ fops 'has initializer but incomplete type
Test. c: 47: warning: excess elements in struct initializer
Test. c: 47: warning: (near initialization for 'test _ fops ')
Test. c: 48: warning: excess elements in struct initializer
Test. c: 48: warning: (near initialization for 'test _ fops ')
Test. c: 49: 'write _ test' undeclared here (not in a function)
Test. c: 49: warning: excess elements in struct initializer
Test. c: 49: warning: (near initialization for 'test _ fops ')
Test. c: 50: warning: excess elements in struct initializer
Test. c: 50: warning: (near initialization for 'test _ fops ')
Test. c: 51: warning: excess elements in struct initializer
Test. c: 51: warning: (near initialization for 'test _ fops ')
Test. c: 52: warning: excess elements in struct initializer
Test. c: 52: warning: (near initialization for 'test _ fops ')
Test. c: 53: warning: excess elements in struct initializer
Test. c: 53: warning: (near initialization for 'test _ fops ')
Test. c: 54: 'Open _ test' undeclared here (not in a function)
Test. c: 54: warning: excess elements in struct initializer
Test. c: 54: warning: (near initialization for 'test _ fops ')
Test. c: 55: 'release _ test' undeclared here (not in a function)
Test. c: 55: warning: excess elements in struct initializer
Test. c: 55: warning: (near initialization for 'test _ fops ')
Test. c: 56: warning: excess elements in struct initializer
Test. c: 56: warning: (near initialization for 'test _ fops ')
Test. c: 57: warning: excess elements in struct initializer
Test. c: 57: warning: (near initialization for 'test _ fops ')
Test. c: In function 'init _ module ':
Test. c: 64: parse error before '= 'token
Test. c: 67: 'kern _ info' undeclared (first use in this function)
Test. c: 67: parse error before string constant
/Usr/include/linux/timer. h: At top level:
Test. c: 46: storage size of 'test _ fops 'isn' t known

I have read the third chapter of that book, but I don't understand it in many places because there are no specific examples. Please help me. Thank you !!!

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.