From patchwork Fri Jan 29 21:22:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Yasin_Yenid=C3=BCnya?= X-Patchwork-Id: 44035 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A0973B7D1F for ; Sat, 30 Jan 2010 08:28:54 +1100 (EST) Received: from localhost ([127.0.0.1]:34306 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NayKe-0005me-Rs for incoming@patchwork.ozlabs.org; Fri, 29 Jan 2010 16:24:48 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NayJ2-0005Lj-IB for qemu-devel@nongnu.org; Fri, 29 Jan 2010 16:23:08 -0500 Received: from [199.232.76.173] (port=51708 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NayJ2-0005Kb-26 for qemu-devel@nongnu.org; Fri, 29 Jan 2010 16:23:08 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NayI9-00061D-BQ for qemu-devel@nongnu.org; Fri, 29 Jan 2010 16:22:17 -0500 Received: from mail-ew0-f221.google.com ([209.85.219.221]:61844) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NayI8-00060j-FE for qemu-devel@nongnu.org; Fri, 29 Jan 2010 16:22:13 -0500 Received: by ewy21 with SMTP id 21so3420760ewy.2 for ; Fri, 29 Jan 2010 13:22:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:references :in-reply-to:subject:date:message-id:mime-version:content-type :content-transfer-encoding:x-mailer:thread-index:content-language; bh=m4HwpE4ER58OFj9VucWXolAuxlmUn+dfgu0I/NPmVMk=; b=ahIU83YaC7k8KF+3eu6RhQ6tyUS3K6py+HUAZB9zqYJuYUmjxBefgJIq6lW13Fdli9 tCZQKMZZcBq6H4PZdpge0k6Eqjn5Aq+EISefH8zGBrkiUbNJah7gnjm2mh4k0jYuW3ZM I1Nuyvn/yQPlhQAKgu+FsXvzORq7bimhIuVRs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:references:in-reply-to:subject:date:message-id:mime-version :content-type:content-transfer-encoding:x-mailer:thread-index :content-language; b=qsVuv9cqPhzASa2dxJdQQV3vL9ynoHxN2JJF3AC4X8y3C+XS1s7421ReYYzCS5kF2g z5HYOkgh5DBWGWOz2xW6VaUCrrk2tE938xdrCYCXp2AJhauHYs1IlWmZ/fdy1zkyeOWK yXJNvz2Wk7YEnemmZjn4Fflm+JKOjRLmLJ7nI= Received: by 10.213.48.205 with SMTP id s13mr1308232ebf.91.1264800130778; Fri, 29 Jan 2010 13:22:10 -0800 (PST) Received: from TEM04 ([78.188.164.96]) by mx.google.com with ESMTPS id 14sm1657186ewy.7.2010.01.29.13.22.07 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 29 Jan 2010 13:22:09 -0800 (PST) From: =?iso-8859-9?Q?Yasin_Yenid=FCnya?= To: References: <4b6348fb.8853f10a.36f1.734cSMTPIN_ADDED@mx.google.com> In-Reply-To: <4b6348fb.8853f10a.36f1.734cSMTPIN_ADDED@mx.google.com> Date: Fri, 29 Jan 2010 23:22:04 +0200 Message-ID: <002401caa129$1baf8820$530e9860$@com> MIME-Version: 1.0 X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcqhJAnfMmobrqgYSQa8E4GXYnl1YAABMWzA Content-Language: tr X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] RE: Qemu-devel Digest, Vol 82, Issue 324 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Hello, I want to develop an linux os. Does anyone has a tutorial to build an operting system? Or if some one has the soruce code of linux that comes with qemu it is also enought for me.. Regards -----Original Message----- From: qemu-devel-bounces+machka=gmail.com@nongnu.org [mailto:qemu-devel-bounces+machka=gmail.com@nongnu.org] On Behalf Of qemu-devel-request@nongnu.org Sent: Friday, January 29, 2010 10:44 PM To: qemu-devel@nongnu.org Subject: Qemu-devel Digest, Vol 82, Issue 324 Send Qemu-devel mailing list submissions to qemu-devel@nongnu.org To subscribe or unsubscribe via the World Wide Web, visit http://lists.nongnu.org/mailman/listinfo/qemu-devel or, via email, send a message with subject or body 'help' to qemu-devel-request@nongnu.org You can reach the person managing the list at qemu-devel-owner@nongnu.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Qemu-devel digest..." Today's Topics: 1. [PATCH 5/5] virtio-blk: add topology support (Christoph Hellwig) 2. Re: [PATCH] Porting TCG to alpha platform (Richard Henderson) 3. [PATCH] doc: Update mingw cross compile instructions (Scott Tsai) 4. [RFC] wiki.qemu.org (Anthony Liguori) 5. Re: [RFC] wiki.qemu.org (Scott Tsai) 6. Re: [RFC] wiki.qemu.org (Andreas F?rber) 7. Re: [PATCH 1/3] virtio_blk: Factor virtio_blk_handle_request out (Anthony Liguori) ---------------------------------------------------------------------- Message: 1 Date: Fri, 29 Jan 2010 20:05:31 +0100 From: Christoph Hellwig Subject: [Qemu-devel] [PATCH 5/5] virtio-blk: add topology support To: qemu-devel@nongnu.org Cc: "Martin K. Petersen" Message-ID: <20100129190531.GD25287@lst.de> Content-Type: text/plain; charset=us-ascii Export all topology information in the block config structure, guarded by a new VIRTIO_BLK_F_TOPOLOGY config flag. Note that there is no savevm support for the new information yet, as it would be a pain without the table driven savevm format. Juan has promised to send out a new version of the table driven vmstate patches for virto next week. Signed-off-by: Christoph Hellwig -Note: Currently, Wine does not seem able to launch -QEMU for Win32. +Wine can be used to launch the resulting qemu.exe compiled for Win32. @node Mac OS X @section Mac OS X Index: qemu/hw/virtio-blk.c =================================================================== --- qemu.orig/hw/virtio-blk.c 2010-01-29 19:42:11.853022001 +0100 +++ qemu/hw/virtio-blk.c 2010-01-29 19:45:14.735253918 +0100 @@ -380,6 +380,10 @@ static void virtio_blk_update_config(Vir blkcfg.heads = heads; blkcfg.sectors = secs; blkcfg.size_max = 0; + blkcfg.physical_block_exp = bdrv_get_physical_block_exp(s->bs); + blkcfg.alignment_offset = 0; + blkcfg.min_io_size = bdrv_get_min_io_size(s->bs); + blkcfg.opt_io_size = bdrv_get_opt_io_size(s->bs); memcpy(config, &blkcfg, sizeof(struct virtio_blk_config)); } @@ -389,6 +393,7 @@ static uint32_t virtio_blk_get_features( features |= (1 << VIRTIO_BLK_F_SEG_MAX); features |= (1 << VIRTIO_BLK_F_GEOMETRY); + features |= (1 << VIRTIO_BLK_F_TOPOLOGY); if (bdrv_enable_write_cache(s->bs)) features |= (1 << VIRTIO_BLK_F_WCACHE); Index: qemu/hw/virtio-blk.h =================================================================== --- qemu.orig/hw/virtio-blk.h 2010-01-29 19:45:17.996022961 +0100 +++ qemu/hw/virtio-blk.h 2010-01-29 19:45:39.253318328 +0100 @@ -32,6 +32,7 @@ #define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ /* #define VIRTIO_BLK_F_IDENTIFY 8 ATA IDENTIFY supported, DEPRECATED */ #define VIRTIO_BLK_F_WCACHE 9 /* write cache enabled */ +#define VIRTIO_BLK_F_TOPOLOGY 10 /* Topology information is available */ struct virtio_blk_config { @@ -42,6 +43,10 @@ struct virtio_blk_config uint8_t heads; uint8_t sectors; uint32_t _blk_size; /* structure pad, currently unused */ + uint8_t physical_block_exp; + uint8_t alignment_offset; + uint16_t min_io_size; + uint32_t opt_io_size; } __attribute__((packed)); /* These two define direction. */ ------------------------------ Message: 2 Date: Fri, 29 Jan 2010 11:19:20 -0800 From: Richard Henderson Subject: Re: [Qemu-devel] [PATCH] Porting TCG to alpha platform To: identifier scorpio Cc: qemu-devel@nongnu.org Message-ID: <4B6334B8.9040002@twiddle.net> Content-Type: text/plain; charset="utf-8" > + } else if (cond == TCG_COND_EQ || cond == TCG_COND_NE) { > + tcg_out_mem_long(s, INSN_LDA, TMP_REG1, arg1, -arg2); > + opc = (cond == TCG_COND_EQ ? INSN_BEQ : INSN_BNE); Bug here. What was intended was to add "arg1 = TMP_REG1". But since the constraints use "I" for uint8_t input constants, we might as well remove this hunk entirely. Also, let's future-proof this routine against changes to the layout of the TCGCond enumeration. r~ -------------- next part -------------- commit 9d787576342c193f13e2531953fc81442458de7e Author: Richard Henderson Date: Fri Jan 29 11:14:20 2010 -0800 tcg-alpha: Fix EQ/NE with a constant. There was start of code to handle EQ and NE with arbitrary constants, but it wasn't completed. Remove the half-done code and add a comment for future enhancements. Also, don't rely on the current layout of TCGCond; instead encode the need for inversion of the compare insn result by means of a low bit set in the cmp_opc table. Reduce the element size of cmp_opc. diff --git a/tcg/alpha/tcg-target.c b/tcg/alpha/tcg-target.c index 5b7dd25..18ab2c8 100644 --- a/tcg/alpha/tcg-target.c +++ b/tcg/alpha/tcg-target.c @@ -540,9 +540,11 @@ static void tcg_out_br(TCGContext *s, int opc, int ra, int label_index) tcg_out_fmt_br(s, opc, ra, value); } -static void tcg_out_brcond(TCGContext *s, int cond, TCGArg arg1, +static void tcg_out_brcond(TCGContext *s, TCGCond cond, TCGArg arg1, TCGArg arg2, int const_arg2, int label_index) { + /* Note that unsigned comparisons are not present here, which means + that their entries will contain zeros. */ static const int br_opc[10] = { [TCG_COND_EQ] = INSN_BEQ, [TCG_COND_NE] = INSN_BNE, @@ -552,38 +554,56 @@ static void tcg_out_brcond(TCGContext *s, int cond, TCGArg arg1, [TCG_COND_GT] = INSN_BGT }; - static const uint64_t cmp_opc[10] = { + /* The low bit of these entries indicates that the result of + the comparison must be inverted. This bit should not be + output with the rest of the instruction. */ + static const int cmp_opc[10] = { [TCG_COND_EQ] = INSN_CMPEQ, - [TCG_COND_NE] = INSN_CMPEQ, + [TCG_COND_NE] = INSN_CMPEQ | 1, [TCG_COND_LT] = INSN_CMPLT, - [TCG_COND_GE] = INSN_CMPLT, + [TCG_COND_GE] = INSN_CMPLT | 1, [TCG_COND_LE] = INSN_CMPLE, - [TCG_COND_GT] = INSN_CMPLE, + [TCG_COND_GT] = INSN_CMPLE | 1, [TCG_COND_LTU] = INSN_CMPULT, - [TCG_COND_GEU] = INSN_CMPULT, + [TCG_COND_GEU] = INSN_CMPULT | 1, [TCG_COND_LEU] = INSN_CMPULE, - [TCG_COND_GTU] = INSN_CMPULE + [TCG_COND_GTU] = INSN_CMPULE | 1 }; int opc = 0; - if (const_arg2) { - if (arg2 == 0) { - opc = br_opc[cond]; - } else if (cond == TCG_COND_EQ || cond == TCG_COND_NE) { - tcg_out_mem_long(s, INSN_LDA, TMP_REG1, arg1, -arg2); - opc = (cond == TCG_COND_EQ ? INSN_BEQ : INSN_BNE); - } + /* Possible improvements: + (1) Notice arg1 == $31 and !const_arg2. In this case, swap the + two operands and swap the sense of the comparison to allow the + use of the direct branches. + + (2) Allow arbitrary constants. We can, on occasion, generate one + less instruction if we compute + TMP = ARG1 - CONST + instead of + TMP = ARG1 cmp TMP2 + where TMP2 is the constant loaded into a register by generic code. + Note that for 64-bit operands this works only for EQ and NE. For + 32-bit operands, we would need to either limit this to signed + comparisons or properly zero-extend unsigned inputs. The payoff + here isn't great though; much less than(1). */ + + /* Notice signed comparisons vs zero. These are handled by the + branch instructions directly. */ + if (const_arg2 && arg2 == 0) { + opc = br_opc[cond]; } + /* Otherwise, generate a comparison into a temporary. */ if (opc == 0) { - opc = cmp_opc[cond]; + opc = cmp_opc[cond] & ~1; if (const_arg2) { tcg_out_fmt_opi(s, opc, arg1, arg2, TMP_REG1); } else { tcg_out_fmt_opr(s, opc, arg1, arg2, TMP_REG1); } - opc = (cond & 1) ? INSN_BEQ : INSN_BNE; + + opc = (cmp_opc[cond] & 1 ? INSN_BEQ : INSN_BNE); arg1 = TMP_REG1; } ------------------------------ Message: 3 Date: Sat, 30 Jan 2010 03:28:58 +0800 From: Scott Tsai Subject: [Qemu-devel] [PATCH] doc: Update mingw cross compile instructions To: qemu-devel@nongnu.org Cc: Scott Tsai Message-ID: <1264793338-30981-1-git-send-email-scottt.tw@gmail.com> The "Cross compilation for Windows with Linux" section of qemu-doc.texi still instructs the user to use 'configure --enable-mingw32' even after the option was removed in Aug 2008: http://git.savannah.gnu.org/cgit/qemu.git/commit/?id=cd01b4a312248dd4e12c3d3 89d1a349cea4015d8 This documentation only change updates the instructions to: * Remove use of '--enable-mingw32' in the configure example * Correct the 'sdl-config' script name * Remove references to i386-mingw32msvc.tar.gz which no longer exists in recent SDL releases * Document the zlib dependency Signed-off-by: Scott Tsai --- qemu-doc.texi | 45 +++++++++++++++++++++++++++++++-------------- 1 files changed, 31 insertions(+), 14 deletions(-) diff --git a/qemu-doc.texi b/qemu-doc.texi index 2fb5c0b..4e220d0 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -2313,11 +2313,14 @@ instructions in the download section and the FAQ. @item Download the MinGW development library of SDL 1.2.x (@file{SDL-devel-1.2.x-@/mingw32.tar.gz}) from -@url{http://www.libsdl.org}. Unpack it in a temporary place, and -unpack the archive @file{i386-mingw32msvc.tar.gz} in the MinGW tool -directory. Edit the @file{sdl-config} script so that it gives the +@url{http://www.libsdl.org}. Unpack it in a temporary place and +edit the @file{sdl-config} script so that it gives the correct SDL directory when invoked. +@item Install the MinGW version of zlib and make sure +@file{zlib.h} and @file{libz.dll.a} are in +MingGW's default header and linker search paths. + @item Extract the current version of QEMU. @item Start the MSYS shell (file @file{msys.bat}). @@ -2340,29 +2343,43 @@ correct SDL directory when invoked. Install the MinGW cross compilation tools available at @url{http://www.mingw.org/}. -@item -Install the Win32 version of SDL (@url{http://www.libsdl.org}) by -unpacking @file{i386-mingw32msvc.tar.gz}. Set up the PATH environment -variable so that @file{i386-mingw32msvc-sdl-config} can be launched by +@item Download +the MinGW development library of SDL 1.2.x +(@file{SDL-devel-1.2.x-@/mingw32.tar.gz}) from +@url{http://www.libsdl.org}. Unpack it in a temporary place and +edit the @file{sdl-config} script so that it gives the +correct SDL directory when invoked. Set up the @code{PATH} environment +variable so that @file{sdl-config} can be launched by the QEMU configuration script. +@item Install the MinGW version of zlib and make sure +@file{zlib.h} and @file{libz.dll.a} are in +MingGW's default header and linker search paths. + @item Configure QEMU for Windows cross compilation: @example -./configure --enable-mingw32 +PATH=/usr/i686-pc-mingw32/sys-root/mingw/bin:$PATH ./configure --cross-prefix='i686-pc-mingw32-' +@end example +The example assumes @file{sdl-config} is installed under @file{/usr/i686-pc-mingw32/sys-root/mingw/bin} and +MinGW cross compilation tools have names like @file{i686-pc-mingw32-gcc} and @file{i686-pc-mingw32-strip}. +We set the @code{PATH} environment variable to ensure the MingW version of @file{sdl-config} is used and +use --cross-prefix to specify the name of the cross compiler. +You can also use --prefix to set the Win32 install path which defaults to @file{c:/Program Files/Qemu}. + +Under Fedora Linux, you can run: +@example +yum -y install mingw32-gcc mingw32-SDL mingw32-zlib @end example -If necessary, you can change the cross-prefix according to the prefix -chosen for the MinGW tools with --cross-prefix. You can also use ---prefix to set the Win32 install path. +to get a suitable cross compilation environment. @item You can install QEMU in the installation directory by typing -@file{make install}. Don't forget to copy @file{SDL.dll} in the +@code{make install}. Don't forget to copy @file{SDL.dll} and @file{zlib1.dll} into the installation directory. @end itemize