Drivers commonly use buffered I/O when callers transfer requests smaller than one page (4 KB) and use direct I/O for larger requests. A page is approximately the buffer size at which the trade-off between the copy operation of buffered I/O matches the overhead of the memory lock performed by direct I/O. File system drivers commonly use neither I/O because no buffer management overhead is incurred when data can be copied from the file system cache into the callers original buffer. The reason that most drivers dont use neither I/O is that a pointer to a callers buffer is valid only while a thread of the callers process is executing. If a driver must transfer data from or to a device in an ISR or a DPC routine, it must ensure that the callers data is accessible from any process context, which means that the buffer must have a system virtual address.
试一下,别笑话:
Drivers commonly use buffered I/O when callers transfer requests smaller than one page (4
KB) and use direct I/O for larger requests.
当callers传送的请求小于一页(4KB)时,驱动器通常使用缓冲的I/O,当请求大于一页时,使用直接I/O.
A page is approximately the buffer size at which the trade-off between the copy operation of
buffered I/O matches the overhead of the memory lock performed by direct I/O.
一页大概是缓冲器的大小,在此之上,与存储器最高界限相匹配的缓冲的I/O上的拷贝操作间的交换在直接的I/O上执行。
File system drivers commonly use neither I/O because no buffer management overhead is
incurred when data can be copied from the file system cache into the callers original
buffer.
文件系统驱动通常即不使用缓冲的I/o,也不是用直接I/o,因为当从文件系统的高速缓存区中把数据拷到原始缓冲器中
时不需要缓冲管理的耗费。
The reason that most drivers dont use neither I/O is that a pointer to a callers buffer
is valid only while a thread of the callers process is executing.
大多数驱动即不使用缓冲的I/o,也不是用直接I/o的原因是,只有当调用过程的一个线程在执行过程中时,指向调用的
缓冲的指针才是有效的。
If a driver must transfer data from or to a device in an ISR or a DPC routine, it must
ensure that the callers data is accessible from any process context, which means that the
buffer must have a system virtual address.
如果一个驱动程序必须要在ISR或DPC例行程序中传递数据到一个设备,或者从一个设备接收数据,那么它必须保证这个
调用的数据可以从任何处理上下文得到,也就是说缓冲器必须有一个系统虚拟地址。
接分愉快,谢谢!