OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Aug 20, 2019 2:18 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: ATA driver
PostPosted: Mon Nov 05, 2018 11:48 am 
Offline

Joined: Thu Mar 01, 2018 10:09 am
Posts: 13
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.


Top
 Profile  
 
 Post subject: Re: ATA driver
PostPosted: Mon Nov 05, 2018 12:17 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 1587
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.


Top
 Profile  
 
 Post subject: Re: ATA driver
PostPosted: Mon Nov 05, 2018 12:27 pm 
Offline

Joined: Thu Mar 01, 2018 10:09 am
Posts: 13
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.


Last edited by grenders22 on Mon Nov 05, 2018 12:30 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: ATA driver
PostPosted: Mon Nov 05, 2018 12:30 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 1587
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.


Top
 Profile  
 
 Post subject: Re: ATA driver
PostPosted: Mon Nov 05, 2018 12:31 pm 
Offline

Joined: Thu Mar 01, 2018 10:09 am
Posts: 13
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. :(


Top
 Profile  
 
 Post subject: Re: ATA driver
PostPosted: Mon Nov 05, 2018 4:18 pm 
Offline
Member
Member
User avatar

Joined: Sat Dec 27, 2014 9:11 am
Posts: 901
Location: Maadi, Cairo, Egypt
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.

_________________
You know your OS is advanced when you stop using the Intel programming guide as a reference.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: zity and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group