RIGHT:''&counter(all); - &counter(yesterday); - &counter(today); - &online;'' CENTER:&size(28){&color(darkgreen){''MES on the FDAU is a mess!''};}; #br ---- #contents ---- -[[MES本家:http://mes.sourceforge.jp/mes/]] ---- **Flush ROMの書き方 [#sc64661e] -使うのは、Windows用アプリ(gccsetup.exe)。社内サーバproject/fdau/toolに有り。 --minicom用も本家にあるみたいだけど、使ったことがないです。 -カーネル(sys3069.mot)の書込み。最新は社内サーバproject/fdau/binに有り。 --JP1をショート、ヒゲをVCCに接続 --sys3069.motを「シリアル転送ツール」にドラッグ -シェル(shell)の書込み。最新は社内サーバproject/fdau/binに有り。 --JP1〜3はオープン、ヒゲをVCCに接続 --shellを「シリアル転送ツール」にドラッグ -カーネルを書き換えたときは、シェルも書き直さないとダメです。 -実行時の設定 --JP2をショート、ヒゲを開放 --RS232Cケーブルはクロス。57600bps, 8bit, noneに設定。 --ifconfig ne0 192.168.xxx.xxxでEtherはUPするので、他からpingできます。 --他のコマンドは、MES/shell/shell.cを参照(たいしたのは無い) **TCPシステムコール [#f93c60a9] -以下のシステムコールがある。 tcp_socket tcp_listen tcp_bind tcp_connect tcp_free tcp_send tcp_recv -これらは、MES/libsys/net.cで以下のように生成される int32_t tcp_recv(int32_t sock, STRING data, int32_t size) { register Task *task; task = get_task(); task->req = TCP_RECV_REQ; task->arg[0] = sock; task->arg[1] = (int32_t)data; task->arg[2] = size; task->state |= REQ_STATE; TRAP0; return task->retval; } **現状の問題点 [#p36cd6bc] -全てのARP要求に対して、ARP応答してしまう。 --MES/arp.cを変更して解決した。144行目付近 case ARP_REQ: if(arp->destip == get_ip(0)){ /* ne0 only by kaneko */ ret = send_arp_packet(fd, ARP_ANS, arp->srcip); } break; -tcp_connect時にARP要求が出ない --ひとまずshellで対応。 ret = get_mac_address(ip, buff); printf("get_mac_address() (%d)... OK\n", ret); if(ret == -1) return NOFILE; -ルータ越しのtcp_connect時、相手のSYNCに対してACKを返せない --tcpログは以下の通り、相手先のSYNに対してACKが出ていない。 14:24:00.535993 arp who-has 192.168.100.2 tell 192.168.100.44 14:24:00.536206 arp reply 192.168.100.2 is-at 0:90:cc:1:5:9c 14:24:10.887040 192.168.100.44.2 > 219.96.212.110.echo: S 3611230207:3611230207(0) win 1460 <eol> (DF) 14:24:10.888202 219.96.212.110.echo > 192.168.100.44.2: S 3725341800:3725341800(0) ack 3611230208 win 65535 <mss 1460> 14:24:13.882549 219.96.212.110.echo > 192.168.100.44.2: S 3725341800:3725341800(0) ack 3611230208 win 65535 <mss 1460> 14:24:15.879554 arp who-has 192.168.100.44 tell 192.168.100.2 14:24:15.886926 arp reply 192.168.100.44 (0:2:cb:1:74:db) is-at 0:2:cb:1:74:db (0:0:0:0:0:0) 14:24:16.879710 arp who-has 192.168.100.44 tell 192.168.100.2 14:24:16.887053 arp reply 192.168.100.44 (0:2:cb:1:74:db) is-at 0:2:cb:1:74:db (0:0:0:0:0:0) 14:24:17.879904 arp who-has 192.168.100.44 tell 192.168.100.2 14:24:17.887416 arp reply 192.168.100.44 (0:2:cb:1:74:db) is-at 0:2:cb:1:74:db (0:0:0:0:0:0) 14:24:18.880021 arp who-has 192.168.100.44 tell 192.168.100.2 14:24:18.887786 arp reply 192.168.100.44 (0:2:cb:1:74:db) is-at 0:2:cb:1:74:db (0:0:0:0:0:0) 14:24:19.880178 arp who-has 192.168.100.44 tell 192.168.100.2 14:24:19.882908 219.96.212.110.echo > 192.168.100.44.2: S 3725341800:3725341800(0) ack 3611230208 win 65535 <mss 1460> 14:24:20.880332 arp who-has 192.168.100.44 tell 192.168.100.2 14:24:31.883642 arp who-has 192.168.100.44 tell 192.168.100.2 14:24:32.882208 arp who-has 192.168.100.44 tell 192.168.100.2 14:24:33.882365 arp who-has 192.168.100.44 tell 192.168.100.2 --関数の戻値は以下の通り。関数は正常に終了している。 MES >Micro Embeded System 1.0b4 2003/12/9 MES >ifconfig ne0 192.168.100.44 net0 IP Address:192.168.100.44. Netmask:255.255.255.0. MAC:00:02:CB:01:74:DB MES >gateway 192.168.100.2 MES >discard 219.96.212.110 get_mac_address() (0)... OK tcp_socket() (32768)... OK tcp_connect (0)... OK type QUIT then quit tcp_free (0) ... OK MES > -tcp_close時、相手のFINに対してACKを返せない --ログは以下の通り 14:37:33.930729 arp who-has 192.168.100.5 tell 192.168.100.44 14:37:33.930799 arp reply 192.168.100.5 is-at 0:20:e0:69:19:2c 14:37:45.042869 192.168.100.44.2 > 192.168.100.5.echo: S 2424831:2424831(0) win 1460 <eol> (DF) 14:37:45.042985 192.168.100.5.echo > 192.168.100.44.2: S 3373018346:3373018346(0) ack 2424832 win 5840 <mss 1460> (DF) 14:37:45.051844 192.168.100.44.2 > 192.168.100.5.echo: . ack 1 win 1460 (DF) 14:37:57.517342 192.168.100.44.2 > 192.168.100.5.echo: F 1:1(0) ack 1 win 1460 (DF) 14:37:57.518508 192.168.100.5.echo > 192.168.100.44.2: . ack 2 win 5840 (DF) 14:38:13.065759 192.168.100.5.echo > 192.168.100.44.2: F 1:1(0) ack 2 win 5840 (DF) 14:38:16.065381 192.168.100.5.echo > 192.168.100.44.2: F 1:1(0) ack 2 win 5840 (DF) 14:38:22.065373 192.168.100.5.echo > 192.168.100.44.2: F 1:1(0) ack 2 win 5840 (DF) 14:38:34.065372 192.168.100.5.echo > 192.168.100.44.2: F 1:1(0) ack 2 win 5840 (DF) 14:38:58.065377 192.168.100.5.echo > 192.168.100.44.2: F 1:1(0) ack 2 win 5840 (DF) 14:39:03.065373 arp who-has 192.168.100.44 tell 192.168.100.5 14:39:03.073378 arp reply 192.168.100.44 is-at 0:2:cb:1:74:db (0:0:0:0:0:0) **正常なTCPコネクトとディスコネクト [#x62b11f3] --PC-PCでのログ 00:33:22.520296 arp who-has 192.168.100.135 tell 192.168.100.164 00:33:22.520470 arp reply 192.168.100.135 is-at 0:40:26:14:1c:b8 00:33:22.520887 192.168.100.164.1626 > 192.168.100.135.7: S 1546041656:1546041656(0) win 64240 <mss1460,nop,nop,sackOK> (DF) 00:33:22.521305 192.168.100.135.7 > 192.168.100.164.1626: S 1106422315:1106422315(0) ack 1546041657 win 57344 <mss 1460> 00:33:22.521712 192.168.100.164.1626 > 192.168.100.135.7: . ack 1 win 64240 (DF) 00:33:29.410782 192.168.100.164.1626 > 192.168.100.135.7: F 1:1(0) ack 1 win 64240 (DF) 00:33:29.411128 192.168.100.135.7 > 192.168.100.164.1626: . ack 2 win 58400 (DF) 00:33:29.417723 192.168.100.135.7 > 192.168.100.164.1626: F 1:1(0) ack 2 win 58400 (DF) 00:33:29.418552 192.168.100.164.1626 > 192.168.100.135.7: . ack 2 win 64240 (DF)