Forum Discussion
Altera_Forum
Honored Contributor
20 years agothe question of the starting of uclinux by u-boot
when i download the kernel and filesystem of uclinux to the flash 0x0 ,
uclinux can rightly startup. but, when i use the u-boot to startup the kernel and filesystem of uclinux by the bootm command, the program is always running the half to stop. follows: U-Boot 1.1.3 (Dec 28 2005 - 19:11:13) CPU : Nios-II SYSID : d4a9fbb0, Mon Dec 19 06:36:32 2005 BOARD : Altera EP-1C6 *** Warning - bad CRC, using default environment ==> bootm 0x00040000# # Booting image at 00040000 ... Image Name: 2.6.4 kernel for EP1C6 Image Type: Nios-II Linux Kernel Image (gzip compressed) Data Size: 459971 Bytes = 449.2 kB Load Address: 00800000 Entry Point: 00800000 Verifying Checksum ... OK Uncompressing Kernel Image ... OK my u-boot is downloaded the address of 0x00000000;the kernel of uclinux is downloaded the address of 0x00040000;the filesystem of uclinux is downloaded the address of 0x00150000. my load address is 0x00800000;my entry address is 0x00800000.(0x00800000 is my sdram the base address.) why? can someone help me! thanks!16 Replies
- Altera_Forum
Honored Contributor
Hi lucky,
Please strip your linux and u-boot elf files and post the header objdump for both. Also, please provide the following information: -- flash base address and size -- sdram base address and size -- restart address -- exception address Regards, --Scott - Altera_Forum
Honored Contributor
hi Scott:
"Please strip your linux and u-boot elf files and post the header objdump for both." i do not understand your mean. can you tell me how to do in detail? "-- flash base address and size -- sdram base address and size -- restart address -- exception address" my board parameter: flash: 0x00000000----0x003fffff(4MB) sdram: 0x00800000----0x00ffffff(8MB) restart address: 0x00000000 exception address: 0x00800020 TEXT_BASE = 0x00fc0000 u-boot download address: 0x00000000 the kernel of uclinux download address: 0x00040000 the kernel of uclinux load address is 0x00800000 the kernel of uclinux entry address is 0x00800000 the filesystem of uclinux download address: 0x00150000 the filesystem of uclinux load address is 0x00c00000 the filesystem of uclinux entry address is 0x00c00000 vmlinux.bin.gz is 450KB romfs.bin.gz is 756KB download method: mkimage the *.bin.gz to uImage (and romfs) and then, nios2-flash-program the uImage (and romfs) to NOR flash thanks lucky - Altera_Forum
Honored Contributor
Hi Lucky,
> > "Please strip your linux and u-boot elf files and post the header objdump for both." > > i do not understand your mean. can you tell me how to do in detail? For u-boot $ nios2-elf-strip u-boot $ nios2-elf-objdump -h u-boot For kernel: $ nios2-elf-strip vmlinux $ nios2-elf-objdump -h vmlinux Another question: are you using a data cache? Regards, --Scott - Altera_Forum
Honored Contributor
1
i make an experiment about using the u-boot to startup the uclinux by the your said method that folloes as: For u-boot $ nios2-elf-strip u-boot $ nios2-elf-objdump -h u-boot For kernel: $ nios2-elf-strip vmlinux $ nios2-elf-objdump -h vmlinux and then download to NOR flash. but, the question is the same to the before question: the cursor winding in the windows and my developing board's led is not winding(maybe die). 2 "Another question: are you using a data cache?" my nios2 is the nios/e(no instruction cache and no data cache). - Altera_Forum
Honored Contributor
Hi lucky,
> i make an experiment about using the u-boot to startup the uclinux by the > your said method that folloes as: ... > and then download to NOR flash. I was asking you to run nios2-elf-objdump on u-boot and the kernel ... and post the output in this Nios Forum Topic, so I can see how you have your sections mapped. You should also try booting an uncompressed image. Regards, --Scott - Altera_Forum
Honored Contributor
1 reply to Scott
the output of nios2-elf-objdump -h u-boot: u-boot: file format elf32-littlenios2 sections: idx name size vma lma file off algn 0 .text 00017da9 00fc0000 00fc0000 00000094 2**4 contents, alloc, load, readonly, code 1 .u_boot_cmd 000003c0 00fd7dac 00fd7dac 00017e3d 2**2 contents, alloc, load, data 2 .data 00000a6c 00fd816c 00fd816c 000181fd 2**2 contents, alloc, load, data 3 .bss 00003cd4 00fd8be0 00fd8be0 00018c69 2**2 alloc 4 .comment 000007e5 00000000 00000000 00018c69 2**0 contents, readonly the output of nios2-elf-objdump -h vmlinux: vmlinux: file format elf32-littlenios2 sections: idx name size vma lma file off algn 0 .text 000d7aa4 00800000 00800000 00000094 2**3 contents, alloc, load, readonly, code 1 .data 0001c550 008d7ab0 008d7ab0 000d7b38 2**4 contents, alloc, load, data 2 .init 0000d2a4 008f4000 008f4000 000f4088 2**2 contents, alloc, load, code 3 .bss 0000a220 009012b0 009012b0 0010132c 2**4 alloc 4 .sbss 00000022 0090b4d0 0090b4d0 0010132c 2**0 alloc, small_data 5 .eram 00000000 01000000 01000000 0010132c 2**0 contents 6 .romfs .data 00000000 00200000 00200000 0010132c 2**0 contents 7 .comment 00002850 00000000 00000000 0010132c 2**0 contents, readonly 2 i use the custom developing board which is not altera and Microtronix. whether or not i need to port uclinux for my board? 3 can i modify the kernel or filesystem download \ load and entry point address in the memory? if yes, how to do it? - Altera_Forum
Honored Contributor
Hi Lucky,
I don't see anything suspicious in your objdump. A few more questions: 1. How did you create your compressed kernel image? 2. Did you try booting an uncompressed image? If not please try booting an uncompressed u-boot image file -- let us know if you have the same problem. 3. Your image says, "2.6.4 kernel for EP1C6" -- is this correct? Or are you actually using 2.6.11 or higher? Regards, --Scott - Altera_Forum
Honored Contributor
hi scott:
"1. How did you create your compressed kernel image?" i use the command to compress the kernel : gzip -9 vmlinux.bin mkimage -A nios2 -O linux -T kernel -C gzip -a 0x00800000 -e 0x00800000 -n 'Linux Kernel Image' -d vmlinux.bin.gz uImage.img mkimage -A nios2 -O linux -T filesystem -C gzip -a 0x00c00000 -e 0x00c00000 -n 'romfs EP1C6' -d romfs.bin.gz romfs.img "2. Did you try booting an uncompressed image? If not please try booting an uncompressed u-boot image file -- let us know if you have the same problem." i use the command according to what you said : mkimage -A nios2 -O linux -T kernel -C none -a 0x00800000 -e 0x00800000 -n 'Linux Kernel Image' -d vmlinux.bin uImage.img mkimage -A nios2 -O linux -T filesystem -C none -a 0x00c00000 -e 0x00c00000 -n 'romfs EP1C6' -d romfs.bin romfs.img $SOPC_KIT_NIOS2/bin/bin2flash --flash=U5 --location=0x00000000 --input=u-boot.bin --output=u-boot.flash $SOPC_KIT_NIOS2/bin/bin2flash --flash=U5 --location=0x00040000 --input=uImage.img --output=uImage.flash $SOPC_KIT_NIOS2/bin/bin2flash --flash=U5 --location=0x00200000 --input=romfs.img --output=romfs.flash and then, i download the three files to the NOR flash by the nios2-flash-programmer. but, when i use the command of "bootm 00040000", the output: ==> bootm 00040000# # Booting image at 00040000 ... Image Name: linux kernel Image Image Type: Nios-II Linux Kernel Image (uncompressed) Data Size: 1053348 Bytes = 1 MB Load Address: 00800000 Entry Point: 00800000 Verifying Checksum ... OK OK have the same problem. i am more confused now. why is not ok when i use the u-boot to startup the uncompressed kernel. if i upload the kernel and romfs to NOR flash, and then, running the nios2-termianl, the output is ok! i feel the question relates the address. because, i am not setting the any address in making the kernel and romfs. but, i do not know how to do. "3. Your image says, "2.6.4 kernel for EP1C6" -- is this correct? Or are you actually using 2.6.11 or higher?" i do not know the version of uclinux kernel, the "2.6.4 kernel for EP1C6" is added at random. in fact, the real version is "linux version 2.6.11-uc0(sl@wst-9faecf0fdb1) (gcc version 3.4.1(altera niosii 5.0 b73))" sorry, i forgot to say: when i make the kernel, i delete: drivers/char/altera_pio_button \ drivers/ide/ide \ drivers/net/smc91111. if i do not this, it is always to wrong when i make the kernel. - Altera_Forum
Honored Contributor
Maybe you are using JTAG-UART??
After you linux booted up by u-boot, you should use nios2-terminal in NIOS2 shell to see the log of linux booting. By this way, the linux will work ok. - Altera_Forum
Honored Contributor
yes, i am using JTAG-UART.
when i use nios2-terminal in NIOS2 shell to see the log of linux booting. By this way, the linux will work ok. but, when i use the u-boot' bootm command to startup the kernel of uclinux, it always halt to do it. i use the myself board, not altera and macrotronic' developing board. i do not know to how to porting the kernel to my board. i am vexation. that is a pity.