s3c44b0-uClinux-ftp-通信

------------------------------------         uClinux-ftp-通信       ------------------------------

ftp服务器:

[root@localhost /]# ping 192.168.0.28

PING 192.168.0.28 (192.168.0.28) 56(84) bytes of data.

64 bytes from 192.168.0.28: icmp_seq=1 ttl=64 time=8.40 ms

64 bytes from 192.168.0.28: icmp_seq=2 ttl=64 time=1.54 ms

64 bytes from 192.168.0.28: icmp_seq=3 ttl=64 time=1.55 ms

64 bytes from 192.168.0.28: icmp_seq=4 ttl=64 time=1.56 ms

64 bytes from 192.168.0.28: icmp_seq=5 ttl=64 time=1.58 ms

64 bytes from 192.168.0.28: icmp_seq=6 ttl=64 time=1.47 ms

 

--- 192.168.0.28 ping statistics ---

6 packets transmitted, 6 received, 0% packet loss, time 5003ms

rtt min/avg/max/mdev = 1.471/2.686/8.403/2.557 ms

[root@localhost /]#

[root@localhost /]# service vsftpd restart

关闭 vsftpd                                              [确定]

vsftpd 启动 vsftpd                                    [确定]

[root@localhost /]#

 

ftp客户机:

/> ping 192.168.0.10

PING 192.168.0.10 (192.168.0.10): 56 data bytes

64 bytes from 192.168.0.10: icmp_seq=0 ttl=64 time=0.0 ms

64 bytes from 192.168.0.10: icmp_seq=1 ttl=64 time=0.0 ms

64 bytes from 192.168.0.10: icmp_seq=2 ttl=64 time=0.0 ms

64 bytes from 192.168.0.10: icmp_seq=3 ttl=64 time=0.0 ms

64 bytes from 192.168.0.10: icmp_seq=4 ttl=64 time=0.0 ms

64 bytes from 192.168.0.10: icmp_seq=5 ttl=64 time=0.0 ms

 

--- 192.168.0.10 ping statistics ---

6 packets transmitted, 6 packets received, 0% packet loss

round-trip min/avg/max = 0.0/0.0/0.0 ms

/>

/> cd var

/var> ls

config  empty   hello   lock    log     run     tmp

/var> rm hello

/var> ls

config  empty   lock    log     run     tmp

/var> ftp 192.168.0.10

Connected to 192.168.0.10.

220 (vsFTPd 2.0.5)

Name (192.168.0.10): cqone  //注意这里的名字是服务器上的一个用户名和下面对应的秘密

331 Please specify the password.

Password:

230 Login successful.

ftp> ls

200 PORT command successful. Consider using PASV.

150 Here comes the directory listing.

226 Directory send OK.

ftp> cd ..

250 Directory successfully changed.

ftp> ls

200 PORT command successful. Consider using PASV.

150 Here comes the directory listing.

drwxr-xr-x    3 0        0            4096 Nov 06 14:24 1mydocument

drwxr-xr-x   11 0        0            4096 Nov 20 11:27 2myprogram

-rwxr--r--    1 0        0           37448 Nov 26 08:25 add

drwx------    3 500      500          4096 Dec 03 10:02 cqone

-rwxr-xr-x    1 65534    65534       29800 Nov 26 07:15 hello

drwxr-xr-x    2 0        0            4096 Oct 31 13:32 qcd

226 Directory send OK.

ftp> binary

200 Switching to Binary mode.

ftp> get hello

local: hello remote: hello

200 PORT command successful. Consider using PASV.

150 Opening BINARY mode data connection for hello (29800 bytes).

226 File send OK.

29800 bytes received in 0 secs (2980 Kbytes/sec)

ftp> quit

221 Goodbye.

/var> ls

config  empty   hello   lock    log     run     tmp

/var> ./hello

./hello: Permission denied

/var> chmod 777 hello

/var> ./hello

 

I success - compile uClinux kernel!

1.make menuconfig

2.make dep(complie depend)

3.make clean(if need)

4.make lib_only(compile library file)

5.make user_only(compile user application)

6.make romfs

7.make image

8.make

Note:[make image] have error.Ignore it and go on next!

     saved image file in images directory.

 

Compiler end and download uClinux to arm-board:

First configure IP between host and arm-board;

Second start tftpd32.exe and copy uclinux_rom.bin to Disktop;

Third input command:tftp 0x0c208000 at host terminal;

Fourth input command:bootm 0x0c208000 at host terminal.

 

Compile hello.c with arm-elf-gcc:

arm-elf-gcc -o hello hello.c - efl2flt

 

s3c44b0x configure nfs:

mount -t nfs -o nolock serverIP:/shareDir /mnt

 

that's all.

this is just a hello program! ha ha ...

…………………………………………………………………………………………………..

/var>

/var> ftp 192.168.0.10

Connected to 192.168.0.10.

220 (vsFTPd 2.0.5)

Name (192.168.0.10): anonymous

331 Please specify the password.

Password: <Enter>                    注意:这里不用输入密码直接回车即可。

230 Login successful.

ftp> ls

200 PORT command successful. Consider using PASV.

150 Here comes the directory listing.

-rwxr--r--    1 0        0           29800 Dec 03 10:22 hello

drwxrwxrwx    2 0        0            4096 Dec 03 10:31 pub

226 Directory send OK.

ftp> cd pub

250 Directory successfully changed.

ftp> ls

200 PORT command successful. Consider using PASV.

150 Here comes the directory listing.

-rwxr--r--    1 0        0           29800 Dec 01 03:00 test

226 Directory send OK.

ftp> binary

200 Switching to Binary mode.

ftp> get test

local: test remote: test

200 PORT command successful. Consider using PASV.

150 Opening BINARY mode data connection for test (29800 bytes).

226 File send OK.

29800 bytes received in 0 secs (1490 Kbytes/sec)

ftp> put hello                           注意:这里的hello文件是在var目录下的。

local: hello remote: hello

200 PORT command successful. Consider using PASV.

150 Ok to send data.

226 File receive OK.

29800 bytes sent in 0 secs (596 Kbytes/sec)

ftp> ls

200 PORT command successful. Consider using PASV.

150 Here comes the directory listing.

-rw-------    1 14       50          29800 Dec 03 10:32 hello

-rwxr--r--    1 0        0           29800 Dec 01 03:00 test

226 Directory send OK.

ftp> quit

221 Goodbye.

/var> ls

config  empty   hello   lock    log     run     test    tmp

/var> ./test

./test: Permission denied

/var> chmod 777 test

/var> ./test

 

this is test program!

…………………………………………………………………………………….

/var>

/var> ftp 192.168.0.10

Connected to 192.168.0.10.

220 (vsFTPd 2.0.5)

Name (192.168.0.10): root

530 Permission denied.

Login failed.

ftp> ls

530 Please login with USER and PASS.

ftp: bind: Address already in use

ftp> quit

221 Goodbye.

/var>

……………………………………………………………………………………………..

/var> ftp 192.168.0.10

Connected to 192.168.0.10.

220 (vsFTPd 2.0.5)

Name (192.168.0.10): anonymous

331 Please specify the password.

Password:<Enter>

230 Login successful.

ftp> ls

200 PORT command successful. Consider using PASV.

150 Here comes the directory listing.

-rwxr--r--      1 0        0           29800 Dec 03 10:22 hello

drwxrwxrwx    2 0        0            4096 Dec 03 10:32 pub

226 Directory send OK.

ftp> get hello

local: hello remote: hello

200 PORT command successful. Consider using PASV.

150 Opening BINARY mode data connection for hello (29800 bytes).

WARNING! 224 bare linefeeds received in ASCII mode

File may not have transferred correctly.

226 File send OK.

29800 bytes received in 0 secs (212 Kbytes/sec)

ftp> quit

221 Goodbye.

/var> ls

config  empty   hello   lock    log     run     test    tmp

/var> chmod 777 hello

/var> ./hello

BINFMT_FLAT: reloc outside program 0xfc00 (0 - 0x74a4/0x5da0), killing hello!

BINFMT_FLAT: reloc outside program 0xfc00 (0 - 0x74a4/0x5da0), killing hello!

pid 79: failed 11

/var>

注:出现上面问题是因为在下载文件时是使用的文本传输模式而没有选用二进制模式。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值