2014-03-18 60 views
1

我想知道如何在ubuntu上使用c語言在pci網卡上讀取,寫入和更新eeprom的內存地址。在ubuntu上讀取,寫入,更新pci卡上的eeprom

有人能請我指出正確的方向嗎?謝謝

+0

寫在磁盤上? – KRUKUSA

+0

@KRUKUSA我想讀/寫/更新到pci板上的eeprom存儲器。 – user1527227

+1

如果我正確理解你,我會說,答案在於編寫一個Linux/Windows驅動程序或使用現有的,允許你這樣做。這將取決於你在說什麼卡,你可能會工作在很低的水平。 – nonsensickle

回答

0

經過一番研究,似乎ethtool可以用來讀取和寫入EEPROM(http://manpages.ubuntu.com/manpages/hardy/en/man8/ethtool.8.html):

ethtool -d|--register-dump ethX [raw on|off] [hex on|off] [file name] 

    ethtool -e|--eeprom-dump ethX [raw on|off] [offset N] [length N] 

    ethtool -E|--change-eeprom ethX [magic N] [offset N] [value N] 

轉儲EEPROM,你可以做ethtool -e ethX raw <on|off> offset <N> length <N>