Debian下构建嵌入式开发环境

来源:互联网 发布:雷洋案真相知乎 编辑:程序博客网 时间:2024/05/16 14:02

一.安装虚拟机VM6.0

二.官网获取debian-40r5-i386-netinst.iso,安装:

    1.安装时选标准系统,不连接网络

    2.配置网络:

        修改/etc/network/interfaces        
        auto lo
        iface lo inet loopback

        allow-hotplug eth0

        iface eth0 inet static
            address 192.168.1.249
            netmask 255.255.255.0
            network 192.168.1.0
            broadcast 192.168.1.255
            gateway 192.168.1.254
        修改DNS配置文件/etc/resolv.conf

            nameserver xxx.xxx.xxx.xxx   

        使修改的配置文件生效/etc/init.d/networking restart

   

    3.安装apt-spy,更新源文件:

        a. vi /etc/apt/sources.list

        添加:

                deb http://security.debian.org/ etch/updates main contrib
                deb-src http://security.debian.org/ etch/updates main contrib

        b.apt-get update

        c.apt-get install apt-spy

        d.apt-spy -d testing -a asia

        e.cp /etc/apt/sources.list.d/apt-spy.list ../sources.list

        f.apt-get update

    4.安装升级必要软件

        a.apt-get dist-upgrade

        b.ssh 安装

            安装命令:apt-get install openssh-server

            启动/停止服务:/etc/init.d/ssh start|stop|restart   

        c.安裝Samba

            安装命令:apt-get install samba samba-client smbfs

            启动/停止服务:/etc/init.d/samba start|stop|restart    

       d.安装c语言的开发包

            apt-get install build-essential

        e.安装tftp

            apt-get install tftpd tftp

        f.安装vim(自带的vi不方便)

            apt-get install vim

    5.配置samba,tftp

        a.samba               

        添加用户smbpasswd username

        vi /etc/samba/smb.conf

        [home]

            ready only = no打开写权限

            create mask = 0644

            directory mask = 0755    

        b.tftp               

        检查文件/etc/inetd.conf里有没有关于tftp的设置:
        tftp            dgram   udp     wait    nobody  /usr/sbin/tcpd  /usr/sbin/in.tftpd /srv/tftp
        缺省的目录是/srv/tftp,可修改

        启动tftp: /usr/sbin/inetd                      
三.构建交叉编译环境

    1.可以网上直接下载构建好的交叉编译环境

        现在常用的交叉编译器有

        arm-linux-gcc-2.95.3

        arm-linux-gcc-3.3.2

        arm-linux-gcc-3.4.1
    2.自己建立交叉编译环境

        参考:

        http://blog.chinaunix.net/u1/45185/showart_527681.html

        http://www.ibm.com/developerworks/cn/linux/l-embcmpl/index.html