- 论坛徽章:
- 0
|
1. character driver
In a character driver, read() will be called for a character driver. In the sample, uiomove() is called to do the memory copy.
In the user space program, call read() to get the buffer from kernel.
2. block driver
In a block device driver, strategy() will be called for read and write. In the sample, bp_mapin() and bcopy() are used to do the memory copy.
In the user space control program, mmap() is called to map the memory of the file to the address space of the process. Then process could operate on the address return from mmap.
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/38597/showart_303507.html |
|