Page 1 of 1

unable to Read the ABAR(AHCI base Memory Register) content.

Posted: Mon Jun 22, 2015 10:08 am
by nuralam89
hi,
As mentioned in http://wiki.osdev.org/AHCI that host communicate with AHCI controller through system memory and memory mapped registers.
The Last PCI base Address Register (BAR[5],header offset 0x24)points to the AHCI base memory,its called ABAR.

i have tried this, and got BAR[5] value=0xfeaf000,
while trying to read the contents of this value i have alwas got 0vffffffff.(for every offset i have tried)
i have used simple c memory read technique,

like:
unsigned int *abar = (unsigned int *) 0x0feaf000;
and then printint *abar value.

what's wrong with it?plz help me out.

Re: unable to Read the ABAR(AHCI base Memory Register) conte

Posted: Mon Jun 22, 2015 10:53 am
by Octocontrabass
nuralam89 wrote:0xfeaf000

0x0feaf000
Are you sure that's the right value?

Are you sure you're interpreting it correctly?

Re: unable to Read the ABAR(AHCI base Memory Register) conte

Posted: Tue Jun 23, 2015 3:27 am
by nuralam89
hi,
As far as i know i have three Sata controller's as :-
i have got following information:
$ lspci -nn | grep SATA

00:1f.2 SATA controller [0106]: Intel Corporation 82801JI (ICH10 Family) SATA AHCI Controller [8086:3a22]
02:00.0 SATA controller [0106]: JMicron Technology Corp. JMB363 SATA/IDE Controller [197b:2363] (rev 03)
02:00.1 IDE interface [0101]: JMicron Technology Corp. JMB363 SATA/IDE Controller [197b:2363] (rev 03)

i have read PCI BAR[5](i.e. offset 0x24) and got:--

Device found
In Write Jmicron SATA(2363197b) BAR[5] value is:=feafe000
Device found
In Write Intel SATA(3a228086) BAR[5] value is:=fe9fb000

initially i have tried to read it through inl() (thougt I/O read) and got those 0xffffffff value.
Now i realize that they are memory mapped Hardware registers. And tried to read it as basic memory read procedure like setting a pointer and then tried to read it's value and got :--
"program recieved SIGSIGV signal,Segmentation fault"

Is there any other way to read this address?? plz help

Re: unable to Read the ABAR(AHCI base Memory Register) conte

Posted: Tue Jun 23, 2015 4:28 am
by Combuster
A linux application is not an OS. It is not allowed to access hardware directly.