PCI IDE Controller: Difference between revisions
Jump to navigation
Jump to search
[unchecked revision] | [unchecked revision] |
Content deleted Content added
Line 806: | Line 806: | ||
===Read From ATAPI Drive=== |
===Read From ATAPI Drive=== |
||
Let's move to a part which is quite easier, it is to read from ATAPI Drive, i will not make the function write to ATAPI Drive, because the write Operation is very |
Let's move to a part which is quite easier, it is to read from ATAPI Drive, i will not make the function write to ATAPI Drive, because the write Operation is very complex and it should done by third-party tools (like Nero in Windows, and Brasero in Linux). |
||
ATAPI Drive is different from ATA Drives, as it doesn't use ATA Commands, but it use the SCSI-Command-Set. Parameters are sent into a Packet, so it is Called: ATA-Packet Interface [ATAPI]. |
ATAPI Drive is different from ATA Drives, as it doesn't use ATA Commands, but it use the SCSI-Command-Set. Parameters are sent into a Packet, so it is Called: ATA-Packet Interface [ATAPI]. |
||
Line 827: | Line 827: | ||
</source> |
</source> |
||
by this way, ide_wait_irq() will go into a while loop, which waits for the variable ide_irq_invoked to be set, then |
by this way, ide_wait_irq() will go into a while loop, which waits for the variable ide_irq_invoked to be set, then clears it. |
||
<source lang="c"> |
<source lang="c"> |
||
Line 836: | Line 836: | ||
* drive, is the drive number, which is from 0 to 3. |
* drive, is the drive number, which is from 0 to 3. |
||
* lba, the lba address. |
* lba, the lba address. |
||
* numsects, number of sectors, it should always be 1, and if you wanna read more than one sector, re-execute this |
* numsects, number of sectors, it should always be 1, and if you wanna read more than one sector, re-execute this function with updated LBA address. |
||
* selector, Segment Selector. |
* selector, Segment Selector. |
||
* edi, offset in the selector. |
* edi, offset in the selector. |
||
Line 933: | Line 933: | ||
<source lang="c"> |
<source lang="c"> |
||
// (IX): |
// (IX): Receiving Data: |
||
// ------------------------------------------------------------------ |
// ------------------------------------------------------------------ |
||
for (i = 0; i < numsects; i++) { |
for (i = 0; i < numsects; i++) { |