Re: [uClinux-dev] Re: [leon_sparc] Help on elf2flt

From: Joe deBlaquiere (jadb@redhat.com)
Date: Thu May 31 2001 - 10:25:06 EDT


If I understand correctly you can run the program natively on the CPU 
without an OS and get the output via tsim. When recompile the program to 
run on the OS you still get output on tsim.

Are you linking the program with uClibc? It sounds like you're not 
making the syscalls to the OS but rather using a statically linked 
printf function which pipes to tsim instead of sending output to the 
kernel with a write call

Stanley wrote:

> My apology, didn't add this into the earlier mail,
> 
> the kernel got through include/sparcnommu/processor.h: start_thread 
> without showing any helloworld.
> 
>  
> 
> thanks
> 
>  
> 
>     ----- Original Message -----
>     
>     *From:* Stanley <mailto:stanley@alumni.com>
>     
>     *To:* leon_sparc@yahoogroups.com <mailto:leon_sparc@yahoogroups.com>
>     ; uclinux-dev@uclinux.org <mailto:uclinux-dev@uclinux.org>
>     
>     *Sent:* Wednesday, May 30, 2001 5:50 PM
>     
>     *Subject:* [leon_sparc] Help on elf2flt
>     
>     
>     Hi all,
>     
>      
>     
>     I am working on elf2flt, a elf to flat binary format conversion
>     program.
>     
>     Firstly, i created a simple program that outputs "hello world" to
>     the console, the program works over tsim.
>     
>     Next,  I converted the program using elf2flt,
>     
>     Then, linking the flt executable into uClinux, instead of seeing
>     some "hello world" at the console, i got the output over tsim.
>     
>      
>     
>     Hope some kind soul can explain what the output really means.
>     
>      
>     
>     Maybe there is something wrong with my simple program, is it
>     rightful to extrapolate that a program works over tsim, the same
>     program after conversion should work with uClinux ?
>     
>      
>     
>     I have some gut feeling that i need to open ttyS0 in the helloworld
>     program.
>     
>      
>     
>     -------- Output of uClinux for LEON-----
>     
>     BINFMT_FLAT: Loading file: 4003eee8
>     
>     Free pages: 3784kB
>     
>     ( 0*4kB 1*8kB 0*16kB 0*32kB 1*64kB 1*128kB 14*256kB = 3784kB, %0
>     frag, %0 slack)
>     
>     hdr->entry = 64, hdr->data_start = 66099, hdr->data_end = 66099,
>     hdr->bss_end = 66104, hdr->stac
>     
>     k_size = 4096
>     
>     Stack = 4149, (1)
>     
>     BINFMT_FLAT: mmap returned: 403c0018
>     
>     Free pages: 3656kB
>     
>     BINFMT_FLAT: RAM mapping of file
>     
>     ROM mapping is 403c0018, Entry point is 40, data_start is 10233
>     
>     start_code: 403c0058, end_code: 403d024b
>     
>     start_data: 403d024b, end_data: 403d024b
>     
>     Loaded flat file, BSS=403d024b, DATA=403d024b, TEXT=403c0058
>     
>     p=403d1281
>     
>     putstringarray(1)
>     
>     put_string '/bin/init'
>     
>     p2=403d1277
>     
>     p(filename)=403d1277
>     
>     putstringarray(2)
>     
>     put_string 'TERM=linux'
>     
>     p2=403d126c
>     
>     put_string 'HOME=/'
>     
>     p2=403d1265
>     
>     p(envp)=403d1265
>     
>     putstringarray(1)
>     
>     put_string 'init'
>     
>     p2=403d1260
>     
>     p(argv)=403d1260
>     
>     p(create_flat_tables)=403d1248
>     
>     arg_start = 403d1260
>     
>     arg_end = 403d1265
>     
>     env_start = 403d1265
>     
>     env_end = 403d1277
>     
>     start_stack: 403d1248
>     
>     Free pages: 3656kB
>     
>     ( 0*4kB 1*8kB 0*16kB 0*32kB 1*64kB 0*128kB 14*256kB = 3656kB, %0
>     frag, %46 slack)
>     
>     
>     *Yahoo! Groups Sponsor*
>     [www.debticated.com]
>     <http://rd.yahoo.com/M=190462.1393721.2979173.2/S=1702208843:N/A=551014/?http://www.debticated.com>
>     
>     
>     Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
>     <http://docs.yahoo.com/info/terms/>.


-- 
Joe deBlaquiere
Red Hat, Inc.
307 Wynn Drive
Huntsville AL, 35805
voice : (256)-704-9200
fax   : (256)-837-3839

This message resent by the uclinux-dev@uclinux.org list server http://www.uClinux.org/


This archive was generated by hypermail 2.1.4 : Thu Sep 19 2002 - 13:19:46 EDT