Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12605 Discussions

How to build uclinux to DE2 board ,please help!

Altera_Forum
Honored Contributor II
1,311 Views

hi,everybody, 

I have a DE2 board and I want to install uclinux onto the board as the OS,but 

I got some difficulties,would you please info me some files or give me some links  

that about the whole process of the installation.Including the boarc hardware drives 

will be better. 

Thank you very much.
0 Kudos
16 Replies
Altera_Forum
Honored Contributor II
537 Views

 

--- Quote Start ---  

originally posted by lonsta@Jul 14 2006, 04:32 PM 

hi,everybody, 

        i have a de2 board and i want to install uclinux onto the board as the os,but 

i got some difficulties,would you please info me some files or give me some links  

that about the whole process of the installation.including the boarc hardware drives 

will be better. 

      thank you very much. 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=16894) 

--- quote end ---  

 

--- Quote End ---  

 

follow the wiki, step 1-3 

http://nioswiki.jot.com/wikihome/operating...ms/%c2%b5clinux (http://nioswiki.jot.com/wikihome/operating...ms/%c2%b5clinux

 

First, try out the prebuilt kernel.
0 Kudos
Altera_Forum
Honored Contributor II
537 Views

Thanks for your answer ,I am working on it now,but there&#39;s something that confuse me ,as below: 

 

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

[hhh@localhost uClinux-dist-test]$ make linux_hwselect SYSPTF=nios_0.ptf 

KCONFIG_NOTIMESTAMP=1 make ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc- ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc- -C linux-2.6.x hwselect 

no emulation specific options. 

make[1]: Entering directory `/home/mxp/uClinux-dist-test/linux-2.6.x&#39; 

RUNNING hwselect 

 

--- Please select which CPU you wish to build the kernel against: 

 

(1) cpu_0 - Class: altera_nios2 Type: f Version: 5.0 

 

Selection: <<<--------------------------------Q,here 

Invalid response, please try again. 

Selection: niosII 

Invalid response, please try again. 

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

It&#39;s the third step ...But , 

I don&#39;t kown "Selection" WHAT,and I didn&#39;t find the answer in the Wiki , what should I select ,I work 

on the DE2 board, trapped in this step ,I cannot go ahead ,so would you please info me more files that could help understand kernel-building process in details?Thanks a lot !
0 Kudos
Altera_Forum
Honored Contributor II
537 Views

 

--- Quote Start ---  

originally posted by lonsta@Jul 15 2006, 04:41 PM 

thanks for your answer ,i am working on it now,but there&#39;s something that confuse me ,as below: 

 

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

[hhh@localhost uclinux-dist-test]$ make linux_hwselect sysptf=nios_0.ptf 

kconfig_notimestamp=1 make arch=nios2nommu cross_compile=nios2-linux-uclibc-  arch=nios2nommu cross_compile=nios2-linux-uclibc- -c linux-2.6.x hwselect 

  no emulation specific options. 

make[1]: entering directory `/home/mxp/uclinux-dist-test/linux-2.6.x&#39; 

  running hwselect 

 

--- please select which cpu you wish to build the kernel against: 

 

(1) cpu_0 - class: altera_nios2 type: f version: 5.0 

 

selection:                                                              <<<--------------------------------q,here 

invalid response, please try again. 

selection: niosii 

invalid response, please try again. 

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

it&#39;s the third step ...but , 

i don&#39;t kown "selection" what,and i didn&#39;t find the answer in the wiki , what should i select ,i work 

on the de2 board, trapped in this step ,i cannot go ahead ,so would you please info me  more  files that could help understand kernel-building process in details?thanks a lot ! 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=16936) 

--- quote end ---  

 

--- Quote End ---  

 

(1) cpu_0 - Class: altera_nios2 Type: f Version: 5.0 

 

Selection: <<<--------------------------------Q,here 

Invalid response, please try again. 

Selection: 1 

-----------this will b eok,you may try
0 Kudos
Altera_Forum
Honored Contributor II
537 Views

Thanks ,it works,but the next step got a problem ,please ,when I make romfs,the result is as below,I know it can be ignored... 

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

[mxp@localhost uClinux-dist-test]$ make romfs# to creat romfs dir,make will fail,ignored 

for dir in vendors include lib include user ; do [ ! -d $dir ] || make ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc- -C $dir romfs || exit 1 ; done 

make[1]: Entering directory `/home/mxp/uClinux-dist-test/vendors&#39; 

make -C /home/mxp/uClinux-dist-test/vendors/Altera/nios2nommu/. dir_v=/home/mxp/uClinux-dist-test/vendors/Altera/nios2nommu/. -f /home/mxp/uClinux-dist-test/vendors/vendors-common.mak romfs 

make[2]: Entering directory `/home/mxp/uClinux-dist-test/vendors/Altera/nios2nommu&#39; 

[ -d /home/mxp/uClinux-dist-test/romfs/$i ] || mkdir -p /home/mxp/uClinux-dist-test/romfs 

for i in bin dev etc etc/config etc/default home lib mnt proc usr var sys; do  

[ -d /home/mxp/uClinux-dist-test/romfs/$i ] || mkdir -p /home/mxp/uClinux-dist-test/romfs/$i;  

done 

romfs-inst.sh -s /var/tmp /tmp 

romfs-inst.sh ../../Generic/romfs / 

24 blocks 

romfs-inst.sh -s /bin/init /init 

romfs-inst.sh /etc/inittab 

romfs-inst.sh /etc/rc 

echo "Altera/nios2nommu Version 3.2.0 -- " `date` > /home/mxp/uClinux-dist-test/romfs/etc/version 

make[2]: Leaving directory `/home/mxp/uClinux-dist-test/vendors/Altera/nios2nommu&#39; 

make[1]: Leaving directory `/home/mxp/uClinux-dist-test/vendors&#39; 

make[1]: Entering directory `/home/mxp/uClinux-dist-test/include&#39; 

make[1]: Nothing to be done for `romfs&#39;. 

make[1]: Leaving directory `/home/mxp/uClinux-dist-test/include&#39; 

make[1]: Entering directory `/home/mxp/uClinux-dist-test/lib&#39; 

romfs-inst.sh -e CONFIG_USER_FLATFSD_FLATFSD -s config/passwd /etc/passwd 

romfs-inst.sh -e CONFIG_USER_FLATFSD_FLATFSD -s config/group /etc/group 

romfs-inst.sh -e CONFIG_USER_FLATFSD_FLATFSD -s config/mtab /etc/mtab 

romfs-inst.sh -e CONFIG_USER_FLATFSD_FLATFSD -s config/fstab /etc/fstab 

romfs-inst.sh -e CONFIG_USER_FLATFSD_FLATFSD -s config/resolv.conf /etc/resolv.conf 

romfs-inst.sh -e CONFIG_USER_FLATFSD_FLATFSD -e CONFIG_USER_TINYLOGIN_SHADOWPASSWDS -s config/shadow /etc/shadow 

for i in ../include ../include /home/mxp/uClinux-dist-test/prop ; do  

[ ! -d $i ] || make -C $i romfs || exit $? ;  

done 

make[2]: Entering directory `/home/mxp/uClinux-dist-test/include&#39; 

make[2]: Nothing to be done for `romfs&#39;. 

make[2]: Leaving directory `/home/mxp/uClinux-dist-test/include&#39; 

make[2]: Entering directory `/home/mxp/uClinux-dist-test/include&#39; 

make[2]: Nothing to be done for `romfs&#39;. 

make[2]: Leaving directory `/home/mxp/uClinux-dist-test/include&#39; 

make[1]: Leaving directory `/home/mxp/uClinux-dist-test/lib&#39; 

make[1]: Entering directory `/home/mxp/uClinux-dist-test/include&#39; 

make[1]: Nothing to be done for `romfs&#39;. 

make[1]: Leaving directory `/home/mxp/uClinux-dist-test/include&#39; 

make[1]: Entering directory `/home/mxp/uClinux-dist-test/user&#39; 

for i in busybox games inetd init sash telnetd /home/mxp/uClinux-dist-test/prop ; do  

[ ! -d $i ] || make -C $i romfs || exit $? ;  

done 

make[2]: Entering directory `/home/mxp/uClinux-dist-test/user/busybox&#39; 

make[2]: *** &#27809;&#26377;&#35268;&#21017;&#21487;&#20197;&#21019;&#24314;&#30446;&#26631;“romfs”&#12290; &#20572;&#27490;&#12290; 

make[2]: Leaving directory `/home/mxp/uClinux-dist-test/user/busybox&#39; 

make[1]: *** [romfs] &#38169;&#35823; 2 

make[1]: Leaving directory `/home/mxp/uClinux-dist-test/user&#39; 

make: *** [romfs.subdirs] &#38169;&#35823; 1 

[mxp@localhost uClinux-dist-test]$ ls 

autoconf.h config.arch Documentation lib linux-2.6.x openswan SOURCE uClinux-dist.diff.gz 

bin config.in freeswan linux-2.0.x Makefile README tools user 

config COPYING include linux-2.4.x nios_0.ptf romfs uClib 

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

Here- 

Since I ignore the "&#39;fail"",and I then make menuconfig ,the result is as below , it produded error,what it means,and how should I make it ?I nearly got it ,it&#39;s the last step,please help,Thanks so much. 

_____________________________________________________________________________ 

[mxp@localhost uClinux-dist-test]$ make menuconfig 

config/mkconfig > config.in 

make -C /home/mxp/uClinux-dist-test/config/scripts/lxdialog all 

make[1]: Entering directory `/home/mxp/uClinux-dist-test/config/scripts/lxdialog&#39; 

make[1]: Leaving directory `/home/mxp/uClinux-dist-test/config/scripts/lxdialog&#39; 

Using defaults found in .config 

Preparing scripts: functions, parsing...done. 

 

Saving your kernel configuration... 

 

 

*** End of Linux kernel configuration. 

*** Check the top-level Makefile for additional configuration. 

*** Next, you must run &#39;make dep&#39;. 

 

make[1]: Entering directory `/home/mxp/uClinux-dist-test&#39; 

KCONFIG_NOTIMESTAMP=1 make ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc- ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc- -C linux-2.6.x menuconfig 

/bin/sh: nios2-linux-uclibc-gcc: command not found 

make[2]: nios2-linux-uclibc-gcc&#65306;&#21629;&#20196;&#26410;&#25214;&#21040; 

make[2]: Entering directory `/home/mxp/uClinux-dist-test/linux-2.6.x&#39; 

/home/mxp/uClinux-dist-test/linux-2.6.x/arch/nios2nommu/Makefile:127: *** Run "make hwselect SYSPTF=<system.ptf>" first&#12290; &#20572;&#27490;&#12290; 

make[2]: Leaving directory `/home/mxp/uClinux-dist-test/linux-2.6.x&#39; 

make[1]: *** [linux_menuconfig] &#38169;&#35823; 2 

make[1]: Leaving directory `/home/mxp/uClinux-dist-test&#39; 

make: *** [menuconfig] &#38169;&#35823; 2 

[mxp@localhost uClinux-dist-test]$
0 Kudos
Altera_Forum
Honored Contributor II
537 Views

in step 2 of the wiki, install the PATH of the nios2 gcc.

0 Kudos
Altera_Forum
Honored Contributor II
537 Views

Thanks very much ,I made it ,boot the uclinux on the DE2 ,but the second time ,I got an error 

that I&#39;ve never seen before,It&#39;s as below .I use the .ptf file of the example in the DE2 DISK,so I 

think it seems not the problem of .ptf file itselt,so what&#39;s the problem and how should I solve it ? 

 

 

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

[mxp@localhost uClinux-dist-test]$ make menuconfig 

config/mkconfig > config.in 

make -C /home/mxp/uClinux-dist-test/config/scripts/lxdialog all 

make[1]: Entering directory `/home/mxp/uClinux-dist-test/config/scripts/lxdialog&#39; 

make[1]: Leaving directory `/home/mxp/uClinux-dist-test/config/scripts/lxdialog&#39; 

Using defaults found in .config 

Preparing scripts: functions, parsing...done. 

 

Saving your kernel configuration... 

 

*** End of Linux kernel configuration. 

*** Check the top-level Makefile for additional configuration. 

*** Next, you must run &#39;make dep&#39;. 

 

 

[mxp@localhost uClinux-dist-test]$ make linux_hwselect SYSPTF=nios_0.ptf 

KCONFIG_NOTIMESTAMP=1 make ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc- ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc- -C linux-2.6.x hwselect 

no emulation specific options. 

make[1]: Entering directory `/home/mxp/uClinux-dist-test/linux-2.6.x&#39; 

RUNNING hwselect 

ERROR: Could not open SYSTEM ptf file. //<------Q Here. 

make[1]: Leaving directory `/home/mxp/uClinux-dist-test/linux-2.6.x&#39; 

[mxp@localhost uClinux-dist-test]$ 

[mxp@localhost uClinux-dist-test]$ ls 

autoconf.h COPYING linux-2.0.x openswan uClinux-dist.diff.gz 

bin Documentation linux-2.4.x README user 

config freeswan linux-2.6.x SOURCE vendors 

config.arch include Makefile tools 

config.in lib nios_0.ptf uClibc 

[mxp@localhost uClinux-dist-test]$
0 Kudos
Altera_Forum
Honored Contributor II
537 Views

 

--- Quote Start ---  

originally posted by lonsta@Jul 17 2006, 09:00 AM 

[mxp@localhost uclinux-dist-test]$ make linux_hwselect sysptf=nios_0.ptf 

kconfig_notimestamp=1 make arch=nios2nommu cross_compile=nios2-linux-uclibc-  arch=nios2nommu cross_compile=nios2-linux-uclibc- -c linux-2.6.x hwselect 

  no emulation specific options. 

make[1]: entering directory `/home/mxp/uclinux-dist-test/linux-2.6.x&#39; 

  running hwselect 

error: could not open system ptf file.                                                //<------q here. 

make[1]: leaving directory `/home/mxp/uclinux-dist-test/linux-2.6.x&#39; 

[mxp@localhost uclinux-dist-test]$ 

[mxp@localhost uclinux-dist-test]$ ls 

autoconf.h  copying        linux-2.0.x  openswan  uclinux-dist.diff.gz 

bin          documentation  linux-2.4.x  readme    user 

config      freeswan      linux-2.6.x  source    vendors 

config.arch  include        makefile    tools 

config.in    lib            nios_0.ptf  uclibc 

[mxp@localhost uclinux-dist-test]$ 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=16959) 

--- quote end ---  

 

--- Quote End ---  

The ptf has to be in the linux-2.6.x directory OR you have to give "make linux_hwselect" the absolute dir of your ptf. So copy the nios_0.ptf to linux-2.6.x dir or run "make linux_hwselect SYSPTF=/home/mxp/uClinux-dist-test/nios_0.ptf". Hope this helps, it worked for me.
0 Kudos
Altera_Forum
Honored Contributor II
537 Views

Thanks so much! It did work.!I&#39;ve made it . And then I have two questions here .. 

1.What should I do if I want to run my own application programme ,that is to say, I wish some programme run just when the system have booted automatically,are there any steps that I must follow? 

I&#39;ve read of documents on the kernel-start and the system initial , but still I&#39;m a little puzzled .Is the whole  

boot and initial process of uclinux same with linux OS? I will be appreciate if you could info me some documents or links. 

 

2. I&#39;ve leaned ARM linux for a short time .But I want to know how to debug my app programme under uclinux ,like under linux,we can debug through TFTP &mount or NFS or zmodern e.g.But how under uclinux,are there any method and develop tools that could help us to cross compile&run&debug in the  

application level (not cross-compile on kernel level ),just like arm-linux ,when we finish the kernel ,we can focus on the application development. 

Thanks a lot .
0 Kudos
Altera_Forum
Honored Contributor II
537 Views

great! 

 

1. see the wiki, 

http://nioswiki.jot.com/wikihome/operating...nux/uclinuxdist (http://nioswiki.jot.com/wikihome/operatingsystems/%c2%b5clinux/uclinuxdist

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

The simplified "init" program will run etc/rc and etc/inittab during startup. 

If you want to customize startup, you should update the files vendors/Altera/nios2nommu/ rc and inittab.[/b] 

--- Quote End ---  

 

 

2. yes, you can use tftp, ftp, http or nfs mount to develope apps. 

there are tftp, wget, and mount (for nfs) in busybox. 

you can enable them with make menuconfig in uClinux-dist-test . 

http://nioswiki.jot.com/wikihome/operating...ms/nfsfilesytem (http://nioswiki.jot.com/wikihome/operatingsystems/nfsfilesytem)
0 Kudos
Altera_Forum
Honored Contributor II
537 Views

Thanks for hippo&#39;s advise,following the" NFSFileSystem "step by step ,when I download the kernel (include busybox->mount, nfs file support ,and default kernel) 

I got a problem as below: 

 

/>mount -t nfs -n -o nolock,rsize=1024,wsize=1024 192.168.11.17:/home/mxp/nios2 /mnt/nfs //my server ip  

mount : 

cannot read /etc/fstab :No such file or directory 

/etc>ls 

config 

default 

inetd.conf 

inittab 

motd 

rc 

services 

version 

/etc> 

 

however,after a short time ,(I just debug carefully,unkowning why)it becomes: 

 

/>mount -t nfs -n -o nolock,rsize=1024,wsize=1024 192.168.11.17:/home/mxp/nios2 /mnt/nfs 

mount:RPC: Unable to receive ;error = No route to Host 

mount:nfsmount failed; Bad file descriptor 

mount:mount on .168.11.17:/home/mxp/nios2 /mnt/nfs failed 

/>busybox mount //it&#39;s okey,but added with the parameters  

//it got the same error msg like above. 

 

The sopc Builder sdk shell display like above, I know that "mount "informations are all in the "etc/fstab" file ,surely this "/etc/fstab" is supposed to be on the board uclinuxOS,not the one on the linux host ,but but how could I make the" fstab "onto the board ,which should I choose when I config the kernel in the "customize vendor/user setting "menu and "customize kernel setting"menu? 

 

Trouble you for another quesion,in the "customize vendor/user setting "menu, I  

found that the same bash command (e.g.ping etc.)exits in different submenu, 

I want to know what is the difference of them and what useness are these submenus . 

 

Thanks a lot.
0 Kudos
Altera_Forum
Honored Contributor II
537 Views

1. nfs problem, 

on the server, disable firewall, disable SElinux. 

try mount nfs to the server from another Linux PC. 

 

2. same program in different submenu 

some programs provide integration of several commands, eg, busybox, sash, tinylogin. 

there are standalone program, too. 

there are many options, depend on features and size. 

integration saves disk space, but dose not save memory space. 

for nfs mount, you should use the mount in busybox with nfs mount enabled.
0 Kudos
Altera_Forum
Honored Contributor II
537 Views

 

--- Quote Start ---  

originally posted by lonsta@Jul 20 2006, 10:46 AM 

... 

/>mount -t nfs -n -o nolock,rsize=1024,wsize=1024  192.168.11.17:/home/mxp/nios2 /mnt/nfs 

mount:rpc: unable to receive ;error = no route to host 

mount:nfsmount failed; bad file descriptor 

mount:mount on .168.11.17:/home/mxp/nios2 /mnt/nfs  failed 

/>busybox mount                          //it&#39;s okey,but added with the parameters  

                                                  //it got the same error msg like above. 

... 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=17036) 

--- quote end ---  

 

--- Quote End ---  

 

It looks like you have a problem on the command line. it reports: 

mount:mount on .168.11.17:/home/mxp/nios2 /mnt/nfs failed 

instead of: 

mount:mount on 192.168.11.17:/home/mxp/nios2 /mnt/nfs failed 

 

Not sure but you might check it....
0 Kudos
Altera_Forum
Honored Contributor II
537 Views

Thanks for your reply.  

When I config my kernel of "net" part(module), a problem puzzled me ,that is .. 

when I choose Networking options ----------->packet socket:mapped io ,an error occured : net/packet/af_packet.c file in line 1700.(I checked it ) ,a function ""vm_insert_page()"" does not declare 

it is in the function of packet_mmap();but when I disable(leave it blank ) this ooption ,make successfully. 

while configing kernel ,I refer to another book about arm linux kernel -compile .so I want to know the reason of this different ,what&#39;s this option for ?  

Thanks in advance. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif
0 Kudos
Altera_Forum
Honored Contributor II
537 Views

 

--- Quote Start ---  

originally posted by lonsta@Jul 21 2006, 11:17 AM 

thanks for your reply.  

when i config my kernel  of "net" part(module), a problem puzzled me ,that is .. 

when i choose networking options ----------->Packet socket:mapped  IO[/b] ,an error occured : net/packet/af_packet.c file  in line 1700.(I checked it ) ,a  function ""vm_insert_page()"" does not declare 

it is in the function of packet_mmap();but when I disable(leave it blank ) this ooption ,make successfully. 

while configing kernel ,I refer to another book about arm linux kernel -compile .so I want to know the reason of this different ,what&#39;s this option for ?  

Thanks in advance. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif  

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=17059) 

--- Quote End ---  

[/b] 

--- Quote End ---  

 

 

I&#39;m not expert with this sort of thing, but my guess would be that this isn&#39;t implemented on a uCLinux system. There are no "pages" to be inserted as we&#39;re dealing with an MMUless sytem. 

 

Cheers, 

 

- slacker
0 Kudos
Altera_Forum
Honored Contributor II
537 Views

Hello everybody, I am configuring the kernel for the DE2 board and there are ALOT of options and applications. How should I configure the kernel to make use of the DE2_NET project?

0 Kudos
Altera_Forum
Honored Contributor II
537 Views

 

--- Quote Start ---  

originally posted by bigpunx@Nov 8 2006, 02:30 AM 

hello everybody, i am configuring the kernel for the de2 board and there are alot of options and applications.  how should i configure the kernel to make use of the de2_net project? 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=19274) 

--- quote end ---  

 

--- Quote End ---  

 

 

Please start a new thread for your question. Use "new topic" .
0 Kudos
Reply