04 09 |
rpcapd與netcat-測試嵌入式系統的好工具作者: Joey 日期: 2009-04-09 17:06 |
最近在改一個SPI driver,發現硬體的通訊界面好像都差不多,不是direct就是indirect, command與data也是一來一回,不同的硬體通訊界面只有速度快慢的問題,感覺SPI似乎比IIC要快很多
netcat這個東西已經好多人講了它的用法,所以這邊不再贅述,它可以打死netconsole這個linux新的feature,比方說在device上下達指令
cat /proc/kmsg | netcat –l –p 1234
這樣子就可以在本機端連device的port 1234觀察kernel log,本機端的指令下法如下
nc [device IP] 1234
而rpcapd是主機端抓device封包的好物,可以遠端截取device上任意網卡界面的封包,有個不錯的網頁介紹rpcap daemon可以下的所有指令,搭配主機端的wireshark或ethereal,可以省掉我們在device console執行tcpdump的不便
在device上下達指令
rpcapd –b [local IP address] –n(NULL認證)
在wireshark選擇adpater option後,設定capture的界面為rpcap://[IP address]/[interface name]
[2009.4.10]New Added
rpcapd cross compile steps:
1. cross compile libpcap under winpcap directory
2. cross compile rpcapd and fix some bugs
3. rpcapd executable static binary for little endian arm could be downloaded from here (rpcap binary is updated)[2009.4.15]
[2009.4.15]Update
[Important]You must config kernel PACKET_SOCKET option to use rpcapd. (Sorry for this late update, I haven't totally read user manual in libpcap)
Packet socket
CONFIG_PACKET
The Packet protocol is used by applications which communicate
directly with network devices without an intermediate network
protocol implemented in the kernel, e.g. tcpdump. If you want them
to work, choose Y.
在device端執行畫面如下
設定畫面大概如下圖
fw_printenv-control u-boot enviroment variables under linux (2009-05-12 16:35)
udev-強大的device node管理系統 (2009-02-02 20:35)
Framebuffer兩三事-Test On QT2410 (2009-01-12 16:29)
UIO-Linux user space I/O driver (2008-12-15 14:50)
GDB-刺入bug心臟的寶劍 (2008-10-15 16:11)
Telnet daemon-RS232以外的選擇 (2008-10-03 18:57)
在嵌入式系統切換file system-以squashfs和jffs2為例 (2008-10-01 19:44)
Linux kernel module-進入系統核心的鑰匙 (2008-09-12 14:03)
SQLite-麻雀雖小五臟俱全 (2008-09-05 14:46)