PCI IOADDR is certain or not

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Raymond
Member
Member
Posts: 68
Joined: Thu Jun 09, 2016 4:39 am
Libera.chat IRC: 573410792

PCI IOADDR is certain or not

Post by Raymond »

I have wrote the ata driver successfully ,but i know the ioaddr is 0xC000 for bochs

This value is certainly on pci configraion space 0x20 and we should read from pci or we should
set this value to 0x20 with 0xcf8,0xcfc?

Why i can not alter the value of 0x20 to others as well as 0xC000 on bochs?
User avatar
BenLunt
Member
Member
Posts: 941
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: PCI IOADDR is certain or not

Post by BenLunt »

If you are talking about real hardware ATA cards, as well as some emulated environments, these cards have two modes, native and compatibility mode. In one mode, you can change the I/O address, in the other mode it is static at 0x1F0 for example. The bits in the PCI address space header, I don't remember exactly which at the moment, tell you if you can change from one mode to the other, and if so, what mode is (currently) supported.

Ben
Raymond
Member
Member
Posts: 68
Joined: Thu Jun 09, 2016 4:39 am
Libera.chat IRC: 573410792

Re: PCI IOADDR is certain or not

Post by Raymond »

I mean that when i use the ata pci bus master to read hd,not PIO mode.In that case,can I change the value of offset 0x20 in config space ,or i should use the one which is fixed in the 0x20?
User avatar
BenLunt
Member
Member
Posts: 941
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: PCI IOADDR is certain or not

Post by BenLunt »

First, and as I mentioned before, you need to make sure the drive is capable of PCI-Native mode. If the drive is in Compatibility mode, all I/O is hardwired to fixed addresses. Search for the file pciide.pdf and you should find the documentation I speak of. "PCI IDE Controller Specification 1.0 3/4/94"

Next, find a file called idems.pdf, "Programming Interface for Bus Master IDE Controller, 1.0, 5/16/94". The last page, Section 5.0, sub paragraph 1) states that bit 7 in the Programming Interface register indicates if a Bus Master is available.

Once you have determined that the drive can be in PCI-Native mode and that bit 7 is set, indicating that it is Bus Master capable, then you can modify the BAR at 0x20 as per the PCI specifications.

As a side note, my question is, did you try it first? If you have a working driver without changing the BAR, change the BAR and see if it still works.

Ben
http://www.fysnet.net/osdesign_book_series.htm
Raymond
Member
Member
Posts: 68
Joined: Thu Jun 09, 2016 4:39 am
Libera.chat IRC: 573410792

Re: PCI IOADDR is certain or not

Post by Raymond »

thank you,ben.

now I have intel 82801EB Ultra ATA Storage Controller in ide,can i use ata without the pci bus master way(pio mode)?what is ultra ata?
User avatar
BenLunt
Member
Member
Posts: 941
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: PCI IOADDR is certain or not

Post by BenLunt »

If you use the correct command, you can always read and write from the drive using Port I/O. There are different commands used for BUS Master transfers and Port I/O transfers to tell the drive how you plan on transferring the data.

As far as the Ultra term, without looking it up, I am guessing that it means that it supports Ultra DMA transfers.

Ben
Post Reply