I forgot a very simple C code from where I found it a long time ago, completed the character device registration, automatically obtained the device number (Master/Slave), and automatically created the device node.
I have posted some similar
I recently studied qq2440 and want to perform pose detection for underwater robots. It is very troublesome to use Linux to program device drivers, it is good to find an example on the Internet. copy it for backup.
On PC:
OBJ-M: = Hello. o
Static compilation, dynamic loadingThe application wants to access the kernel through a system callDriven:1. Module (package, add kernel)2. Kernel mechanism3. Operating HardwareWhen configuring Menuconfig in Kconfig, different types will display the
Code for writing kernel driver modulesThe required header files typically involved in the driver module:Specification of the entry function for the drive module:int __init entry_name (void){/*xxx*/return 0;}Module_init (Entry_name);Specification for
The kernel module is an external plug-in provided by the Linux kernel. It is called the dynamic loadable kernel module (lkm. The Linux Kernel provides a module mechanism because it is a single kernel ). The biggest advantage of a single kernel is
DriverProgramHello. c
##################################
# Include # Include Module_license ("dual BSD/GPL ");
Static int hello_init (void){Printk (kern_alert "Hello, world \ n ");Return 0;}
Static void hello_exit (void){Printk (kern_alert
Because the articles and experiments written in the Ubuntu environment do not have a tool that is easy to use in Linux, so there is not much screenshots, but hope haihan, but the descriptions are all in place.
I have been developing applications
Introduction APPRTC is what, webrtc.org official Experience App Ingredients: ubuntu14.04, other Linux versions are not limited, the official does not specify Chrome M51+stunnle Https://www.stunnel.org/ind Ex.htmlrfc5766-turn-server
Input: Apt-cache Search Linux-source//view kernel version
Input: Apt-get install linux-source-3.0.0//get the corresponding version of the kernel, by default installed in the/USR/SRC directory
See:
How to build the kernel source tree
The kernel module is a socket provided externally by the Linux kernel, which is known as the dynamic loadable kernel module (Loadable Kernel module,lkm), and is referred to as a module . The Linux kernel provides a modular mechanism because it
Reprint Annotated Source: http://blog.csdn.net/xhz1234/article/details/44278137 Copyright Xu Hongzhi (Macrosan). All rights reserved.A call relationship between modules is common, with two modules A, b,b using the function provided by the A module
++ The third part is the project organization of makefile. ++
Preface:If Library 1 depends on library 2 and the user only uses lib1, I haven't seen it yet. How can I avoid using-l library 2. That is to say, at the same time as-l database 1,-l
Generally, you can use a general makefile when writing the kernel driver, saving you from the trouble of writing your own. The following is a file I used: ifneq ($ (kernelrelease ),)
# Call from kernel build system
Module-objs: = Hello. o
OBJ-M: =
The entire process of making the hello. Ko kernel module in Linux
1. Linux system is used redflag 6.0 SP1: ftp://ftp.redflag-linux.com/pub/redflag/dt6sp1/SP1/redflag-6-sp1.iso, the system installation is very easy, the installation prompt is
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.