Received: from eggs.gnu.org ([2001:4830:134:3::10]:44172) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJ8rc-0002ox-Vs for qemu-devel@nongnu.org; Wed, 04 Feb 2015 17:56:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJ8rZ-0005Cv-O4 for qemu-devel@nongnu.org; Wed, 04 Feb 2015 17:56:04 -0500 Message-ID: <54D2A547.8090404@sunrus.com.cn> Date: Thu, 05 Feb 2015 07:03:35 +0800 From: Chen Gang S MIME-Version: 1.0 References: <54C4DC4E.3080306@sunrus.com.cn> <54C5672D.4080800@sunrus.com.cn> <54C6566B.6050205@sunrus.com.cn> <20150128142705.GA22971@afflict.kos.to> <54C95E09.1030107@sunrus.com.cn> <54C98EF3.3070405@sunrus.com.cn> In-Reply-To: <54C98EF3.3070405@sunrus.com.cn> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] linux-user/syscall.c: Let all lock_user_struct() and unlock_user_struct() paired with each other List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Trivial , Riku Voipio , Michael Tokarev , qemu-devel 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 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 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