NIOS II 安装uclinux的硬件要求
Hardware requirements
You should start with a minimal system with only,
Nios II f or s core, with hardware multiplier, (f-core suggested, s-core is slower).
sdram (minimum requirement 8MB),
one full featured timer,
a jtag/serial uart
Note in Linux, irq 0 means auto-detected, so you must not use irq 0 for ANY devices, except for timer.
It is possible to use e-core, but it will be very very slow.
It is possible to run without hardware multiplier, but you will need some hack.
硬件要求
你开始一个最小系统仅仅需要:
1、NIOS II f 或者s 处理器,带硬件乘法器(建议使用NIOS II /f,使用NIOS II/s很慢)
2、最小8M的SDRAM
3、一个全功能的定时器
4、JTAG/UART
备注:在Linux中,中断0意味着自动辨识,所以你不能把中断0分配给任何器件,除了定时器。没有硬件乘法器运行LINUX是可能的,但你需要一些hack。
nios II架构uclinux的过程
开发环境:
在vmware 中安装centos5.2操作系统(在网上下载安装CentOS-5 2-i386-bin-DVD )
本人所使用的开发板为: altera公司的ep2c35f672c6n
宿主机windows开发平台为: windows xp sp3
在宿主机上安装的linux开发平台为centos5.2 内核为: vmlinuz-2.6.18
开发工具为:quartus7.2安装过程
Ok! 现在开始niosii架构uclinux过程
首先要在centos下挂载window 下的一个共享目录便于centos与宿主机传送文件,不会挂载的朋友google 一下linux 下mount命令的使用
在centos操作系统上我的开发目录设在了/home/zhaozhilei
[root@localhost ~]# cd /home/zhaozhilei
安装架构uclinux时所需要的库
[root@localhost zhaozhilei]# sudo yum install git-all make gcc ncurses-devel bison byacc flex
gawk gettext ccache zlib-devel gtk2-devel lzo-devel一.下载uclinux开发包
[root@localhost zhaozhilei]#wget ftp://ftp.altera.com/outgoing/nios2-linux-20080619.tar二.解压nios2-linux-20080619.tar
[root@localhost zhaozhilei]# tar xf nios2-linux-20080619.tar 三.进入nios2-linux目录
[root@localhost zhaozhilei]# cd nios2-linux
ls # see what's in
binutils gcc3 README uClibc use_http_for_update
checkout insight toolchain-build uClinux-dist
elf2flt linux-2.6 u-boot update四.检查文件是否齐全
[root@localhost nios2-linux]#./checkout五.下载交叉编译工具
[root@localhost nios2-linux]# cd ..
[root@localhost zhaozhilei]# wget ftp://ftp.altera.com/outgoing/nios2g...080203.tar.bz2六.解压文件
[root@localhost zhaozhilei]#sudo tar jxf nios2gcc-20080203.tar.bz2 -C /七.添加PATH路径
[root@localhost zhaozhilei]#cd
[root@localhost ~]# vim ./bash_profile
添加:PATH=$PATH:/opt/nios2/bin (红颜色部分是要添加的部分)八.检查是否加入PATH
[root@localhost ~]#echo $PATH
结果应为:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/nios2/bin十.检查交叉编译环境是否安装成功
[root@localhost ~]#nios2-linux-uclibc-gcc –v
结果应为:
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-dist目录
[root@localhost ~i]#cd /home/zhaozhilei/nios2-linux
[root@localhost nios2-linux]#cd uClinux-dist
[root@localhost uClinux-dist]#make menuconfig
确保选择以下内容
Vendor/Product Selection --->
--- Select the Vendor you wish to target
Vendor (Altera) --->
--- Select the Product you wish to target
Altera Products (nios2) ---> Kernel/Library/Defaults Selection --->
--- Kernel is linux-2.6.x
Libc Version (None) --->