On 1/29/15 09:37, Chen Gang S wrote:
> On 1/29/15 06:36, Peter Maydell wrote:
>> On 28 January 2015 at 22:09, Chen Gang S <gang.c...@sunrus.com.cn> wrote:
>>>  - Is what I said above really correct (e.g. is linux-user really mainly
>>>    for cpu emulation)?.
>>
>> Not really. linux-user is mainly for running single Linux binaries.
>> It has a secondary use for running gcc test binaries which think
>> they are "bare metal" but actually use some kind of semihosting API.
>> (You should check whether tile has one of those.)
>>
>> As well as linux-user mode, QEMU has system emulation mode, where
>> we emulate a complete machine.
>>
>> Both modes need CPU emulation.
>>
> 
> OK, thanks.
> 
> For coding and test, is linux-user a good starting position for me? (I
> guess it is).
> 

At present, I make a static program which will print "Hello world" for
microblaze architecture, and can excute successfully.

  [root@localhost qemu]# cat test.c
  #include <stdio.h>
  
  int main()
  {
        printf("Hello world!\n");
        return 0;
  }
  [root@localhost qemu]# /upstream/release/bin/microblaze-gchen-linux-gcc -Wall 
-O2 -static -o test.mb test.c
  [root@localhost qemu]# file ./test.mb
  ./test.mb: ELF 32-bit MSB executable, Xilinx MicroBlaze 32-bit RISC, version 
1 (SYSV), statically linked, for GNU/Linux 2.6.32, not stripped
  [root@localhost qemu]# ls -l ./test.mb
  -rwxr-xr-x. 1 root root 3224540 Feb  5 06:39 ./test.mb
  [root@localhost qemu]# ./microblaze-linux-user/qemu-microblaze ./test.mb
  Hello world!
  
And I also generate tile "Hello world" static program:

  [root@localhost qemu]# /upstream/release-tile/bin/tilegx-gchen-linux-gcc 
-Wall -O2 -static -o test.tgx test.c
  [root@localhost qemu]# file ./test.tgx 
  ./test.tgx: ELF 64-bit LSB executable, Tilera TILE-Gx, version 1 (SYSV), 
statically linked, for GNU/Linux 2.6.32, not stripped
  [root@localhost qemu]# ls -l ./test.tgx 
  -rwxr-xr-x. 1 root root 3611376 Feb  5 06:42 ./test.tgx

I shall try to let tile "Hello world" static program run successfully
within this month:

 - 1st patch: can run an empty elf64 tile executable in linux-user.
   (try to finish within 2015-02-15).

 - 2nd patch: can run "Hello world" elf64 tile program in linux-user.
   (try to finish within 2015-02-25, it seems hard to finish in time).

 - 3rd patch: for completion, or fixing issues, or documentations.
   (try to finish within 2015-02-28).


Welcome any ideas, suggestions, and completions.

Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed

Reply via email to