From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8949 invoked by alias); 27 Jul 2009 22:55:21 -0000 Received: (qmail 8937 invoked by uid 22791); 27 Jul 2009 22:55:20 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_24,J_CHICKENPOX_25 X-Spam-Check-By: sourceware.org Received: from n7.bullet.re3.yahoo.com (HELO n7.bullet.re3.yahoo.com) (68.142.237.92) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Mon, 27 Jul 2009 22:55:13 +0000 Received: from [68.142.230.28] by n7.bullet.re3.yahoo.com with NNFMP; 27 Jul 2009 22:55:10 -0000 Received: from [67.195.9.83] by t1.bullet.re2.yahoo.com with NNFMP; 27 Jul 2009 23:09:20 -0000 Received: from [67.195.9.97] by t3.bullet.mail.gq1.yahoo.com with NNFMP; 27 Jul 2009 22:55:10 -0000 Received: from [127.0.0.1] by omp101.mail.gq1.yahoo.com with NNFMP; 27 Jul 2009 22:55:10 -0000 Received: (qmail 52723 invoked by uid 60001); 27 Jul 2009 22:55:08 -0000 Message-ID: <562986.10483.qm@web111402.mail.gq1.yahoo.com> Received: from [90.207.29.219] by web111402.mail.gq1.yahoo.com via HTTP; Mon, 27 Jul 2009 15:55:05 PDT References: <110c8b2e0907240804l7324ea44k74798fd1950a5f8@mail.gmail.com> <4A69D00F.6000807@mlbassoc.com> <110c8b2e0907240930g3e4429aek690a32f7282a93ce@mail.gmail.com> <933273.25954.qm@web111409.mail.gq1.yahoo.com> <110c8b2e0907270820k2ba99fbk1fdbeeff148ce5b3@mail.gmail.com> <4A6DEF2B.3010906@mlbassoc.com> Date: Mon, 27 Jul 2009 22:55:00 -0000 From: Weqaar Janjua Subject: Re: Booting ELF image using redboot To: Gary Thomas , Subodh Nijsure Cc: ecos-devel@sourceware.org In-Reply-To: <4A6DEF2B.3010906@mlbassoc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact ecos-devel-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-devel-owner@ecos.sourceware.org X-SW-Source: 2009-07/txt/msg00019.txt.bz2 Hello Subodh, What Gary says, seems to be right, give it a shot. Here is what I would add: You should be able to just "exec" after load? exec is Linux kernel aware. Try simple "exec" before you specify any options or command line to kernel. If not: This should print out the "Entry point" : load -m disk hda2:vmlinux Note that redboot reserves space between 0xa0000 and 0x100000 for option ROMs and the BIOS (http://ecos.sourceware.org/docs-latest/redboot/x86pc.html) Page translation is not used at this stage (MMU is not looked up), exec turns off the MMU. You will need to either use the Entry point as base address from above or specify a base address that is higher than the reserved 0x100000 (depending on your kernel size < memory limit). exec -w 3 -c "console=ttyS0,115200 ip=bootp root=/dev/nfs" [entry address from load -m disk hda2:vmlinux above] >From your data, kernel entry points from System.map and ELF header seem to be different (ELF: 0x12a18), do the Phy to MMU mapping, this may come right. If that doesn't work, we will need to do some further debugging. - Weqaar A. Janjua ----- Original Message ---- From: Gary Thomas To: Subodh Nijsure Cc: Weqaar Janjua ; ecos-devel@sourceware.org Sent: Monday, July 27, 2009 7:17:15 PM Subject: Re: Booting ELF image using redboot Subodh Nijsure wrote: > Hello Weqaar, > > I am still not able to load the ELF image on my board that run > redboot. I am trying to load image that is combined bzImage + ramdisk > produced by wraplinux script. > (http://www.kernel.org/pub/linux/utils/boot/wraplinux/) > > I have included output of readelf -h and 50 lines of system.map > > readelf -h vmlinux.initrd.wrap > ELF Header: > Magic: 7f 45 4c 46 01 01 01 ff 00 00 00 00 00 00 00 00 > Class: ELF32 > Data: 2's complement, little endian > Version: 1 (current) > OS/ABI: Standalone App > ABI Version: 0 > Type: EXEC (Executable file) > Machine: Intel 80386 > Version: 0x1 > Entry point address: 0x12a18 > Start of program headers: 52 (bytes into file) > Start of section headers: 5309992 (bytes into file) > Flags: 0x0 > Size of this header: 52 (bytes) > Size of program headers: 32 (bytes) > Number of program headers: 3 > Size of section headers: 40 (bytes) > Number of section headers: 8 > Section header string table index: 7 > > > > 00000400 A __kernel_vsyscall > 00000410 A SYSENTER_RETURN > 00000420 A __kernel_sigreturn > 00000440 A __kernel_rt_sigreturn > 00100000 A phys_startup_32 > c0100000 T _text > c0100000 T startup_32 > c01000b0 T _stext > c01000b0 t run_init_process > c01000b0 T stext > c01000c4 t init_post > c01001b0 t try_name > c010037b T name_to_dev_t > c01005f0 T calibrate_delay > c01008a0 T thread_saved_pc > c01008aa T disable_hlt > c01008b2 T enable_hlt > c01008ba t poll_idle > c01008bd T dump_task_regs > c01009a8 T select_idle_routine > c01009e3 T arch_align_stack > c0100a18 T mwait_idle_with_hints > c0100a52 t mwait_idle > c0100a5c T sys_vfork > c0100a8c T sys_clone > c0100ac7 T sys_fork > c0100af7 T release_thread > c0100b0a T kernel_thread > c0100b9c T cpu_idle > c0100c05 T dump_thread > c0100d22 T sys_execve > c0100da2 T get_wchan > c0100e22 T sys_set_thread_area > c0100fb6 T sys_get_thread_area > c01010de T show_regs > c01012a1 T default_idle > c01012da T copy_thread > c01014b3 t __switch_to_xtra > c0101518 T __switch_to > c0101640 T cpu_idle_wait > c01016b2 T exit_thread > c010175f T flush_thread > c01017d8 T prepare_to_copy > c0101840 t setup_sigcontext > c01019c9 T sys_sigaltstack > c01019db t restore_sigcontext > c0101bb5 T sys_sigaction > c0101c8a T sys_rt_sigreturn > c0101d62 T do_notify_resume > c0102428 T sys_sigsuspend > Your image has Linux virtual addresses (which happen to correspond to the physical RAM address, but not how RedBoot maps the RAM). Try this: RedBoot> lo -b 0x00100000 ... RedBoot> exec -c "console=ttyS0,115200 ip=dhcp root=/dev/nfs ... Note: no '-b' or '-l' option should be necessary for 'exec' > On Sun, Jul 26, 2009 at 9:33 AM, Weqaar Janjua wrote: >> Please post the first 50 lines of System.map and output from 'readelf -h vmlinux' >> >> - Weqaar A. Janjua >> >> >> >> ----- Original Message ---- >> From: Subodh Nijsure >> To: Gary Thomas >> Cc: ecos-devel@sourceware.org >> Sent: Friday, July 24, 2009 5:30:34 PM >> Subject: Re: Booting ELF image using redboot >> >> See my attempts below (still no joy, I am stumped appreciate help!) >> >> On Fri, Jul 24, 2009 at 8:15 AM, Gary Thomas wrote: >>> Subodh Nijsure wrote: >>>> I am new to using redboot and I need some help. >>>> >>>> This is x86 platform. >>>> >>>> On this platform I can boot the bzImage but not the ELF format linux image. >>>> >>>> Example if I have following boot script my board boots fine. >>>> >>>> load -v -r -m disk -b 0x200000 hda2:bzImage >>>> exec -b 0x200000 -l 0x300000 -c "console=ttyS0,115200 ip=dhcp >>>> root=/dev/nfs (some env specific stuff) " >>>> >>>> However I can not get redboot to load the ELF image I see message ( >>>> Bootsector magic not found (0x8954 @ 0x002001fe) >>>> >>>> (Not this vmlinux was produced by build process that created bzImage >>>> that works) >>>> >>>> load -v -r -m disk -b 0x200000 hda2:vmlinux >>>> exec -b 0x200000 -l 0x300000 -c "console=ttyS0,115200 ip=dhcp >>>> root=/dev/nfs (some env specific stuff) " >>>> Bootsector magic not found (0x8954 @ 0x002001fe) >>>> >>>> Reason I am trying to boot ELF image is I am trying to use wraplinux >>>> utility to wrap kernel and initrd, wraplinux produce >>>> >>>> Would appreciate any pointers as to what parameters I need to fix for >>>> load/exec when loading ELF file. >>> Try leaving out the '-r' and '-b' options - ELF loading >>> should not need them. >> So I tried doing the following >> >> load -v -m disk hda2:vmlinux >> exec -c "console=ttyS0,115200 root=/dev/sda2 ip=dhcp platformid=0x500300" >> >> I also tried to execute exec with that specified -l >> >> load -v -m disk hda2:vmlinux >> exec -l 0x500000 -c "console=ttyS0,115200 root=/dev/sda2 ip=dhcp >> platformid=0x500300" >> >> without any luck objdump for vmlinux shows the following: so I have >> also tried executing >> go 0x00100000 without any luck >> >> >> vmlinux: file format elf32-i386 >> vmlinux >> architecture: i386, flags 0x00000112: >> EXEC_P, HAS_SYMS, D_PAGED >> start address 0x00100000 >> >> Program Header: >> LOAD off 0x00001000 vaddr 0xc0100000 paddr 0x00100000 align 2**12 >> filesz 0x0036032c memsz 0x0036032c flags r-x >> LOAD off 0x00362000 vaddr 0xc0461000 paddr 0x00461000 align 2**12 >> filesz 0x0007a086 memsz 0x000bc000 flags rwx >> NOTE off 0x002b4cd8 vaddr 0xc03b3cd8 paddr 0x003b3cd8 align 2**2 >> filesz 0x00000024 memsz 0x00000024 flags --- >> >> >> >> >> /Subodh >> >> >> >> >> >> -- ------------------------------------------------------------ Gary Thomas | Consulting for the MLB Associates | Embedded world ------------------------------------------------------------