About AHCI BAR[5]

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
zgxltxz
Posts: 9
Joined: Mon Apr 15, 2013 4:31 am
Location: China
Contact:

About AHCI BAR[5]

Post by zgxltxz »

Hello,
My English is poor.
I'm researching AHCI operation. About ABAR (BAR [5]), after reading a value of 0 x00003091, Why BA is 0? :?:

Code: Select all

mov eax,10000000000000001111101000011000b
mov dx,0cf8h
out dx,eax
mov dx,0cfch
in eax,dx
after,EAX=0x00003091
User avatar
Shaun
Member
Member
Posts: 43
Joined: Mon Sep 17, 2012 3:14 am
Contact:

Re: About AHCI BAR[5]

Post by Shaun »

as far as i can know, your busno = 0x0, devno = 0x1f, func=0x02, reg = 0x06, first, are you sure these registers you specified are correct?

also, abar 5 address offset in pci configuration space for ahci is 0x24, but your reg is 0x06?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: About AHCI BAR[5]

Post by Combuster »

00011000b
reg = 0x06
The offset used here is actually 24 decimal, or the 6th doubleword - mixing up these units is a typical beginner error.

In reality, to get BAR5 the offset should be 0x24 hexadecimal rather than decimal.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
zgxltxz
Posts: 9
Joined: Mon Apr 15, 2013 4:31 am
Location: China
Contact:

Re: About AHCI BAR[5]

Post by zgxltxz »

virusest wrote:as far as i can know, your busno = 0x0, devno = 0x1f, func=0x02, reg = 0x06, first, are you sure these registers you specified are correct?

also, abar 5 address offset in pci configuration space for ahci is 0x24, but your reg is 0x06?
oh,I always thought 4 bytes per register.Thank you for your answer !
zgxltxz
Posts: 9
Joined: Mon Apr 15, 2013 4:31 am
Location: China
Contact:

Re: About AHCI BAR[5]

Post by zgxltxz »

Combuster wrote:
00011000b
reg = 0x06
The offset used here is actually 24 decimal, or the 6th doubleword - mixing up these units is a typical beginner error.

In reality, to get BAR5 the offset should be 0x24 hexadecimal rather than decimal.
thank you,I realized the mistake.
Post Reply