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++

kernal build error

Altera_Forum
Honored Contributor II
2,248 Views

dear hippo, 

Thank you help me , now i bulild the kernal in my custom board (EP1C6,SDRAM(8MB),FLASH(8MB),uart *2,jtat uart ) ,when i run menuconfig ,i  

select the ALTERA JTAG UARTsupport,and the nios serial support, then compile : 

 

[wangzhiwunpu@localhost linux-2.6.x]$ make ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc- 

no emulation specific options. 

CHK include/nios2_system.h 

CHK include/linux/version.h 

SPLIT include/linux/autoconf.h -> include/config/* 

CC init/main.o 

CHK include/linux/compile.h 

CC init/do_mounts.o 

LD init/mounts.o 

LD init/built-in.o 

CHK usr/initramfs_list 

CC arch/nios2nommu/kernel/signal.o 

CC arch/nios2nommu/kernel/setup.o 

CC arch/nios2nommu/kernel/start.o 

arch/nios2nommu/kernel/start.c: In function `main': 

arch/nios2nommu/kernel/start.c:523: warning: label `badshiftci_label' defined but not used 

LD arch/nios2nommu/kernel/built-in.o 

CC kernel/printk.o 

CC kernel/exit.o 

CC kernel/signal.o 

CC kernel/sys.o 

CC kernel/power/console.o 

LD kernel/power/built-in.o 

CC kernel/acct.o 

LD kernel/built-in.o 

CC fs/open.o 

CC fs/dquot.o 

CC fs/devpts/inode.o 

LD fs/devpts/devpts.o 

LD fs/devpts/built-in.o 

CC fs/proc/array.o 

CC fs/proc/proc_tty.o 

CC fs/proc/proc_misc.o 

LD fs/proc/proc.o 

LD fs/proc/built-in.o 

LD fs/built-in.o 

CC drivers/char/mem.o 

drivers/char/mem.c: In function `mmap_kmem': 

drivers/char/mem.c:276: warning: cast to pointer from integer of different size 

CC drivers/char/tty_io.o 

In file included from include/linux/selection.h:11, 

from drivers/char/tty_io.c:104: 

include/linux/vt_buffer.h:19:21: asm/vga.h: No such file or directory 

make[2]: *** [drivers/char/tty_io.o] Error 1 

make[1]: *** [drivers/char] Error 2 

make: *** [drivers] Error 2
0 Kudos
22 Replies
Altera_Forum
Honored Contributor II
777 Views

You should not follow the old buildroot guide. Do not cd linux-2.6.x to make kernel. 

DO NOT MIX UP. 

Follow the step in the new wiki, 

http://nioswiki.jot.com/wikihome/operating...nux/uclinuxdist (http://nioswiki.jot.com/wikihome/operatingsystems/%c2%b5clinux/uclinuxdist)
0 Kudos
Altera_Forum
Honored Contributor II
777 Views

dear hippo, when i process the step according to this command: 

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

Then <exit> <exit> <yes> . 

(see LinuxConfig for kernel config items) 

# compile kernel and apps 

make 

make romfs# rebuild kernel for initramfs 

make linux image  

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

when execute the command : 

 

 

[wangzhiwunpu@localhost uClinux-dist-test]$ make 

 

sl -lcrypt -lutil -lc 

xloader.c:31:29: asm/uCbootstrap.h: No such file or directory 

xloader.c:61: error: syntax error before "m" 

xloader.c:61: warning: data definition has no type or storage class 

xloader.c:67: error: syntax error before "header" 

xloader.c:67: warning: data definition has no type or storage class 

xloader.c:98: error: syntax error before "program" 

xloader.c:99: error: syntax error before "program2" 

xloader.c:100: error: syntax error before "ramload" 

xloader.c:101: error: syntax error before "setbenv" 

xloader.c: In function `_bsc1&#39;: 

xloader.c:108: error: syntax error before &#39;*&#39; token 

xloader.c:114: error: syntax error before &#39;{&#39; token 

xloader.c:191: error: parameter `err&#39; is initialized 

xloader.c:195: error: syntax error before "c" 

xloader.c:367: error: redefinition of parameter &#39;i&#39; 

xloader.c:190: error: previous definition of &#39;i&#39; was here 

xloader.c:368: error: parameter `bytes_read&#39; is initialized 

xloader.c:375: error: syntax error before "if" 

xloader.c:629: error: syntax error before "for" 

xloader.c:647: error: redefinition of parameter &#39;statbuf&#39; 

xloader.c:366: error: previous definition of &#39;statbuf&#39; was here 

xloader.c:648: error: redefinition of parameter &#39;filesize&#39; 

xloader.c:367: error: previous definition of &#39;filesize&#39; was here 

xloader.c:648: error: redefinition of parameter &#39;i&#39; 

xloader.c:367: error: previous definition of &#39;i&#39; was here 

xloader.c:648: error: redefinition of parameter &#39;n&#39; 

xloader.c:367: error: previous definition of &#39;n&#39; was here 

xloader.c:649: error: redefinition of parameter &#39;percent&#39; 

xloader.c:370: error: previous definition of &#39;percent&#39; was here 

xloader.c:650: error: redefinition of parameter &#39;ferror_image&#39; 

xloader.c:371: error: previous definition of &#39;ferror_image&#39; was here 

xloader.c:653: error: syntax error before "if" 

make[2]: *** [xloader] Error 1 

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

make[1]: *** [all] Error 2 

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

make: *** [subdirs] Error 1 

[wangzhiwunpu@localhost uClinux-dist-test]$ 

 

 

thanks!!
0 Kudos
Altera_Forum
Honored Contributor II
777 Views

1. Did you apply the Nios2 patches to uClinux-dist-test? 

cd ~ tar jxf uClinux-dist-test-20060511.tar.bz2 cd uClinux-dist-test zcat uClinux-dist.diff.gz | patch -p0 

 

2. when you run "make menuconfig" , check if you have the correct target? 

Vendor/Product Selection --->  

--- Select the Vendor you wish to target  

(Altera) Vendor  

--- Select the Product you wish to target  

(nios2nommu) Altera Products  

then <exit> 

 

3. still in "make menuconfig", try restore to default setting, 

Kernel/Library/Defaults Selection --->  

(linux-2.6.x) Kernel Version  

(None) Libc Version  

[*] Default all settings (lose changes)  

[ ] Customize Kernel Settings  

[ ] Customize Vendor/User Settings  

[ ] Update Default Vendor Settings  

Then <exit> <exit> <yes> 

 

4. "make" again.
0 Kudos
Altera_Forum
Honored Contributor II
777 Views

dear hippo, 

Thank you, when I do according to you i could do next commands successfully, 

-------------------------------------# compile kernel and apps 

make 

make romfs# rebuild kernel for initramfs 

make linux image  

---------------------------------sucessed 

 

then i do : 

http://nioswiki.jot.com/wikihome/operating...x/tryoutuclinux (http://nioswiki.jot.com/wikihome/operatingsystems/%c2%b5clinux/tryoutuclinux

 

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

/cygdrive/c/altera 

[sopc builder]$ nios2-download -g zImage... 

 

Using cable "byteBlaster II [LPT1]",device1,instance 0x00 

pausing target processor:OK 

downloaded 745KB in 17.9s<42.1KB/s> 

Verify failed 

Leaving target processor pauseed 

 

cygdrive/c/altera 

 

 

 

thanks
0 Kudos
Altera_Forum
Honored Contributor II
777 Views

It may be 

1. problem of sdram timing or hardware, you should run some sdram test or hello on IDE/HAL . 

2. byteblaster is not stable, altera recommend usb blaster for nios2 download. 

Try add termination to jtag signal on your board.
0 Kudos
Altera_Forum
Honored Contributor II
777 Views

If I were you, I wouldn&#39;t try to jump right into uCLinux on a new board. I would start small, with something like "Hello World" or "Count Binary". Be sure that all of your major interfaces (flash, RAM, etc.) function before moving on to anything more complex. There&#39;s even a provided example for testing the flash and SDRAM, though you&#39;ll have to modify it, slightly, to get it to fully test your system. 

 

It&#39;s like building a wall. You wouldn&#39;t want to add another layer of bricks to something that isn&#39;t solid, would you? 

 

Best Regards, 

 

- slacker
0 Kudos
Altera_Forum
Honored Contributor II
777 Views

 

--- Quote Start ---  

originally posted by hippo@May 31 2006, 11:15 AM 

it may be 

1. problem of sdram timing or hardware, you should run some sdram test or hello on ide/hal . 

2. byteblaster is not stable, altera recommend usb blaster for nios2 download. 

  try add termination to jtag signal on your board. 

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

--- quote end ---  

 

--- Quote End ---  

 

You have 8MB sdram,  

you should set boot loader offset to 5M in kernel config. http://nioswiki.jot.com/wikihome/operating...nux/linuxconfig (http://nioswiki.jot.com/wikihome/operatingsystems/%c2%b5clinux/linuxconfig

 

cd ~/uClinux-dist-test 

make menuconfig 

 

Kernel/Library/Defaults Selection ---> 

(linux-2.6.x) Kernel Version 

(None) Libc Version 

[ ] Default all settings (lose changes) 

[*] Customize Kernel Settings 

[ ] Customize Vendor/User Settings 

[ ] Update Default Vendor Settings 

Then <exit> <exit> <yes> 

 

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

--- Quote Start ---  

If you use DEII with 8M sdram, change the link address of the uncompress loader, 

 

Processor type and features-->(0x00500000) Link address offset for booting. 

 

The zImage load address is ( your sdram base address + link address offset ) . The zImage boot loader does not relocate itself.[/b] 

--- Quote End ---  

 

 

Then "make" again.
0 Kudos
Altera_Forum
Honored Contributor II
777 Views

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

--- Quote Start ---  

If you use DEII with 8M sdram, change the link address of the uncompress loader, 

 

Processor type and features-->(0x00500000) Link address offset for booting. 

 

The zImage load address is ( your sdram base address + link address offset ) . The zImage boot loader does not relocate itself.[/b] 

--- Quote End ---  

 

==================================== 

 

Thanks,I am sure the FLASH and the SDRAM is no problem ,because i tested the hardware and can run UCOS/2 application and other programs. 

 

the flash(8MB) base address is 0x000000,the sdram(8MB) base address is 0x800000,so i set the zImage load address :0x500000+0x800000=0x0d00000, 

and then make ,still has the same problem. 

 

why set the link address offset 0x500000? 

thanks
0 Kudos
Altera_Forum
Honored Contributor II
777 Views

 

--- Quote Start ---  

originally posted by nwpu_zhf2004@May 31 2006, 03:40 PM 

<div class='quotetop'>quote  

--- quote end ---  

 

--- quote start ---  

if you use deii with 8m sdram, change the link address of the uncompress loader, 

 

processor type and features-->(0x00500000) link address offset for booting. 

 

the zimage load address is ( your sdram base address + link address offset ) . the zimage boot loader does not relocate itself. 

--- Quote End ---  

 

==================================== 

 

Thanks,I am sure the FLASH and the SDRAM is no problem ,because i tested the hardware and can run UCOS/2 application and other programs. 

 

the flash(8MB) base address is 0x000000,the sdram(8MB) base address is 0x800000,so i set the zImage load address :0x500000+0x800000=0x0d00000, 

and then make ,still has the same problem. 

 

why set the link address offset 0x500000? 

thanks 

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

[/b] 

--- Quote End ---  

 

Did you "make linux image" ? 

 

You should set Link address offset for booting to 0x500000, not 0xd00000 . 

Kernel config will add up with sdram start. 

During nios2-download , what is the load address show up? 

 

try, 

nios2-linux-uclibc-objdump -h zImage 

 

it should display, .text start from VMA/LMA 0xd00000 .
0 Kudos
Altera_Forum
Honored Contributor II
777 Views

Thank you very much! you are so intelligent !  

I have successed! 

 

thank you very much again!!!
0 Kudos
Altera_Forum
Honored Contributor II
777 Views

for these command: 

cd uClinux-dist-test 

zcat uClinux-dist.diff.gz | patch -p0 

 

 

i want to known the where the uClinux-dist.diff.gz i should palce! 

 

the uClinux-dist-test dir or anywhere???
0 Kudos
Altera_Forum
Honored Contributor II
777 Views

 

--- Quote Start ---  

originally posted by iriver@Jun 4 2006, 09:14 PM 

for these command: 

      cd uclinux-dist-test 

zcat uclinux-dist.diff.gz | patch -p0 

 

 

i want to  known the where the uclinux-dist.diff.gz i should palce! 

 

the uclinux-dist-test dir or anywhere??? 

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

--- quote end ---  

 

--- Quote End ---  

 

You can place it in uClinux-dist-test, 

but anywhere should work if you give the path.
0 Kudos
Altera_Forum
Honored Contributor II
777 Views

hi hippo: 

 

I set Link address offset for booting to 0x500000, 

 

but,when i nios2-download,the load address 0x00D000000 show up! 

 

I don&#39;t know why?
0 Kudos
Altera_Forum
Honored Contributor II
777 Views

The zImage load address is ( your sdram base address + link address offset ) .  

 

You problem is cuased by the sof. The sof included in the DE2 disc (v1.3,v1.4,v1.5) is no good. You should recompile the sof or use older sof, the one attached in the wiki is v1.1 .
0 Kudos
Altera_Forum
Honored Contributor II
777 Views

 

--- Quote Start ---  

 

The zImage load address is ( your sdram base address + link address offset ) .  

 

You problem is cuased by the sof. The sof included in the DE2 disc (v1.3,v1.4,v1.5) is no good. You should recompile the sof or use older sof, the one attached in the wiki is v1.1 . 

 

 

I use the .sof file you offer, and i download my linux.but i can not work.Then i download the zImage you offer,it can work.So i think the problem may not be cansed by the sof.
0 Kudos
Altera_Forum
Honored Contributor II
777 Views

Please try "make clean", 

Start the make all over again. with "make menuconfig" to default, 

[*] Default all settings (lose changes)
0 Kudos
Altera_Forum
Honored Contributor II
777 Views

I try again as you tell me,but there is also the problem!Could you give me a DE2_NET project? This is my EMAIL:li8126@sina.com

Thanks!!
0 Kudos
Altera_Forum
Honored Contributor II
777 Views

I follow the step in the new wiki, 

http://nioswiki.jot.com/wikihome/operating...nux/uclinuxdist (http://nioswiki.jot.com/wikihome/operating...nux/uclinuxdist

Where you guys getting this error: 

 

I tried following the instructions from the wiki http://nioswiki.jot.com/wikihome/operating...ems/framebuffer (http://nioswiki.jot.com/wikihome/operating...ems/framebuffer

but I ran into this error when trying to run make in the uClinux-dist/ 

 

fs/buffer.c: In function `__find_get_block_slow&#39;: 

fs/buffer.c:292: warning: long unsigned int format, size_t arg (arg 3) 

LD fs/built-in.o 

CC drivers/char/tty_io.o 

In file included from include/linux/selection.h:11, 

from drivers/char/tty_io.c:103: 

include/linux/vt_buffer.h:18:21: asm/vga.h: No such file or directory 

make[3]: *** [drivers/char/tty_io.o] &#38169;&#35823; 1 

make[2]: *** [drivers/char] &#38169;&#35823; 2 

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

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

make: *** [linux] &#38169;&#35823; 1
0 Kudos
Altera_Forum
Honored Contributor II
695 Views

 

--- Quote Start ---  

originally posted by liuxiaoping@Apr 2 2007, 08:14 PM 

i follow the step in the new wiki, 

http://nioswiki.jot.com/wikihome/operating...nux/uclinuxdist (http://nioswiki.jot.com/wikihome/operating...nux/uclinuxdist

where you guys getting this error: 

 

i tried following the instructions from the wiki http://nioswiki.jot.com/wikihome/operating...ems/framebuffer (http://nioswiki.jot.com/wikihome/operating...ems/framebuffer

but i ran into this error when trying to run make in the uclinux-dist/ 

 

fs/buffer.c: in function `__find_get_block_slow&#39;: 

fs/buffer.c:292: warning: long unsigned int format, size_t arg (arg 3) 

ld fs/built-in.o 

cc drivers/char/tty_io.o 

in file included from include/linux/selection.h:11, 

from drivers/char/tty_io.c:103: 

include/linux/vt_buffer.h:18:21: asm/vga.h: no such file or directory 

make[3]: *** [drivers/char/tty_io.o] &#38169;&#35823; 1 

make[2]: *** [drivers/char] &#38169;&#35823; 2 

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

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

make: *** [linux] &#38169;&#35823; 1 

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

--- quote end ---  

 

--- Quote End ---  

 

You must disable these two console, 

 

Device Drivers --> Graphics support ---> 

Console display driver support ---> 

[ ] VGA text console 

< > Framebuffer Console support
0 Kudos
Reply