Dear KJ and Arthor,
Thank you for your response. The discussion I have saw before.

Here is some of my experience sharing:
1.edit "vendors/config/armnommu/config.arch"
   (1) set "DISABLE_XIP = 1" in the beginning.
   (2) Line96
-       ELF2FLT   = elf2flt
+       ELF2FLT   = $(CROSS_COMPILE)elf2flt
   (3) set "FLTFLAGS := -r -s <stack size you want>" in line220
2.edit"/usr/local/bin/arm-linux-ld"(using sudo vi
/usr/local/bin/arm-linux-ld)
   (1)Line147
-       if [ "yes" = "yes" ]
+       if [ "yes" = "no" ]
   (2)Line153
-       if [ "yes" = "no" ]
+       if [ "yes" = "yes" ]
   (3)Line155
-       $LINKER $EMUL $SDIRS -T $LDSCRIPT -Ur -d -o "$OFILE.elf"
$ARG1         ||exit $?
+      $LINKER $EMUL $SDIRS -T $LDSCRIPT -Ur -d -q -o "$OFILE.elf"
$ARG1         ||exit $?

3.I know it is very tricky and dirty, but after such modifications. The
applet in romfs turns to "Flags:        0x1 ( Load-to-Ram )", except the
'busybox', I have to do arm-linux-elf2flt again manually from
busybox_unstripped.elf.

4.The worked applet was "init", "sh" and "expand"; the "cat", "mkdir" and
"ls" will execute fail, so I turn them to be the busybox and working.(But I
think this issue maybe belong to my platform only, I will check later.)

Then the uClinux work and I see the shell prompt. Please kindly comment me
if you have any idea. Thank you very much! :-)

Drag
Below is my booting messages:

Linux version 2.6.25-uc0 (dra...@dragcom) (gcc version 4.2.1) #429 PREEMPT
Tue Dec 30 09:12:05 CST 2008
CPU: NXP-LPC2888 [00007700] revision 0 (ARMv3), cr=00000000
Machine: ARM-Versatile PB
Warning: bad configuration page, trying to continue
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
Kernel command line: root=/dev/ram0 ro mem=...@0x4000000 initrd=0x4200000,2M
rootfstype=romfs keepinitrd init=/bin/init console=ttyS0
PID hash table entries: 128 (order: 7, 512 bytes)
Console: colour dummy device 80x30
Serial: PL011 console setup.
console [ttyS0] enabled
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 32MB = 32MB total
Memory: 29048KB available (1160K code, 141K data, 76K init)
Mount-cache hash table entries: 512
checking if image is initramfs...it isn't (bad gzip magic numbers); looks
like an initrd
NetWinder Floating Point Emulator V0.97 (double precision)
io scheduler noop registered
io scheduler anticipatory registered (default)
Serial: AMBA PL011 UART driver
Serial: AMBA PL011 port added.
QVP-KNL: drivers/serial/amba-pl011.c(953)-pl011_init: ret =0 .
brd: module loaded
loop: module loaded
mice: PS/2 mouse device common for all mice
RAMDISK: romfs filesystem found at block 0
RAMDISK: Loading 1080KiB [1 disk] into ram disk... done.
VFS: Mounted root (romfs filesystem) readonly.
Freeing init memory: 76K
Shell invoked to run file: /etc/rc
Command: hostname QVP
Command: /bin/expand /etc/ramfs.img /dev/ram1
Command: mount -t proc proc /proc
Command: mount -t ext2 /dev/ram1 /var
Command: mkdir /var/tmp
Command: mkdir /var/log
Command: mkdir /var/run
Command: mkdir /var/lock
Command: mkdir /var/empty
Command: cat /etc/motd
Welcome to
          ____ _  _
         /  __| ||_|
    _   _| |  | | _ ____  _   _  _  _
   | | | | |  | || |  _ \| | | |\ \/ /
   | |_| | |__| || | | | | |_| |/    \
   |  ___\____|_||_|_| |_|\____|\_/\_/
   | |
   |_|

GDB/ARMulator support by <dav...@snapgear.com>
For further information check:
http://www.uclinux.org/

Command:
Execution Finished, Exiting

Sash command shell (version 1.1.1)
/>


2008/12/30 Lin KJ <lkjau2...@yahoo.com.tw>

>  Hi Drag,
>
> There are some issues on "arm-linux-tools-20070808" and
> "arm-linux-tools-20061213" toolchains for both XIP uClinux/non-XIP uClinux.
> I posted the conclusions before according to my experience on exploring the
> toolchains for ARM uClinux.
> See http://www.mail-archive.com/uclinux-dev@uclinux.org/msg05643.html.
> For XIP uClinux, you can NOT use the compiler version newer than gcc-4.x
> because of  the "R_ARM_GOTOFF32" relocation type.
> However, if you want to use gcc-3.x compiler, you should make sure your
> compiler library "libgcc.a" is compilied with "-fpic -msingle-pic-base" XIP
> flags  .
> For non-XIP uClinux, you have to modify the wrapper linker to bypass the
> "-a" option to the elf2flt.
>
> For me, i selected to build my ARM XIP uClinux by the re-built toolchain.
> I re-built the gcc-3.4.6 toolchain by buidroot script with the
> uClibc-0.9.29 and it ran very well.
>
> KJ
>
>
>
>
>
>  ------------------------------
> *寄件者:* Arthur Wong <wzc0...@gmail.com>
> *收件者:* uClinux development list <uclinux-dev@uclinux.org>
> *寄件日期:* 2008/12/29(星期一) 上午9:42:37
> *主 旨:* Re: [uClinux-dev] How to build bFLT without flag:"Has-PIC-GOT"
>
> Hi.
>
> 2008/12/27 Yuan-Lung Li <dra...@gmail.com>
>
>> Dear all,
>> I have search the solution for this problem about 2 months...
>> Here is my environment:
>>
>> Toolchain:
>> arm-linux-tools-20070808.tar.gz fownloaded from
>> http://ftp.snapgear.org/pub/snapgear/tools/arm-linux/arm-linux-tools-20070808.tar.gz
>>
>
> Do you have tried the arm-linux-gcc.3.4.x, such as arm-linux-tools-20061213
> ?
>
>
>
>> <http://ftp.snapgear.org/pub/snapgear/tools/arm-linux/arm-linux-tools-20070808.tar.gz>
>>
>> uClinux Distribution:
>> uClinux-dist-20080808.tar.gz downloaded from
>> http://www.uclinux.org/pub/uClinux/dist/uClinux-dist-20080808.tar.bz2
>>
>> Now I got stuck on the booting after /bin/init running. Seems the init
>> launch the sash shell and then do_rc in the /etc/rc in the romfs. After
>> first command "hostname XXXX" executed, the program counter goes some
>> invalid place. I am using the non-XIP version of kernel. I did some trial as
>> below:
>> 1. replace the first command as "ls /bin" or "cat /etc/motd", the main
>> function of them works well but the platform dead after return.
>> 2. I download the romfs "romfs.2.4.x" from
>> http://www.uclinux.org/pub/uClinux/utilities/armulator/romfs.2.4.x.gz
>>  The OS start and I see the promt!!!
>> 3. I use the arm-linux-flthdr to check the binary in "romfs.2.4.x" every
>> bFlt in /bin has the header below:
>> /mnt/bin/init
>>     Magic:        bFLT
>>     Rev:          4
>>     Build Date:   not specified
>>     Entry:        0x50
>>     Data Start:   0x3050
>>     Data End:     0x33b0
>>     BSS End:      0x48b0
>>     Stack Size:   0x1000
>>     Reloc Start:  0x33b0
>>     Reloc Count:  0x94
>>     Flags:        0x1 ( Load-to-Ram )
>> 4. I also check the binaries in my romfs directory, evey bFlt in
>> romfs/bin has the header below:
>> romfs/bin/init
>>     Magic:        bFLT
>>      .....
>>     Flags:        0x2 ( Has-PIC-GOT )
>> 5. modifying the "vendors/config/armnommu/config.arch" to make the
>> LDFLAGS+= -Wl,-elf2flt="-r", the build result of the romfs bFlt as below:
>> romfs/bin/init
>>     Magic:        bFLT
>>     .........
>>     Flags:        0x3 ( Load-to-Ram Has-PIC-GOT )
>>   The romfs still made my platform dead in nasty place.
>> 6. I have trace many discussion, some kind like "arm-linux-flthdr -r
>> romfs/init", the result is the same as trial number 5.
>>
>> How can I build the romfs with the bFlt in pure "Load-to-Ram"(aka the
>> Flags:0x1)?
>>
>> Many thanks for any idea and replying.
>>
>> Drag
>>
>> _______________________________________________
>> uClinux-dev mailing list
>> uClinux-dev@uclinux.org
>> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
>> This message was resent by uclinux-dev@uclinux.org
>> To unsubscribe see:
>> http://mailman.uclinux.org/mailman/options/uclinux-dev
>>
>
>
>    付費才容量無上限?Yahoo!奇摩電子信箱2.0免費給你,信件永遠不必刪! - 
> *馬上體驗*<http://tw.rd.yahoo.com/referurl/mail/mail20/tag_hot0103/*http://tw.mg0.mail.yahoo.com/dc/landing>
> !
>
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to