如何獲得AHCI基地址(ABAR)?我怎樣才能知道,這是什麼內存地址?我知道,它從PCI基地址算起,但我不知道如何獲得PCI基地址。AHCI基地址
Q
AHCI基地址
0
A
回答
0
AHCI基地址位於AHCI主控制器的BAR5中,AHCI主控制器也是PCI設備。這裏的「BAR5」表示PCI配置空間中的偏移量0x27〜0x24(DWORD)。爲了得到這個基地址,應該發出配置讀週期!
下面是代碼示例用匯編語言得到BAR5(假設AHCI主機控制器是在公交3,設備0,功能0)
mov eax, 80030024h ; PCI function address
mov dx, 0cf8h ; config address io port
out dx, eax
mov dx, 0cfch ; get data from config data port
in eax, dx ; read DWORD into register eax
也許你應該做的第一件事就是研究PCI規範。然後你就可以查看以下鏈接:
PCI configuration space, Access registers in a PCI config space
0
我特林最近讀AHCI基址的內存。 我剛剛發現三種方法可以幫助。 方法1。你可以通過winring0讀取pci基地址。有很多可以下載的演示。鏈接是鏈接是http://bbs.aau.cn/forum.php?mod=viewthread&tid=4914。方法2我只是運行第三個工具(lspci.exe)來讀取ahci基地址。
private string getAhciBaseAddress()
{
string output = "";
ProcessStartInfo StartInfo = new ProcessStartInfo();
StartInfo.FileName = @"C:\pciutils-3.2.0\lspci.exe";
StartInfo.Arguments = "-v -s.2";
StartInfo.UseShellExecute = false;
StartInfo.RedirectStandardInput = false;//不重定向輸入
StartInfo.RedirectStandardOutput = true; //重定向輸出
StartInfo.CreateNoWindow = true; //不創建窗口
StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
Process myProcess = null;
try
{
myProcess = Process.Start(StartInfo);
while (!myProcess.HasExited)
{
myProcess.WaitForExit(3000);
}
output = myProcess.StandardOutput.ReadToEnd();//讀取進程的輸出
Console.WriteLine("output==" + output);
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
finally
{
if (myProcess != null) myProcess.Close();
}
string key = "Memory at ";
int index = output.IndexOf(key);
string addressString = "";
int length = IntPtr.Size == 4 ? 8 : 16;
if (index!= -1)
{
addressString = output.Substring(index + +key.Length, length);
}
return addressString;
}
的聯繫是http://blog.csdn.net/shmily453397/article/details/13767599
相關問題
- 1. WCF基地址
- 2. WCF基地址
- 3. AHCI規格
- 4. ELF的基址地址
- 5. Selenuim - echo基地址
- 6. exe的基地址?
- 7. 基於IP地址
- 8. Linux AHCI PRD分配
- 9. 更改NSURL基地址到另一個基地址
- 10. 該基址的Excutable的地址文件
- 11. 如何從FTP地址獲取基址?
- 12. WATSON Q和A基地址
- 13. 更改tomcat基地址
- 14. 基地址,配置文件
- 15. 設置全球基地址
- 16. 2道場基地網址
- 17. 運行時WCF基地址
- 18. htaccess重寫基地址
- 19. 基地網址代碼點
- 20. Win32 Stack部分基地址
- 21. C#IIS 7基地址
- 22. AFNetworking變更基地址
- 23. 基地址默認爲localhost
- 24. WCF端點的基地址
- 25. Yii基本地址重寫
- 26. Django網站地圖更改基地址
- 27. WCF服務基地地址http和netTcp
- 28. 流浪,宅基地IP地址Laravel
- 29. 基地址寄存器如何獲取地址?
- 30. 基於IP地址的Google存儲訪問地址