~frey/linux/
Linux Device Drivers Examples
Purpose
The examples below show some code and explanations to solve various problems with Linux device drivers that I run into while writing drivers for our development projects.
Mapping Memory to user space
shows how to map
vmalloc()
allocated memory from a device driver to user space.
It contains a function
virt_to_kseg()
that calculates the address in the 1:1 virtual to physical mapping kernel virtual memory view out of a general kernel virtual memory address. This function can also be useful e.g. to do DMA into such an address.
Starting and Stopping Kernel Threads
shows how to start and stop kernel threads in a loadable module.
阅读(748) | 评论(0) | 转发(0) |