作者qazwsxee (灰雁)
看板LinuxDev
標題[問題] arm平台上寫的程式呼叫socket() (仍有問題)
時間Thu May 26 00:15:07 2011
我寫了一個Vedio/Voice over IP 程式(網路視訊電話)採用SCTP協定,要在arm平台上執行
,我不透過Qtopia而是直接以QT/Embedded的執行方式,用終端機執行以下2行指令:
$ export QWS_MOUSE_PROTO="MouseMan:/dev/mouse0"
$ ./ihu –qws
執行成功有畫面,也可以操作那些選項按鈕,但在呼叫socket()時總是回傳失敗。
程式執行後,終端機第一行會先有這段訊息:
QServerSocket: failed to bind or listen to the socket
按下[WaitCall]按鈕會有
ERROR: can't initalize SCTP socket( socket() )
按下[Call]按鈕會有
ERROR: can't initalize socket(Protocol not supported)
但同樣的程式碼編譯成x86版本的,在電腦上卻可以正常執行...
有哪位先進對於此種Error有頭緒嗎?
如果有人可以幫我點出確實問題點所在,好讓我可以依此修改,
小弟願贈送3000P給第一位解決的先進,其他人若有點出對我有所幫助的觀念,
也給予500P~2000P不等的報酬。
(小弟目前身家約6000P而已~很窮~也只能給這點報酬了~)
可以用推、回文或者來信告知
--
『老闆你好 我國立碩士』
『老闆你好 我私立碩士』 『老~~~~~~~闆~~~~~~』 喔喔
◢ ◣有消息會跟你聯絡 ◢ ◣有消息會跟你聯絡 ◢ ◣你明天就開始上班!
◤ ◥ ◥ ◢ ◤◥ ◥ ◢ ◥◢ ◣ 國立
-○=○- ◤ -□=□- ◤ ◥● ●● ◤ ◥ 私立
◥ ◤ ︶ ◥ ◤ ︶ ● ▼◤ ● ) 尬不過
◢ ◥◣╱
◥ -? ◢ ◣◣╱
ψQSWEET◥ - ◢ )●) ▼ ◤ 兩粒
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.171.243.179
※ 編輯: qazwsxee 來自: 218.171.243.179 (05/26 00:29)
1F:推 cole945:你應該是kernel少編sctp吧? 05/26 01:24
2F:→ cole945:/proc/net/sctp或/sys/module/sctp應該要有東西 05/26 01:24
3F:→ cole945:modprobe sctp看看, 不然你kernel要重編了 05/26 01:25
4F:推 askacis:推樓上,或是你也可以用C直接寫個簡單的socket程式試試看 05/26 02:05
5F:→ askacis:正常情況下,單純的bind or listen不應該會fail的... 05/26 02:07
6F:→ askacis:如果連C code都不行,看是port有衝到或檢查kernel config.. 05/26 02:09
7F:推 mecs:看起來在 socket() 就出錯, procotol not supported 基本上 05/26 12:18
8F:→ mecs:就如同一樓所說, sctp 這個 module 不在 kernel 內 ... 05/26 12:20
[root@WinFast310 /root]
#modprobe sctp
modprobe: module 'sctp' not found
[root@WinFast310 /root]
#modprobe tcp
modprobe: module 'tcp' not found
[root@WinFast310 /root]
#modprobe udp
modprobe: module 'udp' not found
[root@WinFast310 /root]#cd /proc/net/
[root@WinFast310 net]#ls
arp netstat raw sockstat udplite
dev packet route softnet_stat unix
dev_mcast pnp rpc stat wireless
irda pppoe rt_cache tcp
netlink protocols snmp udp
[root@WinFast310 net]#cd tcp
-sh: cd: can't cd to tcp
[root@WinFast310 net]#
----------------------
以上是我去arm平台裡面打的指令,確實沒有sctp
modprobe tcp
modprobe udp 也都是失敗,不知什麼原因,但我這台是可以上網的
(有連上Google首頁,只是會亂碼)
重編kernel的過程,具體要在哪些資料夾底下做什麼事才可以包sctp進去核心?
在目錄下輸入make menuconfig
qaz@qaz-desktop:/media/disk/source_data/WinFast310/src$ make menuconfig
我的menuconfig畫面是這個
http://imageshack.us/photo/my-images/402/winfast310.jpg/
System Type
---> PXA3xx Processor Variants (PXA310)
---> ( ) PXA300
---> (X) PXA310
---> PXA3xx Development Platform (PXA3xx Processor Platform)
--->( ) PXA3xx Handheld Platform
--->(X) PXA3xx Processor Platform
Debug/Release Version (Release Version)
---> ( ) Debug Version
---> (X) Release Version
VGA/QVGA Version (VGA Version)
---> (X) VGA Version
---> ( ) QVGA Version
Preview Kit BSP(Board Support Package)
---> [*] PXA Linux Preview Kit Kernel (Linux Kernel 2.6.21)
---> (X) Linux Kernel 2.6.21
---> [*] UDEV Support
---> [*] PXA Linux Root File System
---> [*] Power Management (Marvell(TM) Scalable Power Management)
---> ( ) Dynamic Power Management
---> (X) Marvell(TM) Scalable Power Management
---> [*] ALSA Libs
---> [*] ALSA Tools
---> [*] Buffer Management Module(BMM)
---> [ ] Baseband Subsystem Support
---> [*] Bluetooth Subsystem Support
---> [*] WLAN Subsystem Support
---> [*] 2-D Graphics
---> [*] Hardware Vide Accelerator
---> [*] Blob (Download by Ethernet)
---> (X) Download by Ethernet
---> ( ) Download by USB Client 2.0
---> [*] Preview Kit Sample
Marvell(TM) Integrated Performance Primitives (IPP)
---> [*] IPP Library
Marvell Impementation of OpenGL ES
---> [*] OpenGL ES Library
---> [*] Graphisc Sample Based On OpenGL*ES
Marvell IPP Based GStreamer Plug-ins
---> [*] GStreamer plug-ins
Usage Mode for Linux
---> [*] Qtopia PDA edition
---> [*] Audio Playback Usage Mode
---> [*] Video Playback Usage Mode
---> [*] Still Capture Usage Mode
---> [*] Video Record Usage Mode
---> [*] Demo for Qtopia
Marvell(TM) Performance Data Collector
---> [ ] Marvell (TM) Performance Data Collector
Marvell(TM) WTPTP
---> [*] OEM Boot Module
---
Load an Alternate Configuration File
Save Configuration to an Alternate File
我的kernel目錄是這個畫面
http://imageshack.us/photo/my-images/199/winfast3101.jpg/
我要把sctp相關文件擺在kernel目錄下的哪,才能使menucohfig中出現SCTP的選項?
或是怎樣使sctp包到kernel裡?
※ 編輯: qazwsxee 來自: 140.127.200.80 (05/26 15:29)
※ 編輯: qazwsxee 來自: 140.127.200.80 (05/26 15:59)
9F:推 q1mail:make menuconfig ->networking support->networking option 05/26 16:03
10F:→ q1mail:裡面有 The SCTP protocol 05/26 16:04
11F:推 cole945:menuconfig的話,樓上說的就是了..或是你可以直接改kernel 05/26 20:23
12F:→ cole945:目錄下的.config檔,搜IP_SCTP那行, 改成=y 05/26 20:23
可以先結案了,大家講的都是我要的答案了。(我還沒有時間重編去驗證~忙碌中)
依時間先後、講述詳細:
cole945大大 最早、也有回答到我的問題點,我才知道arm裡面沒包SCTP 給您3000P
askacis大大 有來信指正我的make menuconfig弄錯kernel目錄 給您2000P
http://imageshack.us/photo/my-images/819/winfast3102.jpg/
其他2人就發個250P聊表心意
已轉帳:
http://imageshack.us/photo/my-images/856/winfast3103.jpg/
感謝各位先進的指導!
※ 編輯: qazwsxee 來自: 140.127.208.148 (05/26 22:11)
13F:推 final01:XD !!讚喔 05/27 18:00
=ˇ=安安各位~我又回來了~我已經重編了kernel
[root@WinFast310 /root]
#modprobe sctp
[root@WinFast310 /root]
#modprobe tcp
modprobe: module 'tcp' not found
sctp已經包進去了,但是TCP好像沒有包的關係,我還是有socket()的問題
要包TCP協定進去核心要選哪些選項呀?
那些TCP/IP的選項超多,有哪邊可以看相關的參數說明?
我想知道選什麼選項會有什麼效果
※ 編輯: qazwsxee 來自: 140.127.208.148 (05/28 02:18)
※ 編輯: qazwsxee 來自: 114.27.153.206 (05/28 02:46)
14F:推 cole945:.....module才會用modprobe動態載入. 直接編進不用每次載 05/28 12:39
15F:→ cole945:就是你menuconfig前面的[y]或[m]的接別. 你可以改用[y] 05/28 12:39
哦哦喔~!! 我了解了!
TCP因為預設就有了,所以不用modprobe
我剛開機後忘記打第一行,所以怪怪的
$ modprobe sctp
$ export QWS_MOUSE_PROTO="MouseMan:/dev/mouse0"
$ ./ihu –qws
現在打這3行出來,進去圖形化介面後,
按下[WaitCall]按鈕 回應正常!
按下[Call]按鈕 回應正常!
感謝你們了~!
※ 編輯: qazwsxee 來自: 140.127.208.148 (05/28 13:44)
※ 編輯: qazwsxee 來自: 140.127.208.148 (05/28 15:47)