虚拟机下ubuntu12.04环境搭建

1: minicom的安装(跟板子进行串口通信)

安装命令:sudo apt-get install minicom

配置:
1 . 在终端中输入minicom以启动minicom(或者是sudo minicom);
2. 先按下Ctrl + a, 放开, 再按o, 出现配置菜单.
3. 选择 Serial port setup, 此时所示图标在“Change which setting”中,键入“A”,此时光标移到第A项对应处具体的配置信息如下所示:
Serial port setup [Enter]
+-------------------------------------------------------------+
| A -    Serial Device      : /dev/ttyUSB0                    |
| B - Lockfile Location     : /var/lock                       |
| C -   Callin Program      :                                 |
| D - Callout Program      -:                                 |
| E -    Bps/Par/Bits       : 115200 8N1                      |
| F - Hardware Flow Control : No                              |
| G - Software Flow Control : No                              |
|                                                             |
|    Change which setting?                                    |
+-------------------------------------------------------------+

注意: 如果没有使用USB转串口,而是直接使用串口,那么Serial Device要配置为/dev/ttyS0(如果使用USB转串口,则需要查看dev下是否存在ttyUSB0,若没有,则创建一个:mknod /dev/ttyUSB0 c 188 0)
对波特率,数据位和停止位进行配置,键入“E”,波特率选为115200 8N1 (奇偶校验无, 停止位1),

2:nfs的安装

安装命令: sudo apt-get install nfs-kernel-server  (安装nfs-kernel-server时,apt会自动安装nfs-common和portmap)

配置:sudo vim /etc/exports

  /opt/filesystem/nfs         *(subtree_check,rw,no_root_squash,async)

生效: sudo exportfs -a

启动: /etc/init.d/nfs-kernel-server restart

 

3:tftp安装

安装命令:sudo apt-get install tftpd tftp openbsd-inetd

配置:

  1:sudo vim /etc/xinetd.d/tftp

  service tftp
           {
               disable         = no
               socket_type     = dgram
               protocol        = udp
               wait            = yes
               user            = root
               server          = /usr/sbin/in.tftpd
               server_args     = -s /tftpboot
               source          = 11
               cps             = 100 2
               flags =IPv4
           }

  2: sudo  vi /etc/inetd.conf

  tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftpboot

  

  3:sudo vim /etc/default/tftpd-hpa

  #RUN_DAEMON="no"
  #OPTIONS="-s /tftpboot -c -p -U tftpd"

  TFTP_USERNAME="tftp"
  TFTP_DIRECTORY="/tftpboot"
  TFTP_ADDRESS="0.0.0.0:69"
  TFTP_OPTIONS="-l -c -s"

 

创建对应目录:

sudo mkdir /tftproot

sudo chmod 777 /tftproot

 

启动:sudo /etc/init.d/openbsd-inetd restart

本机测试:

    a. 在/tftproot 下新建文件1.txt   
      b. 在其他目录下测试:

       tftp 127.0.0.1
       tftp> get 1.txt
        Received 12 bytes in 0.0 seconds
        tftp> quit

 

 

 

 

 

 

 

 

 

 

 

posted on 2013-02-17 15:30  小风儿_xf  阅读(179)  评论(0编辑  收藏  举报

导航