Forum Discussion
Altera_Forum
Honored Contributor
20 years agokernel image in SDRAM but not booting?
Hello:
I have used the u-boot successully coping the uclinux kernel image from flash to sdram .I verified the contents at and near the start address of the sdram , same with the kernel image.bin using the ultraedit,md.b command.But the kernel stop .I see the file nios_linux.c I don't know what is the function kernel() ,also I can't find source file . Let me know why if you have any more ideas on this... Thank you ! Best Regards jigdo12 Replies
- Altera_Forum
Honored Contributor
The next problem :
I use go command but error below: *****warning unimplemented trap @ 0x100015c # # Application terminated, rc = 0xFFFFFF82 my sdram base_addr 0x1000000 Best Regards jigdo - Altera_Forum
Honored Contributor
Hi jigdo,
First ... what version of u-boot are you using, and where did you get it from? > I have used the u-boot successully coping the uclinux kernel image from flash to sdram How did you do this? You must use the bootm command to correctly boot a kernel. > But the kernel stop What does this mean? Please provide some details -- it is difficult for us to guess what you are observing ;-) > see the file nios_linux.c I don't know what is the function kernel() The _variable_ "kernel" is a function pointer ... it points to the entry point of the kernel. When you create a u-boot kernel image with mkimage, you specify this address with the -e option. > I use go command but error below: > > *****warning unimplemented trap @ 0x100015c Please provide more details ... what address did you specify? ... what is at the address that you specify? What are you trying to do? Regards, --Scott - Altera_Forum
Honored Contributor
Hi scott:
First > How did you do this? You must use the bootm command to correctly boot a kernel. I use bootm command to boot a kernel: bootm BASE_ADDR_SDRAM >But the kernel stop What does this mean? Please provide some details -- it is difficult for us to guess what you are observing ;-) when the code run to the function kernel( ), in the nios2-terminal : the last line : Uncompressing Kernel Image ...........OK cursor wink > see the file nios_linux.c I don't know what is the function kernel() The _variable_ "kernel" is a function pointer ... it points to the entry point of the kernel. When you create a u-boot kernel image with mkimage, you specify this address with the -e option. I use the printf("%08x\n",hdr->ih_ep); the hdr->ih_ep is 0x000000001 (entry_point should be 0x1000000 (BASE_ADDR_SDRAM ) ) >> I use go command but error below: > > *****warning unimplemented trap @ 0x100015c Please provide more details ... what address did you specify? ... what is at the address that you specify? What are you trying to do? I think the method is wrong . Besides ,I use the nios2-flash-programmer to download the u-boot and kernel. in the mkimage,the load_address and the entry_address both are BASE_ADDR_SDRAM. Best Regards jigdo - Altera_Forum
Honored Contributor
Hi jigdo,
> I use bootm command to boot a kernel: > bootm BASE_ADDR_SDRAM ... > Uncompressing Kernel Image ...........OK ... > Besides ,I use the nios2-flash-programmer to download the u-boot and kernel. ... > in the mkimage,the load_address and the entry_address both > are BASE_ADDR_SDRAM. I _think_ I understand ... but I'm not sure. Based on your comments, you should be doing the following: -Use the flash programmer to download your compressed u-boot kernel image to flash. This is the binary file you create using mkimage. -From the u-boot command line, you should specify the address (in flash) of the image file. This tells u-boot to read the image from flash, uncompress it and write the uncompressed data to the "load address". U-boot will then disable interrupts, and jump to the "entry point address". When you try to uncompress a u-boot image to the same address as the u-boot image, the uncompressed data will overwrite the compressed data ... and bad things will happen ;-) Regards, --Scott - Altera_Forum
Honored Contributor
Hi scott:
Can you tell me where can I find the source code of "ntohl( )"? > I use the printf("%08x\n",hdr->ih_ep); the hdr->ih_ep is 0x000000001 but the entry address is 0x1000000 (base_addr_sdram) I don't know why? Best Regards jigdo - Altera_Forum
Honored Contributor
Hi jigdo,
Please post the result of the imi command for your u-boot kernel image. E.g. if your compressed kernel image is at address 0x00200000: ==> imi 200000 And post the result of a mkimage list. E.g. if your image file name is kernel.img: $ mkimage -l kernel.img > the hdr->ih_ep is 0x000000001 but the entry address is 0x1000000 (base_addr_sdram) > > I don't know why? It looks like an endian order problem. Did you build the mkimage utility yourself, or are you using the pre-built version from psyent.com? Regards, --Scott - Altera_Forum
Honored Contributor
Hi scott:
I use the u-boot-1.1.3 downloaded from www.souceforge.net I see the readme the mkimag command used as fellow: mkimage -A ppc -O linux -T kernel -C gzip -a 0 -e 0 -n "Linux Kernel Image" -d linux.bin.gz uImage I think the uImage file also is .bin type file,so I use bin2flash comand convert the uImage to uImage.flash,then download to .flash file use nios2-flash-programmer . I don't have the .img file. >It looks like an endian order problem I am sure the niosII is little endian,because in the vmlinux.lds file , "OUTPUT_FORMAT("elf32-littlenios2", "elf32-littlenios2", "elf32-littlenios2")" Best Regards jigdo - Altera_Forum
Honored Contributor
Hi jigdo,
> mkimage -A ppc -O linux -T kernel -C gzip > -a 0 -e 0 -n "Linux Kernel Image" > -d linux.bin.gz uImage Based on your previous posts, this should be: mkimage -A nios2 -O linux -T kernel -C gzip -a 0x1000000 -e 0x1000000 -n "Linux Kernel Image" -d linux.bin.gz uImage > I think the uImage file also is .bin type file,so I use bin2flash comand convert the uImage > to uImage.flash,then download to .flash file use nios2-flash-programmer . Correct. > I don't have the .img file. It is the uImage file ... the output of mkimage. > I am sure the niosII is little endian This is irrelevant. It is the header that is apparently incorrect (which is always stored in network byte order by mkimage). Again, if you post the results of imi and mkimage -l, I may be able to help. Regards, --Scott - Altera_Forum
Honored Contributor
Hi, scott
I got the same error. And I am from China,too. (cannot surf http://www.pysent.com) (http://www.pysent.com)) Could you send me the patch to [email protected] or [email protected], thank u. <div class='quotetop'>QUOTE </div> --- Quote Start --- In file included from /usr/include/sys/unistd.h:9, ????????from /usr/include/unistd.h:6, ????????from img2srec.c:61: /usr/include/sys/types.h:106: conflicting types for `int8_t' /usr/include/stdint.h:38: previous declaration of `int8_t' /usr/include/sys/types.h:108: warning: redefinition of `int16_t' /usr/include/stdint.h:39: warning: `int16_t' previously declared here /usr/include/sys/types.h:110: warning: redefinition of `int32_t' /usr/include/stdint.h:40: warning: `int32_t' previously declared here /usr/include/sys/types.h:112: warning: redefinition of `int64_t' /usr/include/stdint.h:45: warning: `int64_t' previously declared here make[1]: *** Error 1 make[1]: Leaving directory `/cygdrive/d/My_Project/MtxCyclone_uBoot/BootLoader/u-boot-1.1.3/tools make: *** [tools] Error 2[/b] --- Quote End --- - Altera_Forum
Honored Contributor
Hi mountain8848,
> Could you send me the patch to [email protected] or [email protected], thank u. Done ... you're more than welcome. Regards, --Scott BTW: The main u-boot source tree is no longer at sourceforge.net ... it has been moved to denx.net and is now using git (a welcome change). For details please see: http://sourceforge.net/mailarchive/message...msg_id=12658390 (http://sourceforge.net/mailarchive/message.php?msg_id=12658390)