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

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
nuralam89
Posts: 5
Joined: Mon Feb 09, 2015 4:53 am

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

Post 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.
Octocontrabass
Member
Member
Posts: 5588
Joined: Mon Mar 25, 2013 7:01 pm

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

Post by Octocontrabass »

nuralam89 wrote:0xfeaf000

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

Are you sure you're interpreting it correctly?
nuralam89
Posts: 5
Joined: Mon Feb 09, 2015 4:53 am

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

Post 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
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: unable to Read the ABAR(AHCI base Memory Register) conte

Post by Combuster »

A linux application is not an OS. It is not allowed to access hardware directly.
"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 ]
Post Reply