Page 1 of 1
PCI IOADDR is certain or not
Posted: Sat Oct 15, 2016 5:57 pm
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?
Re: PCI IOADDR is certain or not
Posted: Sat Oct 15, 2016 8:33 pm
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
Re: PCI IOADDR is certain or not
Posted: Fri Oct 21, 2016 1:50 am
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?
Re: PCI IOADDR is certain or not
Posted: Fri Oct 21, 2016 10:58 am
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
Re: PCI IOADDR is certain or not
Posted: Fri Oct 21, 2016 6:31 pm
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?
Re: PCI IOADDR is certain or not
Posted: Fri Oct 21, 2016 10:40 pm
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