您尚未登录。

楼主 #1 2020-05-10 00:05:54

缥缈九哥
会员
注册时间: 2020-05-09
已发帖子: 76
积分: 92

9G-LINUX嵌入式开发过程简介-缥缈九哥

一,准备VMWARE+LINUX安装软件包

1,在http://www.ubuntu.com/getubuntu/download
    下载Ubuntu 8.04 LTS 的X86的Desktop版本的ISO
    http://mirror.lupaworld.com/ubuntu/releases/hardy/ubuntu-8.04.1-desktop-i386.iso
2,在http://www.3ddown.com/soft/33308.htm
    下载虚拟机(VMware Workstation) v6.5.0.118166 完整注册版
VMware.Workstation.v6.5.0.118166.exe
Flashget://W0ZMQVNIR0VUXWh0dHA6Ly93d3cuM2Rkb3duLmNvbS9kb3dubG9hZC5hc3A/aWQ9MzMzMDgmZHA9MSZmaWQ9MzJbRkxBU0hHRVRd&1029&1225512051
注意:记得抄下注册码:JU04H-A8Q82-T3J18-4WF67
或者下载注册机VMware.Workstation.v6.5.0.118166-Keygen.rar
3,在http://www.tuola.net/soft/view-1441.html
下载VanDyke SecureCRT v6.0.3 build 311 破解版
http://dl.tuola.net/s/SecureCRT.v6.0.3.rar
4,在ftp://ftp.denx.de/pub/eldk/4.1/arm-linux-x86/iso/
    下载arm-2007-01-21.iso
    ftp://ftp.denx.de/pub/eldk/4.1/arm-linux-x86/iso/arm-2007-01-21.iso
5, 在http://www.crsky.com/soft/2975.html
    下载Beyond_Compare_2.5.3.253_SC-special.exe
    http://3.scdx1.crsky.com/200807/Beyond_Compare_2.5.3.253_SC-special.exe
   
二,准备ARM+LINUX开发包

1,在http://www.kernel.org/pub/linux/kernel/v2.6/
    下载linux-2.6.26.tar.bz2
    http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.26.tar.bz2
2,在ftp://ftp.denx.de/pub/u-boot/
    下载u-boot-1.3.4.tar.bz2
ftp://ftp.denx.de/pub/u-boot/u-boot-1.3.4.tar.bz2
3,在http://busybox.net/
    下载BusyBox 1.11.1. (svn, patches, how to add a patch)
http://busybox.net/downloads/busybox-1.11.1.tar.bz2
4,在http://www.arm9.net/download.asp
    下载Jflash2440 ,一个Linux下Jtag烧写工具(含源代码)
http://www.arm9.com.cn/download/sbc2440v3/Jflash_linux.tgz
5,在http://blog.chinaunix.net/u/24474/showart_227846.html
下载Jflash-s3c2410_linux.tar.bz2
http://blogimg.chinaunix.net/blog/upfile/070107195410.bz2
注意:下载后把文件名改回Jflash-s3c2410_linux.tar.bz2

  可参考http://blog.chinaunix.net/u/23070/showart.php?id=157735的
Jflash-s3c2410源码分析(linux).pdf

可参考http://www.datasheetcatalog.org/datasheet2/5/0wd8ohcf4gti5jzkwhd33lhka1ky.pdf
Installation Manual for S3C2440 (linux)

三,安装VMWARE+LINUX开发平台

1,在XP系统上安装VMware-workstation-6.5.0-118166.exe
    A,双击VMware-workstation-6.5.0-118166.exe 启动安装,点击NEXT,选择Typical;再NEXT,安装文件夹选择
        默认;再NEXT,快捷方式产生用默认;再NEXT,按install;进入安装过程,输入使用者,公司和序列号
        JU04H-A8Q82-T3J18-4WF67 ,最后点击finish完成安装,重启动电脑;
    B,双击桌面VMware Workstation启动虚拟机程序,选择接受版权许可后点击OK后即可进入虚拟机界面使用;   

    注意:XP系统需要512MB以上内存,15GB以上硬盘空间。
   
2,在VMware Workstation上安装ubuntu-8.04.1-desktop的X86版本
    A,双击桌面VMware Workstation图标进入虚拟机,点击“New Virtual Machine”启动建立向导;选择Typical;再NEXT;
      选择“Install disc image file(iso)”,点击“Browse”找到存储在硬盘上的“ubuntu-8.04.1-desktop-i386.iso”文件;
      点击NEXT,在“Virtual Machine name”下面输入虚拟机文件名,在“Location”下面选择虚拟机文件夹安装位置;
      点击NEXT,在“Maxinum disk size”上增加到15GB以上,下面选择“Split Virtual disk to 2GB files”;点击NEXT,显示
      虚拟机配置信息,确认无误后点击“finish”即可进入安装过程;
    B,进入虚拟机的操作系统安装过程中,在“ubuntu-8.04.1-desktop-i386.iso”的安装界面中按F2功能键,用上下箭头选择
        “中文(简体)”再按“回车”;用上下箭头选择高亮“安装UBUNTU”时按回车;进入
        ubuntu-8.04.1-desktop 的X86版本的LiveCD界面,出现一个7步的“安装”向导;
    C,在安装向导上点击“前进”,地点用默认“上海”;点击“前进”,键盘布局用默认“China”;点击“前进”硬盘分区
        用默认“向导”,点击“前进”,输入安装用户名和密码;点击“前进”,在“准备安装”中,点击“安装";安装完成
        后,点击“现在重启”;并把虚拟机“VM”“Settings”中的“CD/DVD”改回“Use physical drive”;
       
    注意:XP系统需在DHCP的局域网内,要独立分配IP给虚拟机;安装的用户名和密码区别于ROOT用户,每次登陆系统及修改
        系统配置都要用到,需要牢记。

四,配置并更新ubuntu桌面系统

1,启动根用户和配置网络
A,进入系统后在启动菜单“应用程序”->“附件”->“终端”拉到桌面上;把启动菜单“位置”中的“计算机”也
        拉到桌面上;双击桌面“终端”中打开命令行终端
B,启用root用户并修改密码
        yuanxh@yuanxh-desktop:~$ sudo passwd root
C,进入root用户操作
        yuanxh@yuanxh-desktop:~$ su
D,查看本机IP配置信息
        root@yuanxh-desktop:/home/yuanxh# ifconfig -a
E,在启动菜单“系统”->“系统管理”->“网络”中
  填入IP,子域掩码,网关,DNS等网络参数;
F,修改.bashrc启用ll la l等到命令转义
  root@yuanxh-desktop:/home/yuanxh# vi /root/.bashrc
  root@yuanxh-desktop:/home/yuanxh# source /root/.bashrc
 
2,安装虚拟驱动Vmware tools
A,进入系统后在虚拟机菜单“VM”中点击“Install Vmware tools”后桌面会弹出一个CD-ROM内容的文件夹,里面有两个
  rpm和tar.gz压缩文件包;
B,双击桌面“终端”打开命令行终端,用命令模式安装虚拟驱动:
  切换到root用户
            yuanxh@yuanxh-desktop:~$ su
        建立文件夹
            root@yuanxh-desktop:/home/yuanxh# mkdir vm-tools
        修改文件夹权限
            root@yuanxh-desktop:/home/yuanxh# chmod 777 vm-tools/
        进入文件夹
            root@yuanxh-desktop:/home/yuanxh# cd vm-tools/
        复制虚拟驱动软件包
            root@yuanxh-desktop:/home/yuanxh/vm-tools# cp /media/cdrom0/VMwareTools-6.5.0-118166.tar.gz .
        解压虚拟驱动文件包
            root@yuanxh-desktop:/home/yuanxh/vm-tools# tar xzvf VMwareTools-6.5.0-118166.tar.gz
        进入虚拟驱动文件夹
            root@yuanxh-desktop:/home/yuanxh/vm-tools# cd vmware-tools-distrib/
        运行虚拟驱动安装脚本
            root@yuanxh-desktop:/home/yuanxh/vm-tools/vmware-tools-distrib# ./vmware-install.pl
C,一路按回车键,中间如果有一个编译跳不过,就输入N,再回车,直到最后能选择屏幕分辨率大小[15] 1152 X 864,
   并且鼠标能自由进入虚拟机和XP之间;
D,给vmtools升级
  如果VMware要更新版本的VMware Tools,先卸载旧的vmware tools
    root@yuanxh-desktop:/home/yuanxh/vm-tools/vmware-tools-distrib# ./bin/vmware-uninstall-tools.pl
  再重新安装新的vmware tools
   root@yuanxh-desktop:/home/yuanxh/vm-tools/vmware-tools-distrib# ./vmware-install.pl

3,启用XP与虚拟机系统间的共享文件夹功能
A,在虚拟机菜单“VM”->“settings”中,切换到“options”页;选择到“Shared Folders” 设置,选择“Always enabled”;
   点击“Folders”的“Add” 进入“add Shared Folder wizard”;再点击 NEXT,选择共享文件夹的“Host path”和“name”;点击“NEXT”配置好
  共享文件夹属性后,点击“Finish”;退出向导,点击“OK”退出设置;
B,在设置好共享文件夹后,并且安装好虚拟驱动后启动虚拟机,便可以在虚拟机中看到共享文件夹的内容;
     root@yuanxh-desktop:/home/yuanxh# ls -l  /mnt/hgfs
4,为虚拟机增加并口
A,双击桌面VMware Workstation图标进入虚拟机,先不要启动虚拟系统的电源,在虚拟机菜单“VM”->“settings”中,在“Hardware”页;
  点击窗口下面的“Add...” 进入“add Hardware wizard”;在Hardware Type 中选择“Parallel Port”;再点击 NEXT,在Parallel Port Type
  中选择默认的“Use physicial parallel port on the host”;再点击 NEXT,在physicial parallel port 中选择“LPT1”或者用“Auto detect”,
  在Device status 中选择上“Connect at power on”;最后点击“Finish”完成配置,点击“OK”退出添加硬件向导。
B,然后打开虚拟机电源,进入虚拟Linux系统,就可以使用并口了。其它串口中,USB口增加方式类似。
       
4,更新软件包服务器源后更新升级系统并安装SSH和ZMODEM协议
A,切换到root用户后执行以下命令更新升级系统:
  网络更新系统
        root@yuanxh-desktop:/home/yuanxh# apt-get update
        网络升级系统
        root@yuanxh-desktop:/home/yuanxh# apt-get upgrade
    B,网络安装SSH客户端和服务器端
        root@yuanxh-desktop:/home/yuanxh# apt-get install ssh openssh-server
        只有安装了这个才能用SecureCRT远程终端SSH访问系统
    C,用以下命令查找并安装ZMMODEM协议支持软件包:
        查找rzsz相关软件包
        root@yuanxh-desktop:~# apt-cache search rzsz
        显示lrzsz软件包详细情况
     root@yuanxh-desktop:~# apt-cache show lrzsz       
        网络安装zmodem传输协议
        root@yuanxh-desktop:/home/yuanxh# apt-get install lrzsz
        查看网络下载软件包存放目录
        root@yuanxh-desktop:/home/yuanxh# ll /var/cache/apt/archives/
D,安装开发必需软件包
  root@yuanxh-desktop:/usr/local/arm# apt-get install patch libncurses5-dev make rpm

5,安装SecureCRT远程终端SSH访问虚拟机和启用SFTP文件传输功能
A,双击SecureCRT.v6.0.3.rar里的scrt603.exe,点击“NEXT”;选择“接受协议”,再点击“NEXT”;用默认配置文件,点击“NEXT”
    后选择“Complete”;点击“NEXT”后产生快捷方式用默认;点击“Install”后进行安装,点击“Finish”完成安装;
B,把SecureCRT.v6.0.3.rar里的scrt603-tbe.exe解压到安装目录并运行,点击“patch”,然后对“SecureCRT.exe”破解30天限制使用
   权限;
C,利用SecureCRT的向导建立一个SSH会话到虚拟机;“下一步”后输入虚拟机IP地址和登陆用户名,建立好后双击会话SSH登陆LINUX,
  在会话属性中可配置终端类型,字体,滚屏行数,字符编码,XMODEM和SFTP默认路径等;
D,建立了到LINUX的SSH会话后,在Version 6.0.3 界面的菜单“File”->“Connect SFTP Tab”可启动到相应的LINUX的SFTP连接,
  在SFTP标签中输入“help”可以查看相关的SFTP命令。

五,建立FTP,NFS和交叉编译环境

1,用命令配置TFTP服务
    A, 建立TFTP系统根目录并修改权限
        root@yuanxh-desktop:/home/yuanxh/at91_works# mkdir  /tftpboot
        root@yuanxh-desktop:/home/yuanxh/at91_works# chmod 777  /tftpboot
    B,安装TFTP服务器端和客户端
        root@yuanxh-desktop:/# sudo apt-get install tftp tftpd openbsd-inetd
    C,修改配置文件使用TFTP根目录
        root@yuanxh-desktop:/home/yuanxh/at91_works# vi  /etc/inetd.conf
        在/etc/inetd.conf如下行中,后面路径改成/tftpboot
        tftp    dgram   udp     wait    nobody  /usr/sbin/tcpd /usr/sbin/in.tftpd /tftpboot
    D,启动服务
        root@yuanxh-desktop:/home/yuanxh/at91_works#  /etc/init.d/openbsd-inetd  restart
    E,测试服务
        root@yuanxh-desktop:/home/yuanxh# touch /tftpboot/aaa
        root@yuanxh-desktop:/home/yuanxh# vi /tftpboot/aaa
        root@yuanxh-desktop:/home/yuanxh# tftp 192.168.1.100
        tftp> get aaa
        tftp> quit
        root@yuanxh-desktop:/home/yuanxh# cat aaa

2,用命令配置NFS服务
    A,安装NFS服务器端
        root@yuanxh-desktop:/home/yuanxh# apt-get install nfs-kernel-server  nfs-common  portmap
    B,配置访问目录及权限
        root@yuanxh-desktop:/home/yuanxh/at91_works# mkdir  /nfsboot
        root@yuanxh-desktop:/home/yuanxh/at91_works# chmod 777  /nfsboot
        root@yuanxh-desktop:/home/yuanxh/at91_works# touch  /nfsboot/yuanxh
        root@yuanxh-desktop:/# vi /etc/exports
        在/etc/exports新行中填入以下内容
        /nfsboot  *(rw,sync)
    C,启动服务
        root@yuanxh-desktop:/# exportfs -ra
        root@yuanxh-desktop:/# /etc/init.d/portmap restart
        root@yuanxh-desktop:/# /etc/init.d/nfs-common restart
        root@yuanxh-desktop:/# /etc/init.d/nfs-kernel-server restart
    D,测试服务
        root@yuanxh-desktop:/# mount 192.168.1.100:/nfsboot  /mnt
        root@yuanxh-desktop:/home/yuanxh# ll /mnt
        root@yuanxh-desktop:/home/yuanxh# rm -rf /mnt/yuanxh
        root@yuanxh-desktop:/home/yuanxh# showmount
        root@yuanxh-desktop:/home/yuanxh# df
        root@yuanxh-desktop:/home/yuanxh# umount /mnt
        root@yuanxh-desktop:/home/yuanxh# ll /nfsboot
       
3,安装交叉编译工具链
    A,利用SecureCRT.v6.0.3登陆,传送文件到系统
        root@yuanxh-desktop:/home/yuanxh# mkdir /usr/local/arm
        root@yuanxh-desktop:/home/yuanxh# chmod 777 /usr/local/arm/
        root@yuanxh-desktop:/home/yuanxh# cd /usr/local/arm/
        root@yuanxh-desktop:/usr/local/arm# rz
        在SecureCRT弹出的窗口中选择交叉编译工具安装包arm-2007-01-21.iso
    B,安装ELDK交叉编译工具
     root@yuanxh-desktop:/usr/local/arm# cd /usr/local/
     root@yuanxh-desktop:/usr/local# mkdir eldk-4.1
        root@yuanxh-desktop:/usr/local# mount –o loop –t iso9660 arm-2007-01-21.iso /mnt/cdrom
        root@yuanxh-desktop:/usr/local# cp -av /mnt/cdrom/* eldk-4.1/
        root@yuanxh-desktop:/usr/local# cd eldk-4.1
        root@yuanxh-desktop:/usr/local/eldk-4.1# chmod 777 install
        root@yuanxh-desktop:/usr/local/eldk-4.1# ./install -d /usr/local/arm/eldk-4.1
  注意:eldk-4.1在ubuntu-8.04安装的rpm工具版本有问题,处理方法请查看
  http://lists.denx.de/pipermail/eldk/2008-July/000280.html
  在http://mirror.oss.lzu.edu.cn/software/embedded/eldk/4.2/ppc-linux-x86/distribution/RPMS/
  中下载rpm-4.4.2-46.i386.rpm ,rpm-build-4.4.2-46.i386.rpm,rpm-devel-4.4.2-46.i386.rpm
  在RPMS中增加rpm-4.4.2-46.i386.rpm ,rpm-build-4.4.2-46.i386.rpm,并在etc/rpm_cross.list 前两行中修改启用再安装。
     
    D,把编译器路径添加到系统路径中
        root@yuanxh-desktop:/usr/local/arm#  vi /root/.bashrc
        在alias l='ls -CF'后的空白处填上:
  PATH=$PATH:/usr/local/arm/eldk-4.1/usr/bin:/usr/local/arm/eldk-4.1/bin
  export PATH
  启动新系统路径
  root@yuanxh-desktop:/usr/local/arm# source /root/.bashrc
  显示新系统路径
  root@yuanxh-desktop:/usr/local/arm# echo $PATH
  查看版本号
  root@yuanxh-desktop:/usr/local/arm# arm-linux-gcc -v

六,编译U-BOOT启动代码

1,传送文件包到LINUX系统并解压
    A,利用SecureCRT.v6.0.3登陆,传送文件到系统
        root@yuanxh-desktop:/home/yuanxh# mkdir s3c2410
        root@yuanxh-desktop:/home/yuanxh# chmod 777 s3c2410/
        root@yuanxh-desktop:/home/yuanxh# cd s3c2410/
        root@yuanxh-desktop:/home/yuanxh/s3c2410# rz
        在SecureCRT弹出的窗口中选择u-boot-1.3.4.tar.bz2软件包
    B,解压软件包
        root@yuanxh-desktop:/home/yuanxh/s3c2410# tar xjvf u-boot-1.3.4.tar.bz2
       
2,编译生成U-BOOT启动目标码
    A,进入U-BOOT源码树
        root@yuanxh-desktop:/home/yuanxh/s3c2410# cd u-boot-1.3.4
    B,指定编译器
        root@yuanxh-desktop:/home/yuanxh/s3c2410/u-boot-1.3.4# vi Makefile
        把CROSS_COMPILE = arm-linux- 改成 CROSS_COMPILE=/usr/local/arm/eldk-4.1/usr/bin/arm-linux-
    C,配置并编译
        root@yuanxh-desktop:/home/yuanxh/s3c2410/u-boot-1.3.4# make clean
        root@yuanxh-desktop:/home/yuanxh/s3c2410/u-boot-1.3.4# make mrproper
        root@yuanxh-desktop:/home/yuanxh/s3c2410/u-boot-1.3.4# make smdk2410_config
        root@yuanxh-desktop:/home/yuanxh/s3c2410/u-boot-1.3.4# make
        root@yuanxh-desktop:/home/yuanxh/s3c2410/u-boot-1.3.4# mv u-boot.bin u-boot-smdk2410.bin
D,发送目标码
        root@yuanxh-desktop:/home/yuanxh/s3c2410/u-boot-1.3.4# sz u-boot-smdk2410.bin
       
3,编译生成Jflash工具
    A,利用SecureCRT.v6.0.3登陆,传送文件到系统
     root@yuanxh-desktop:/home/yuanxh/s3c2410# rz
     在SecureCRT弹出的窗口中选择Jflash-s3c2410_linux.tar.bz2软件包
     root@yuanxh-desktop:/home/yuanxh/s3c2410# mkdir Jflash-9gs3c2410
     root@yuanxh-desktop:/home/yuanxh/s3c2410# cd Jflash-9gs3c2410
B,解压软件包
  root@yuanxh-desktop:/home/yuanxh/s3c2410/Jflash-9gs3c2410# tar xvjf ../Jflash-s3c2410_linux.tar.bz2
C,在系统内指定内核头文件和体系结构头文件
  root@yuanxh-desktop:/home/yuanxh/s3c2410/Jflash-9gs3c2410# cd /usr/src
  root@yuanxh-desktop:/usr/src# ln -s linux-headers-2.6.24-19/ linux
  root@yuanxh-desktop:/usr/src# cd linux/include
  root@yuanxh-desktop:/usr/src/linux/include# ln -s asm-x86/ asm
D,在Makefile指定内核头文件和体系结构头文件路径
  root@yuanxh-desktop:/usr/src/linux/include# cd /home/yuanxh/s3c2410/Jflash-9gs3c2410/
  root@yuanxh-desktop:/home/yuanxh/s3c2410/Jflash-9gs3c2410# vi Makefile
  在 Makefile 的CFLAGS = -O2 -s -D__LINUX__ 后面添加上 -I/usr/src/linux/include/ 并保存退出
E,编译SJF生成目标码Jflash-s3c2410并执行
  root@yuanxh-desktop:/home/yuanxh/s3c2410/Jflash-9gs3c2410# make
  root@yuanxh-desktop:/home/yuanxh/s3c2410/Jflash-9gs3c2410# ./Jflash-s3c2410
F,同样的原理,用Jflash_linux.tgz,生成 Jflash-s3c2440 工具

4,用SJF工具烧启动代码到GEC2440开发板
A,按前面所说添加并口给虚拟机用,并把GEC2410_jtag V1.1 板的JP1并口与电脑并口接上,JP2的JTAG_2410口连接到GEC2440核心板
  开发板的J10的脚的标准JTAG口上,并打开开发板电源;
B,在Linux上运行:
  ./Jflash-s3c2440  u-boot-smdk2410.bin /t=5 /d=10
  如果连接上了会显示 S3C2440X(ID=0x0032409d) is detected.
C,在[K9S1208 NAND Flash JTAG Programmer]界面,K9S1208 is detected. ID=0xec76 会检测显示出来,
  在Select the function to test : 后输入0 并回车,确定0:K9S1208 Program 的功能;
D,在[SMC(K9S1208V0M) NAND Flash Writing Program]界面,Available target block number: 0~4095 会显示出来,
  在Input target block number: 后输入0 并回车,确定写入FLASH的首地址;
E,最后会在STATUS:后显示烧写过程Epppppppppppppppppppppppppppppppp好几行,基本是15秒种一个P,直到烧写完毕;
F,烧写完毕后显示0:K9S1208 Program      1:K9S1208 Pr BlkPage   2:Exit 时在 Select the function to test :
  后输入2并回车退出烧录工具。
 
5,移植u-boot-1.3.4到GEC2440开发板
A,修改Makefile
  root@yuanxh-desktop:/home/yuanxh/s3c2410/u-boot-1.3.4/board# vi Makefile
  在Makefile中的EXTRAVERSION = 后添加 -gec2440
  在Makefile中的smdk2410_config后增加如下两行:
   gec2440_config : unconfig
    @$(MKCONFIG) $(@:_config=) arm arm920t gec2440 NULL s3c24x0
B,在/board中添加GEC2440板定义
  root@yuanxh-desktop:/home/yuanxh/s3c2410/u-boot-1.3.4# cd board/
  root@yuanxh-desktop:/home/yuanxh/s3c2410/u-boot-1.3.4/board# cp -av smdk2410/ gec2440
  修改源文件和Makefile
  root@yuanxh-desktop:/home/yuanxh/s3c2410/u-boot-1.3.4/board# cd gec2440/
  root@yuanxh-desktop:/home/yuanxh/s3c2410/u-boot-1.3.4/board/gec2440# mv smdk2410.c gec2440.c
  root@yuanxh-desktop:/home/yuanxh/s3c2410/u-boot-1.3.4/board/gec2440# vi Makefile
  把COBJS   := smdk2410.o flash.o 改成 COBJS   := gec2440.o flash.o
C,在include/configs/中建立配置头文件
  root@yuanxh-desktop:/home/yuanxh/s3c2410/u-boot-1.3.4/board/gec2440# cd ../../include/configs/
  root@yuanxh-desktop:/home/yuanxh/s3c2410/u-boot-1.3.4/include/configs# cp smdk2410.h gec2440.h
D,试编译GEC2440开发板的U-BOOT目标码
  root@yuanxh-desktop:/home/yuanxh/s3c2410/u-boot-1.3.4/include/configs# cd ../../
  root@yuanxh-desktop:/home/yuanxh/s3c2410/u-boot-1.3.4# make mrproper
  root@yuanxh-desktop:/home/yuanxh/s3c2410/u-boot-1.3.4# make clean
  root@yuanxh-desktop:/home/yuanxh/s3c2410/u-boot-1.3.4# make distclean
  root@yuanxh-desktop:/home/yuanxh/s3c2410/u-boot-1.3.4# make gec2440_config
E,修改压缩成u-boot-1.3.4-gev2440.tar.gz
  root@yuanxh-desktop:/home/yuanxh/s3c2410# mv u-boot-1.3.4 u-boot-1.3.4-gev2440
  root@yuanxh-desktop:/home/yuanxh/s3c2410# tar czvf u-boot-1.3.4-gev2440.tar.gz u-boot-1.3.4-gev2440/
  root@yuanxh-desktop:/home/yuanxh/s3c2410# sz u-boot-1.3.4-gev2440.tar.gz
6,修改u-boot-1.3.4-gev2440.tar.gz源码
A,修改include/configs/gec2440.h 文件
  root@yuanxh-desktop:/home/yuanxh/s3c2410# cd u-boot-1.3.4-gev2440/include/configs/
  把
  #define CONFIG_S3C2410          1       /* in a SAMSUNG S3C2410 SoC     */
  #define CONFIG_SMDK2410          1       /* on a SAMSUNG SMDK2410 Board  */
  修改
  #define CONFIG_S3C2440          1       /* in a SAMSUNG S3C2440 SoC     */
  #define CONFIG_GEC2440          1       /* on a SAMSUNG GEC2440 Board  */

 
(调试完毕,但笔记尚未整理完成)
 
   
       
七,为S3C2410编译ARM-LINUX内核

1,传送文件包到LINUX系统并解压
    利用SecureCRT 登陆,传送文件到系统
        root@yuanxh-desktop:/home/yuanxh# cd s3c2410/
        root@yuanxh-desktop:/home/yuanxh/s3c2410# rz
        在SecureCRT弹出的窗口中选择linux-2.6.26.tar.bz2包;
2,解压内核
        root@yuanxh-desktop:/home/yuanxh/s3c2410# tar xjvf linux-2.6.26.tar.bz2
        root@yuanxh-desktop:/home/yuanxh/s3c2410# cd linux-2.6.26
3,为内核指定编译器
        root@yuanxh-desktop:/home/yuanxh/s3c2410/linux-2.6.26# vi Makefile
        把 EXTRAVERSION = -9gs3c2410 写上自己版本标识,指定体系结构和编译器
        ARCH           ?= arm
        CROSS_COMPILE  ?= /usr/local/arm/eldk-4.1/usr/bin/arm-linux-
        添加可加载模块安装路径
        INSTALL_MOD_PATH = $(TOPDIR)/modules-$(KERNELRELEASE)
4,编译内核及发布目标码
    A,查看内核支持的开发板
        root@yuanxh-desktop:/home/yuanxh/s3c2410/linux-2.6.26# make help
    B,配置为S3C2410板默认设置
        root@yuanxh-desktop:/home/yuanxh/s3c2410/linux-2.6.26# make s3c2410_defconfig
    C,编译生成全部目标码
        root@yuanxh-desktop:/home/yuanxh/s3c2410/linux-2.6.26# make
    D,也可分步依次生成zImage,可加载modules和安装可加载模拟到默认目录
        root@yuanxh-desktop:/home/yuanxh/s3c2410/linux-2.6.26# make zImage
        root@yuanxh-desktop:/home/yuanxh/s3c2410/linux-2.6.26# make modules
        root@yuanxh-desktop:/home/yuanxh/s3c2410/linux-2.6.26# make modules_install
    E,发送内核目标码和可加载模块
        root@yuanxh-desktop:/home/yuanxh/s3c2410/linux-2.6.26# cp arch/arm/boot/zImage .
        root@yuanxh-desktop:/home/yuanxh/s3c2410/linux-2.6.26# mv zImage zImage-2.6.26-gec2440.bin
        root@yuanxh-desktop:/home/yuanxh/s3c2410/linux-2.6.26# sz zImage-2.6.26-gec2440.bin
        root@yuanxh-desktop:/home/yuanxh/s3c2410/linux-2.6.26# tar czvf modules-2.6.26-gec2440.tar.gz modules-2.6.26-gec2440/
        root@yuanxh-desktop:/home/yuanxh/s3c2410/linux-2.6.26# sz modules-2.6.26-gec2440.tar.gz
F,个性化配置内核
  root@yuanxh-desktop:/home/yuanxh/s3c2410/linux-2.6.26# make menuconfig
  .config中内核启动命令行参数CONFIG_CMDLINE改为:
  mem=64M console=ttySAC0,115200 initrd=0x32000000,8388608 root=/dev/ram0 rw init=/linuxrc
G,编译生成U-BOOT可识别目标码uImage
  root@yuanxh-desktop:/home/yuanxh/s3c2410/linux-2.6.26# make uImage
  root@yuanxh-desktop:/home/yuanxh/s3c2410/linux-2.6.26# cp arch/arm/boot/uImage .
  root@yuanxh-desktop:/home/yuanxh/s3c2410/linux-2.6.26# mv uImage uImage-2.6.26-gec2440.bin
        root@yuanxh-desktop:/home/yuanxh/s3c2410/linux-2.6.26# sz uImage-2.6.26-gec2440.bin
5,清除内核目标码恢复未配置状态
        root@yuanxh-desktop:/home/yuanxh/s3c2410/linux-2.6.26# make clean
        root@yuanxh-desktop:/home/yuanxh/s3c2410/linux-2.6.26# make distclean
        root@yuanxh-desktop:/home/yuanxh/s3c2410/linux-2.6.26# make mrproper
6,修改linux-2.6.26代码适合GEC2440开发板
A,修改初时钟始化
  root@yuanxh-desktop:/home/yuanxh/s3c2410/linux-2.6.26# vi arch/arm/mach-s3c2440/mach-smdk2440.c
  注释掉原来的时钟初始化函数:
  //      s3c24xx_init_clocks(16934400);  // charge by yuanxihua@21cn.com
  增加上新的时钟初始化定义:
        s3c24xx_init_clocks(12000000);
    B,重新编译内核
     root@yuanxh-desktop:/home/yuanxh/s3c2410/linux-2.6.26# ./mkall
     执行的脚本内容如下:
     #!/bin/sh
  #make by yuanxihua@21cn.com  for GEC2440
  #make s3c2410_defconfig
  make
  make uImage
  cp arch/arm/boot/uImage uImage-2.6.26-9g24x0.bin
  cp uImage-2.6.26-9g24x0.bin /tftpboot
  make modules_install INSTALL_MOD_PATH=./modules-2.6.26-9g24x0
  tar czvf modules-2.6.26-9g24x0.tar.gz ./modules-2.6.26-9g24x0
  cp modules-2.6.26-9g24x0.tar.gz  /tftpboot
C,修改网络CS8900问题
  修改Kconfig
  root@yuanxh-desktop:/home/yuanxh/s3c2410/linux-2.6.26-9g24x0# cd drivers/net/
  root@yuanxh-desktop:/home/yuanxh/s3c2410/linux-2.6.26-9g24x0/drivers/net# vi Kconfig

(调试完毕,但笔记尚未整理完成)

  D,修改LCD驱动问题

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn