);
Read-copy-update
Read-copy-update (RCU) is also an advanced mutex mechanism.
Rarely used in drivers
Http://www.rdrop.com/users/paulmck/rclock/intro/rclock_intro.html
Optimized for situations where reads are frequent and rarely written
The protected resource should be accessed through a pointer
When the data structure needs to be modified, the write thread replicates first,
Memdev.h#ifndef _memdev_h#define _memdev_h#define mem_magic ' m ' #define Mem_restart _io (mem_magic, 0)//Use the kernel-provided macros to generate commands #define MEM _set _iow (mem_magic, 1, int)//change command to pass a shaping parameter to the kernel #endifDriver MEMDEV.C#include Application MEM_READ.C#include The device number is dynamically assigned in the driver and the device number assigned
question: I want to know what modules are built into the kernel in the Linux system and what parameters each module has. Is there a way to get a list of built-in modules and device drivers, along with their detailed information?
The modern Linux kernel is growing rapidly over time to support a large number of hardware
http://blog.csdn.net/yuesichiu/article/details/8286469The interruption of the device interrupts the normal scheduling and operation of processes in the kernel, and the system's quest for higher throughput is bound to require that the interrupt service program be as concise as possible. However, this good desire often does not coincide with reality.in most real systems, when interrupts arrive, the work to be done is often not short, and it may take a l
1. Write Linux device driver, require engineers have a certain hardware foundation, know how SRAM, Flash, SDRAM, disk read and write,The interface of UART, I²c, USB and other devices, polling, interrupt, DMA principle, PCI bus working mode and CPU memory management MMU.2. Have a good C language Foundation, can flexibly use the structure, pointers, function pointers and memory dynamic application and release
when a per-cpu variable is created. Each processor in the system will have a unique copy of the variable
does not need to be locked
can be saved in a fast cache of the appropriate processor
DEFI NE_PER_CPU (type, name);
get_cpu_var (variable);
put_cpu_var (variable);
per_cpu (variable, int cpu_id);
void *alloc_percpu (type);
void *__alloc_percpu (size_t size, size_t align);
per_cpu_ptr (vo
The method structure of the device file registration in the Linxu driver is also the body that provides the operation interface to the user layer, my version is 3.1.10Writing is not easy, reprint need to indicate the source: http://blog.csdn.net/jscese/article/details/43408625The prototype is defined in the kernel source/include/linux/fs.h:struct File_operations {struct module *owner; The first file_operati
critical section cannot be too long; spin----lock can be used in an interrupt contextSignal Volume----need a header file linux/semaphore.h----struct semaphore sem; Define the semaphore----Sema_init (sem,1); Initialize the semaphore----Down_interruptible (SEM); Get the semaphore----......//Critical area code----Up (SEM); Release semaphore----Description: The semaphore differs from the spin lock, which is a sleep lock that cannot be used in an interrup
function returns, any work function that was committed before the call does not run anywhere on the system.After you have finished using the work queue, you can call the following function to release the related resources:void Destroy_workqueue (struct work_queue_struct *queue);Shared queuesThe device driver can use the shared default work queue provided by the kernel.Initializing the WORK_STRUCT structurestatic struct work_struct jiq_work;Init_work
Today the Linux device Driver (third edition) of the first module Hello module compiled passed, this thing card for me for a long time, during which I spent a lot of time to see the Linux Program Design (second edition), finally today the mechanical completion of this experi
Clock management for linux Device Drivers (4) ---- it turns out to be a child
When I was a child, I saw a TV series called "Little Dragon man". You don't have to mention it. It's actually very inspirational. To find my mother, it's a great TV series, what are the children watching? Xuanyuan sword, god of every day, magic, illusion, and flashy stuff. Apart from co
When you start learning to drive, you compile the driver into a module and then manually set up the device node with the Mknod command to make it available to the application call. This is a common way to start debugging a driver. However, when there is a need to have the driver ready when the system starts, supply the layer program call. At this point, you can no longer manually set up the device node, but
Foreword
IfYou're holding this book, you may be asking yourself: Why "yet another"Linux Device Driver book? Aren't there already a bunch of them?The answer is: This book is a quantum leap ahead of the others.First,It is up-to-date, covering recent 2.6 kernels. Second, and moreImportant, this book is thorough. Most Device Driver books just coverThe topics descri
The Linux application layer wants to manipulate the API of the kernel layer, for example, to manipulate the relevant Gpio or register, which can be achieved by writing a character device driver.1, first in the Rootfs in the/dev/under the generation of a character device. Note The main device number and the from
The kernel is driven by a device.ProgramInteraction with I/O devices.
The device driver is included in the kernel and consists of data structures and functions that control one or more devices, these devices include hard disk, keyboard, mouse, monitor, network interface, and devices connected to the SCSI bus. Through a specific interface, each driver interacts with the rest of the kernel (including other drivers
The role of device driversThe operation of any computer system is the result of the combination of hardware and software, and the computer system's hardware and software accomplish each other.Application software engineers need to see a pure software world without hardware, and the hardware must be rendered transparently. Drive engineers to realize the invisibility of hardware to software engineers.Device Drivers
Linux character device driver programming process 1. first, some version information is useless, but not less # define _ NO_VERSION _ www.2cto.com # include
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.