9 --> |
9 --> |
10 <!DOCTYPE concept |
10 <!DOCTYPE concept |
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
12 <concept id="GUID-EBF025DB-1552-5E99-8C07-09932DB60552" xml:lang="en"><title>Physical |
12 <concept id="GUID-EBF025DB-1552-5E99-8C07-09932DB60552" xml:lang="en"><title>Physical |
13 Channel Implementation</title><shortdesc>A media driver must implement a physical channel class derived |
13 Channel Implementation</title><shortdesc>A media driver must implement a physical channel class derived |
14 from the <apiname>DMediaDriver</apiname> base class. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
14 from the <codeph>DMediaDriver</codeph> base class. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
15 <p/> |
15 <p/> |
16 <p>This includes those drivers associated with fixed media, such as the internal |
16 <p>This includes those drivers associated with fixed media, such as the internal |
17 drive, or removable media, such as a PC Card or MultiMediaCard. </p> |
17 drive, or removable media, such as a PC Card or MultiMediaCard. </p> |
18 <p> <codeph>DMediaDriver</codeph> is an abstract class that has virtual functions |
18 <p> <codeph>DMediaDriver</codeph> is an abstract class that has virtual functions |
19 that must be implemented by your derived class. The following class definition |
19 that must be implemented by your derived class. The following class definition |
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_d0e396579_href.png" placement="inline"/> |
506 <image href="GUID-12CD8E91-4102-5253-A7DE-E5436028764F_d0e418369_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, |