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.
ATA driver
-
- Member
- Posts: 5512
- Joined: Mon Mar 25, 2013 7:01 pm
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.
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.
-
- Posts: 16
- Joined: Thu Mar 01, 2018 10:09 am
Re: ATA driver
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?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.
PS I have difficulty translating English texts.
Last edited by grenders22 on Mon Nov 05, 2018 12:30 pm, edited 1 time in total.
-
- Member
- Posts: 5512
- Joined: Mon Mar 25, 2013 7:01 pm
Re: ATA driver
Check the BIOS. Sometimes you can change it to use IDE emulation for SATA.grenders22 wrote:Literally 5 minutes ago, I realized that the pc just does not support ide.
-
- Posts: 16
- Joined: Thu Mar 01, 2018 10:09 am
Re: ATA driver
Checked, only AHCI.Octocontrabass wrote:Check the BIOS. Sometimes you can change it to use IDE emulation for SATA.grenders22 wrote:Literally 5 minutes ago, I realized that the pc just does not support ide.
- BrightLight
- Member
- Posts: 901
- Joined: Sat Dec 27, 2014 9:11 am
- Location: Maadi, Cairo, Egypt
- Contact:
Re: ATA driver
Then you answered yourself: you need to write an AHCI driver.grenders22 wrote:Checked, only AHCI.
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.
You know your OS is advanced when you stop using the Intel programming guide as a reference.