OSDev.org
https://forum.osdev.org/

ATA driver
https://forum.osdev.org/viewtopic.php?f=13&t=33298
Page 1 of 1

Author:  grenders22 [ Mon Nov 05, 2018 11:48 am ]
Post subject:  ATA driver

Good day! The ATA driver successfully works in the QEMU, but does not work on the real machine. Status is always 0xff. What could be the problem?

PS I understand that the qemu and the real machine are different, but what exactly the difference I do not understand.

Author:  Octocontrabass [ Mon Nov 05, 2018 12:17 pm ]
Post subject:  Re: ATA driver

It's not sensible for the status register to have the value 0xFF. You're probably reading at the wrong address.

Did you search the PCI bus for the PCI IDE controller and read its BARs to determine the addresses to use? Newer hardware is less likely to bother with ensuring IDE controllers are using legacy AT-compatible addresses, and SATA controllers are often not configured to emulate IDE at all.

Author:  grenders22 [ Mon Nov 05, 2018 12:27 pm ]
Post subject:  Re: ATA driver

Octocontrabass wrote:
It's not sensible for the status register to have the value 0xFF. You're probably reading at the wrong address.

Did you search the PCI bus for the PCI IDE controller and read its BARs to determine the addresses to use? Newer hardware is less likely to bother with ensuring IDE controllers are using legacy AT-compatible addresses, and SATA controllers are often not configured to emulate IDE at all.


Thanks for the answer. Literally 5 minutes ago, I realized that the pc just does not support ide. After reading in the wiki, I realized that they are different.(ide and ahci) I understood correctly?

PS I have difficulty translating English texts.

Author:  Octocontrabass [ Mon Nov 05, 2018 12:30 pm ]
Post subject:  Re: ATA driver

grenders22 wrote:
Literally 5 minutes ago, I realized that the pc just does not support ide.

Check the BIOS. Sometimes you can change it to use IDE emulation for SATA.

Author:  grenders22 [ Mon Nov 05, 2018 12:31 pm ]
Post subject:  Re: ATA driver

Octocontrabass wrote:
grenders22 wrote:
Literally 5 minutes ago, I realized that the pc just does not support ide.

Check the BIOS. Sometimes you can change it to use IDE emulation for SATA.


Checked, only AHCI. :(

Author:  BrightLight [ Mon Nov 05, 2018 4:18 pm ]
Post subject:  Re: ATA driver

grenders22 wrote:
Checked, only AHCI. :(

Then you answered yourself: you need to write an AHCI driver.

Just as a side note, like Octocontrabass said, newer hardware with IDE controllers or SATA controller in IDE emulation mode won't place their I/O registers at ports 0x1F0-0x170; instead you'll need to scan the PCI bus for an IDE controller and read the BARs, which contains the base I/O ports for two ATA channels.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/