Page 1 of 1
About AHCI BAR[5]
Posted: Mon Sep 16, 2013 3:51 am
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
Re: About AHCI BAR[5]
Posted: Mon Sep 16, 2013 8:40 pm
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?
Re: About AHCI BAR[5]
Posted: Tue Sep 17, 2013 2:51 am
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.
Re: About AHCI BAR[5]
Posted: Tue Sep 17, 2013 6:44 am
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 !
Re: About AHCI BAR[5]
Posted: Tue Sep 17, 2013 6:45 am
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.