(Demo_init); Module_exit (Demo_exit); Module_author ("libra13179"); Module_license ("GPL v2");MakefileVERS = $ (Shell uname-R) # Kernel Modulesobj-M + = for the module compilation. #EXTRA_CFLAGS /c3>=-g-o0build:kernel_moduleskernel_modules: -c/lib/modules/$ (kvers)/build m=$ (CURDIR) Modulesclean: -c/lib/modules/$ (kvers)/build m=$ (CURDIR) CleanMake TestUse the DMESG directive to viewUse Cat/proc/devices to see demo informationNow mainly introduces the use of DEMO.C in functions and macr
Linux Device Driver Article 4: Driver debugging methods, linux Article 4
In the previous article, we probably talked about how to write a simple character device driver. We are not a god, but there will certainly be a problem when writing code. We need to continuously debug
table items that the character device test occupies in the system character device table.A simple character device can be written. The file name is test. C.
Compile the following code:$ Gcc-O2-dmodule-d1_kernel _-C test. C //-C indicates that the output name is specified and the. o file is automatically generated.The file test. O is a
Linux Device Driver Article 5: concurrency and final state in the driver, linux Article 5Summary
In the previous article, I introduced the debugging method of the linux driver. This article describes the concurrency and status encountered in driver programming and how to han
mouse uses the PS/2 interface, but the USB interface also has more and more mouse, the two have their own advantages: Generally, the bandwidth of the USB mouse interface is greater than the PS/2 mouse, that is to say, in the same period of time, the number of USB mouse scans is more than PS/2, so that the USB mouse is more precise in positioning. At the same time, the default sampling rate of USB interface mouse is also relatively high, up to 125Hz, while the PS/2 interface only has 40Hz (Windo
Character device driversAn application is a function called open Read write in a C library. In order to operate the hardware, the driver module is introduced.Build a simple drive that has a few steps.1. Create File_operations2. Request a device number3. Registering character device drivers,4. Drive entry5. Drive exitCh
Citation: We know that every character device has a CDEV structure in the kernel that describes it, and one of the more important members of this structure isConst struct file_operations *ops;The function of this structure is to match the system call in the user program with the specific implementation function one by one in the driver. When invoking a system call to a character
This concept emerged when the new sysfs management device driver was adopted in linux2.6 and can be intuitively understood under the/sys directory.
Bus indicates the bus type, such as I2C, IDE, USB... many bus types such as platform, including MTD devices;
Device records device resources, specific to the NAND
system.
The table items occupied by the character device table.
A simple character device can be written. The file name is test. C.
Compile the following code
$ Gcc-O2-dmodule-d1_kernel _-C test. c
The file test. O is a device driver.
If the device
This section lists the system-defined Device InterfaceClassesThat support the following types of devices:
1394 and 61883Devices
Battery and ACPIDevices
BluetoothDevices
Display and ImageDevices
Interactive InputDevices
ModemDevices
NetworkDevices
Serial and parallelPort Devices
StorageDevices
Kernel streamingMedia devices
USBDevices
Windows portableDevices
Windows SideshowDevices
The following information is wrongly ded for each
1, create a device node in the/sys/class/directory, such as creating a CLASS_TEST_USB device node[CPP]View Plaincopy
Static struct CALSS *test_class;
Test_class = Class_creat (This_module,"Class_test_usb");
2, create another device node in the CLASS_TEST_USB directory android0, as follows[CPP]View Plaincopy
struct
Linux Device Driver inquiry 1st days ---- spi Driver (1), 1st days ---- spi
This document allows reprinting. Please indicate the source:Http://blog.csdn.net/fulinus
The Linux kernel code is too big, and a small module will make you feel helpless. This afternoon, I am determined to take a good look at the spi driver.
Fi
[Linux Device Driver] linux address type, linux Device address type
List of address types used in Linux:
User virtual addresses)
The normal address visible to the user space program. The virtual address length is 32-bit or 64-bit. It depends on the underlying hardware architecture. Each process has its own virtual address space.
Physical address (Physical address
the character device test occupies in the system character device table.
A simple character device can be written. The file name is test. c.
Compile the following code:
$ Gcc-O2-DMODULE-d1_kernel _-c test. c-c indicates that the output name is specified and the. o file is automatically generated.
The file test. o is a device
A system vulnerability in a taxi in Xiamen allows you to view the driver information (Remote Control of the playing device in the car \ acquisition of Xiamen taxi driver photo ID card number, etc)
Information of 2000 out 130 drivers cracked
Http://www.xm968890.com: 8008/Multimedia Electronic Program Dispatch System for taxis in XiamenUnauthorized access
Informat
Android, X Windows, QT, and many other applications support input devices, such as the keyboard, mouse, and touch screen, in Linux systems, or increasingly prefer the standard input subsystem.
Because the input subsystem has completed the character-driven file operation interface, the core task of writing the driver is to complete the interface set aside by the input system, with little workload. But if you want to apply it more flexibly, You need to
This article allows reprint, please specify the source:Http://blog.csdn.net/fulinusThe Linux kernel code is too big, a small module will let you unprepared, this afternoon resolved to take the SPI drive a good look.First analyze the spidev.c file, which defines the members in the struct file_operations structure. Members have Spidev_write, Spidev_read, and Spidev_ioctl, and the first two implement half-duplex communication, which implements full-duplex communication. Of course there are open and
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.