В Sat, 27 Jul 2013 16:44:39 +0200 Vladimir 'φ-coder/phcoder' Serbinenko <phco...@gmail.com> пишет:
> > It would be the first step, but my problem is, I cannot make it work > > even using concatenation. u-boot does show me correct image info for > > embedded grub, but I cannot launch it. Using default load address > > 0x08000000 qemu errors out because address is not in RAM (and it will > > not let me change amount of RAM for versatilepb); I tried to change > > load address to something else, like 0x04000000 and it just immediately > > resets in this case after "bootm 0x04000000". > > > You probably have to change GRUB link address. And not that the address > is where to find the source image not where to load to. > I did try to change link address (arm_uboot_ldflags and GRUB_KERNEL_ARM_UBOOT_LINK_ADDR). As I understand, bootm is expected to relocate image to load address and jump to start address. What I have now is 1. U-Boot is configured for versatileqemu. It works in the sense I can start example standalone hello_world using bootm. 2. Grub us build for arm-uboot bor@opensuse:~/build/grub> ./configure --with-platform=uboot TARGET_CC=arm-linux-gnueabi-gcc --target=arm TARGET_LD=arm-linux-gnueabi-ld (I also tried with TARGET_CFLAGS="-marm -mno-thumb-interwork -mabi=aapcs-linux -march=armv5te" to match U-Boot flags) 3. core.img is generated using bor@opensuse:~/build/grub> ./grub-mkimage --verbose -d grub-core -O arm-uboot -o core.img ./grub-mkimage: info: the total module size is 0x20. ./grub-mkimage: info: getting the size of grub-core/kernel.img. ./grub-mkimage: info: reading grub-core/kernel.img. ./grub-mkimage: info: getting the size of grub-core/kernel.img. ./grub-mkimage: info: locating the section .text at 0x0. ./grub-mkimage: info: locating the section .rodata at 0x14750. ./grub-mkimage: info: locating the section .data at 0x165a0. ./grub-mkimage: info: locating the section .module_license at 0x16fa8. ./grub-mkimage: info: locating the section .bss at 0x16fc8. ./grub-mkimage: info: kernel_img=0x144dda0, kernel_size=0x16fc8. ./grub-mkimage: info: the core size is 0x16fe8. ./grub-mkimage: info: writing 0x17028 bytes. bor@opensuse:~/build/grub> file core.img core.img: u-boot legacy uImage, , Linux/ARM, OS Kernel Image (Not compressed), 94184 bytes, Sun Jul 28 20:46:54 2013, Load Address: 0x08000000, Entry Point: 0x08000000, Header CRC: 0x5F6F0B3E, Data CRC: 0x474F38F8 4. "flash" is built using bor@opensuse:~/src/u-boot-2013.04> cat u-boot.bin ~/build/grub/core.img > test.bin Offset of core.img is bor@opensuse:~/src/u-boot-2013.04> printf "0x%X\n" $(expr $(stat -c%s u-boot.bin) + 65536) 0x2B558 5. I now can start it bor@opensuse:~/src/u-boot-2013.04> qemu-system-arm -M versatilepb -m 256M -serial stdio -kernel test.bin Warning: default mac address being used, creating potential for address conflict audio: Unknown audio driver `pa' audio: Run with -audio-help to list available drivers U-Boot 2013.04 (Jul 28 2013 - 20:16:17) DRAM: 128 MiB WARNING: Caches not enabled Using default environment In: serial Out: serial Err: serial Net: SMC91111-0 Warning: SMC91111-0 using MAC address from net device VersatilePB # And it shows correct image info VersatilePB # iminfo 0x2B558 ## Checking Image at 0002b558 ... Legacy image found Image Name: Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 94184 Bytes = 92 KiB Load Address: 08000000 Entry Point: 08000000 Verifying Checksum ... OK VersatilePB # But it simply resets at the attempt to launch it VersatilePB # bootm 0x2B558 ## Booting kernel from Legacy Image at 0002b558 ... Image Name: Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 94184 Bytes = 92 KiB Load Address: 08000000 Entry Point: 08000000 Loading Kernel Image ... OK OK Starting kernel ... resetting ... _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel