Linux驅動之準備

來源:互聯網
上載者:User

標籤:des   style   color   io   os   ar   sp   on   c   

開始系統學習Linux驅動,以前斷斷續續也玩玩了一下,開貼來系統學習Linux驅動。

硬體平台是JZ2440-4.3 ARM9開發板,開發板運行系統版本Linux3.4.2核心(核心移植,下載等相關其他篇幅)。

設定開發板系統IP,讓開發板與主機、開發板與虛擬機器互連。

查看開發板ip

/ # route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
127.0.0.0 * 255.255.255.0 U 0 0 0 lo
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0

以上是我設定好的,如果沒有設定過是沒有IP的,如下:

/ # route 

設定ip

ifconfig lo 127.0.0.1
route add -net 127.0.0.0 netmask 255.255.255.0 lo
ifconfig eth0 192.168.1.17
route add -net 192.168.1.17 netmask 255.255.255.0

注意:192.168.1.17這個是開發板ip,這個ip要與主機、虛擬機器在同一個網段,簡單說主機ip應該為192.168.1.xx、虛擬機器ip也應該為192.168.1.xx,否則三者之間無法ping通。

測試ip是否可以ping通

開發板ping主機

/ # ping 192.168.1.10(主機ip)
PING 192.168.1.10 (192.168.1.10): 56 data bytes
64 bytes from 192.168.1.10: seq=0 ttl=64 time=1.888 ms
64 bytes from 192.168.1.10: seq=1 ttl=64 time=0.763 ms
64 bytes from 192.168.1.10: seq=2 ttl=64 time=0.733 ms
64 bytes from 192.168.1.10: seq=3 ttl=64 time=0.744 ms
64 bytes from 192.168.1.10: seq=4 ttl=64 time=0.769 ms
^C
--- 192.168.1.10 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0.733/0.979/1.888 ms

開發板ping虛擬機器

/ # ping 192.168.1.20(虛擬機器ip)
PING 192.168.1.20 (192.168.1.20): 56 data bytes
64 bytes from 192.168.1.20: seq=0 ttl=64 time=22.074 ms
64 bytes from 192.168.1.20: seq=1 ttl=64 time=0.975 ms
64 bytes from 192.168.1.20: seq=2 ttl=64 time=1.100 ms
64 bytes from 192.168.1.20: seq=3 ttl=64 time=0.934 ms
64 bytes from 192.168.1.20: seq=4 ttl=64 time=1.090 ms
64 bytes from 192.168.1.20: seq=5 ttl=64 time=1.075 ms
64 bytes from 192.168.1.20: seq=6 ttl=64 time=1.004 ms
64 bytes from 192.168.1.20: seq=7 ttl=64 time=0.955 ms
^C
--- 192.168.1.20 ping statistics ---
8 packets transmitted, 8 packets received, 0% packet loss
round-trip min/avg/max = 0.934/3.650/22.074 ms

設定正確就可以相互ping通。

NFS掛載開發板到虛擬機器nfs目錄

mount -t nfs -o intr,nolock,rsize=1024,wsize=1024  192.168.1.20:/work/nfs_root /mnt

注意:

1、192.168.1.20為虛擬機器ip(根據虛擬機器ip的目錄做相應改變)

2、/work/nfs_root為虛擬機器nfs目錄(根據nfs的目錄做相應改變)

 

Linux驅動之準備

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.