您现在的位置:首页 >> 软件安装 >> 内容

uclinux嵌入式操作系统在NiosII平台的安装

时间:2013/1/5 22:50:40 点击:

  核心提示:安装有很多方式,我使用:Windows版的Quartus II和SOPC Builder产生.sof和.ptf文件,并在VMWare上安裝Linux进行μClinux的交叉编译.做之前确认虚拟机硬盘大小...

安装有很多方式,我使用:Windows版的Quartus IISOPC Builder产生.sof.ptf文件,并在VMWare上安裝Linux进行μClinux的交叉编译.做之前确认虚拟机硬盘大小8G.

具体步骤:

 安装交叉编译环境 Nios II gcc cross compiler

1、下载nios2gcc.tar.bz2Altera原厂的nios2gcc-20080203.tar.bz2/usr/local/src

 

2、将nios2gcc.tar.bz2解压缩到/opt/nios2

[root@localhost src]# tar -jxvf nios2gcc.tar.bz2 -C /

 

3、设定cross compiler路径

[root@localhost src]# vi ~/.bash_profile

 

修改bash_profile的內容如下所示,加上/opt/nios2/bin路径

# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
         . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/opt/nios2/bin

export PATH
unset USERNAME

重新执行bash_profile script,让所设定的路径马上生效,因而不必再重新登出登入

[root@localhost src]# source ~/.bash_profile

测试Nios II gcc cross compiler是否安装成功

[root@localhost src]# nios2-linux-uclibc-gcc -v

若出现以下结果,表示Nios II gcc cross compiler已经设定成功

Reading specs from /opt/nios2/lib/gcc/nios2-linux-uclibc/3.4.6/specs
Configured with: /root/buildroot/toolchain_build_nios2/gcc-3.4.6/configure --prefix=/opt/nios2 --build=i386-pc-linux-gnu --host=i386-pc-linux-gnu --target=nios2-linux-uclibc --enable-languages=c --enable-shared --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld --disable-nls --enable-threads --disable-multilib --enable-cxx-flags=-static
Thread model: posix
gcc version 3.4.6

 

 

 编译uCLinux内核

下载μClinux/usr/local/srcuClinux-dist-20070130.tar.gz

uClinux-dist-20070130.tar.gz解压

[root@localhost src]# tar -zxvf uClinux-dist-20070130.tar.gz

uClinux-dist-20070130.tar.gz解压后很大,如果解压出错,可能是虚拟机空间不够大.

下载补丁,μClinux kernel patch for Nios IIuClinux-dist-20070130-nios2-02.7z/usr/local/src/uClinux-dist

安裝补丁 μClinux kernel patch for Nios II

[root@localhost src]# cd uClinux-dist

[root@localhost uClinux-dist]# gunzip -c uClinux-dist-20070130-nios2-02.diff.gz | patch -p0

若出现一下结果,表示补丁成功

patching file vendors/Altera/nios2nommu/config.arch
patching file vendors/Altera/nios2nommu/config.linux-2.6.x
patching file lib/libpng/Makefile
patching file linux-2.6.x/include/asm-nios2nommu/ide.h
patching file linux-2.6.x/include/linux/elf-em.h
patching file linux-2.6.x/usr/Makefile
patching file linux-2.6.x/arch/nios2nommu/kernel/vmlinux.lds.S
patching file linux-2.6.x/arch/nios2nommu/drivers/Kconfig
patching file linux-2.6.x/arch/nios2nommu/drivers/altcf.c
patching file linux-2.6.x/arch/nios2nommu/drivers/pci/Kconfig
patching file linux-2.6.x/arch/nios2nommu/drivers/pci/pci-auto.c
patching file linux-2.6.x/arch/nios2nommu/drivers/pci/pci.c
patching file linux-2.6.x/arch/nios2nommu/drivers/pci/Makefile
patching file linux-2.6.x/arch/nios2nommu/drivers/spi.c
patching file linux-2.6.x/arch/nios2nommu/drivers/Makefile
patching file linux-2.6.x/drivers/mtd/maps/altera.c
patching file linux-2.6.x/drivers/mtd/maps/Kconfig
patching file linux-2.6.x/drivers/net/Kconfig
patching file linux-2.6.x/drivers/net/Makefile
patching file linux-2.6.x/drivers/net/dm9ks.c
patching file linux-2.6.x/drivers/net/open_eth.c
patching file linux-2.6.x/drivers/net/dm9000.c
patching file linux-2.6.x/drivers/net/Space.c
patching file linux-2.6.x/drivers/net/smc91x.c
patching file linux-2.6.x/drivers/net/smc911x.c
patching file linux-2.6.x/drivers/net/mtip1000.c
patching file linux-2.6.x/drivers/usb/Kconfig
patching file linux-2.6.x/drivers/usb/host/Kconfig
patching file linux-2.6.x/drivers/usb/host/isp1362-hcd.c
patching file linux-2.6.x/drivers/usb/host/Makefile
patching file linux-2.6.x/drivers/usb/host/isp1362.h
patching file linux-2.6.x/drivers/usb/Makefile
patching file linux-2.6.x/drivers/ide/ide.c
patching file user/microwin/src/fonts/X6x13.c
patching file user/microwin/src/demos/nxroach/Makefile
patching file user/microwin/src/demos/nanox/nxterm.c
patching file user/microwin/src/demos/nanox/nterm.c
patching file user/microwin/src/demos/nxkbd/keynum.c
patching file user/microwin/src/demos/nxkbd/keyctrl.c
patching file user/microwin/src/demos/nxkbd/keyshft.c
patching file user/microwin/src/Makefile.rules
patching file user/microwin/src/drivers/kbd_ttyscan.c
patching file user/microwin/src/drivers/scr_fb.c
patching file user/microwin/src/drivers/mou_ser.c
patching file user/ftpd/ftpcmd.c
patching file user/ftpd/Makefile

建立配置文件

[root@localhost uClinux-dist]# make xconfig


出现图形界面,Vendor/Product Selection选择Altera

初次编译libc version一定选择none,系统类型要选Default all setting

存档退出

SOPC Builder配置文件system_0.ptf复制到/usr/local/src

根据ptf文件配置

[root@localhost uClinux-dist]# make vendor_hwselect SYSPTF=/usr/local/src/system_0.ptf

出现选择,按照需要进行选择。

我是:1 (CPU_0)1 (cfi_flash_0)2 (sdram)

建立romfs文件夹,错误可忽略。

[root@localhost uClinux-dist]# make romfs

开始编译μClinux核心

[root@localhost uClinux-dist]# make

生成image文件

[root@localhost uClinux-dist]# make linux image

/usr/local/src/uClinux-dist/linux-2.6.x/arch/nios2nommu/boot/下找到zImage

进行硬件和uCLinux的烧写

zImage文件和DE2_NIOS2.sof复制到WindowsD:\altera\70\nios2eds\examples\

打开Nios II Command Shell
开始 -> 程序 -> Altera -> Nios II EDS 9.0 -> Nios II 9.0 Command Shell

sof文件烧入到开发板

[SOPC Builder]$ nios2-configure-sof DE2_NIOS.sof

zImage下载到SDRAM

[SOPC Builder]$ nios2-download -g zImage

启动μClinux

[SOPC Builder]$ nios2-terminal

如果看到下面表示安装成功

 

-------------------------------------------------------------------------------------

专业,代做,代写,承接,MATLAB,SIMULINK,FPGA项目,博士,硕士,本科,毕业设计,课题设计,论文,

期刊,毕业论文,杂志,Coursework,Eassy,Assignment,ISE,QuartusII,Vivado,PlanAhead,

SystemGenerator,Verilog,VHDL,VRML,DSPBuilder,EDK,SDK,MaxplusII,PowerPC,Microblaze

专业代做/代写/承接、MATLAB、SIMULINK、FPGA项目、博士/硕士/本科毕业设计、课题设计、

论文,毕业论文,Coursework、Eassy、Assignment

QQ:122 4848 052


文章转自HighSpeedLogic 原文链接:http://localhost/Html/16.html

作者:本站 来源:网络
  • 您是如何找到本站的?
  • 百度搜索
  • Google搜索
  • 查阅资料过程中
  • 论坛发现
  • 百度贴吧发现
  • 朋友介绍
本站最新成功开发工程项目案例
相关评论
发表我的评论
  • 大名:
  • 内容:
  • matlab代做|matlab专业代做|matlab淘宝代做|FPGA项目合作(www.hslogic.com) © 2023 版权所有 All Rights Reserved.
  • Email:highspeed_logic@163.com 站长QQ: 1224848052

    专业代做/代写/承接、MATLAB、SIMULINK、FPGA项目、博士/硕士/本科课题、Coursework、Eassy、Assignment