501 to adopt the technique suggested below. The local media subsystem will make |
501 to adopt the technique suggested below. The local media subsystem will make |
502 the physical address available to the media driver. A call to <xref href="GUID-D84A9903-AE0F-3F54-8833-E8956A88E26C.dita#GUID-D84A9903-AE0F-3F54-8833-E8956A88E26C/GUID-DD6773B4-9EF5-322F-B53D-29174DF3B3BF"><apiname>TLocDrvRequest::IsPhysicalAddress()</apiname></xref> returns |
502 the physical address available to the media driver. A call to <xref href="GUID-D84A9903-AE0F-3F54-8833-E8956A88E26C.dita#GUID-D84A9903-AE0F-3F54-8833-E8956A88E26C/GUID-DD6773B4-9EF5-322F-B53D-29174DF3B3BF"><apiname>TLocDrvRequest::IsPhysicalAddress()</apiname></xref> returns |
503 true. </p> <p>Consider the following case. A request has been made to read |
503 true. </p> <p>Consider the following case. A request has been made to read |
504 1024 bytes from a media device that has a block size of 512 bytes. The 1024 |
504 1024 bytes from a media device that has a block size of 512 bytes. The 1024 |
505 bytes start at offset +256 on the media device. </p> <fig id="GUID-30EA5683-9B12-59D6-88EF-21F4E84988B3"> |
505 bytes start at offset +256 on the media device. </p> <fig id="GUID-30EA5683-9B12-59D6-88EF-21F4E84988B3"> |
506 <image href="GUID-12CD8E91-4102-5253-A7DE-E5436028764F_d0e406936_href.png" placement="inline"/> |
506 <image href="GUID-12CD8E91-4102-5253-A7DE-E5436028764F_d0e412789_href.png" placement="inline"/> |
507 </fig> <p>To get the first 256 bytes, you must read the first block of 512 |
507 </fig> <p>To get the first 256 bytes, you must read the first block of 512 |
508 bytes from the media device. This can corrupt the physical memory passed in |
508 bytes from the media device. This can corrupt the physical memory passed in |
509 the I/O request. The solution is to read the first block from the media device |
509 the I/O request. The solution is to read the first block from the media device |
510 into an intermediate buffer. Copy the 256 bytes from that buffer into the |
510 into an intermediate buffer. Copy the 256 bytes from that buffer into the |
511 physical memory passed in the I/O request. </p> <p>To get the last 256 bytes, |
511 physical memory passed in the I/O request. </p> <p>To get the last 256 bytes, |