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....@nongnu.org [mailto:qemu-devel-bounces+machka=gmail....@nongnu.org] On Behalf Of qemu-devel-requ...@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-requ...@nongnu.org You can reach the person managing the list at qemu-devel-ow...@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 <h...@lst.de> Subject: [Qemu-devel] [PATCH 5/5] virtio-blk: add topology support To: qemu-devel@nongnu.org Cc: "Martin K. Petersen" <martin.peter...@oracle.com> Message-ID: <20100129190531.gd25...@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 <h...@lst.de> 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 <r...@twiddle.net> Subject: Re: [Qemu-devel] [PATCH] Porting TCG to alpha platform To: identifier scorpio <cidentif...@yahoo.com.cn> Cc: qemu-devel@nongnu.org Message-ID: <4b6334b8.9040...@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 <r...@twiddle.net> 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 <scottt...@gmail.com> Subject: [Qemu-devel] [PATCH] doc: Update mingw cross compile instructions To: qemu-devel@nongnu.org Cc: Scott Tsai <scottt...@gmail.com> Message-ID: <1264793338-30981-1-git-send-email-scottt...@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 <scottt...@gmail.com> --- 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 -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 -- 1.6.6 ------------------------------ Message: 4 Date: Fri, 29 Jan 2010 13:44:00 -0600 From: Anthony Liguori <anth...@codemonkey.ws> Subject: [Qemu-devel] [RFC] wiki.qemu.org To: qemu-devel <qemu-devel@nongnu.org> Message-ID: <4b633a80....@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hi, I've been (slowly) working to convert qemu.org to a wiki in order to allow more community participation in the website. I've finally got a site setup and to my liking with all of the www.qemu.org content migrated. Before doing the switch, I need to figure out what to do with the current texi documentation. I think it makes sense to move qemu-doc.texi to a wiki page and remove it from the source repository. The other option would be to link to it as an external page and keep it within revision control. Does anyone have strong opinions one way or another? BTW: you can take a look at the current content at http://wiki.qemu.org. Once we decide what to do with the texi documentation, it will be reachable via http://www.qemu.org/ Regards, Anthony Liguori ------------------------------ Message: 5 Date: Sat, 30 Jan 2010 04:23:20 +0800 From: Scott Tsai <scottt...@gmail.com> Subject: Re: [Qemu-devel] [RFC] wiki.qemu.org To: Anthony Liguori <anth...@codemonkey.ws> Cc: qemu-devel <qemu-devel@nongnu.org> Message-ID: <ef2f888d1001291223o2f060df2lf4258a00a993d...@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 On Sat, Jan 30, 2010 at 3:44 AM, Anthony Liguori <anth...@codemonkey.ws> wrote: > Hi, > > I've been (slowly) working to convert qemu.org to a wiki in order to allow > more community participation in the website. B I've finally got a site setup > and to my liking with all of the www.qemu.org content migrated. > > Before doing the switch, I need to figure out what to do with the current > texi documentation. B I think it makes sense to move qemu-doc.texi to a wiki > page and remove it from the source repository. B The other option would be to > link to it as an external page and keep it within revision control. > > Does anyone have strong opinions one way or another? To keep the code and documentation in sync, I suggest keeping the portion generated from qemu-img-cmds.hx, qemu-monitor.hx and qemu-options.hx in texinfo format under revision control. This encourages updating the documentation in the same patch that adds new options and monitor commands. The "QEMU System emulator for non PC targets" section in qemu-doc.texi seems rather qemu version dependent as well? If true, moving this information to a wiki risks the documentation not matching the qemu version installed on users' machines. ------------------------------ Message: 6 Date: Fri, 29 Jan 2010 21:29:11 +0100 From: Andreas F?rber <andreas.faer...@web.de> Subject: Re: [Qemu-devel] [RFC] wiki.qemu.org To: Anthony Liguori <anth...@codemonkey.ws> Cc: qemu-devel <qemu-devel@nongnu.org> Message-ID: <959734e2-77cd-472d-8557-eb8ae88e8...@web.de> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Hi, Am 29.01.2010 um 20:44 schrieb Anthony Liguori: > I need to figure out what to do with the current texi > documentation. I think it makes sense to move qemu-doc.texi to a > wiki page and remove it from the source repository. The other > option would be to link to it as an external page and keep it within > revision control. The latter allows to have a stable version on the website and a development version inside the repository. Otherwise we would either document unavailable options or, if we don't, probably forget adding Wiki documentation after a release. Also, would you want to ship a snapshot of the Wiki page with the source tarballs? The Wiki looks more pretty though. :) Regards, Andreas ------------------------------ Message: 7 Date: Fri, 29 Jan 2010 14:43:20 -0600 From: Anthony Liguori <anth...@codemonkey.ws> Subject: Re: [Qemu-devel] [PATCH 1/3] virtio_blk: Factor virtio_blk_handle_request out To: Kevin Wolf <kw...@redhat.com> Cc: qemu-devel@nongnu.org, h...@lst.de Message-ID: <4b634868.9070...@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1; format=flowed On 01/27/2010 06:12 AM, Kevin Wolf wrote: > We need a function that handles a single request. Create one by splitting out > code from virtio_blk_handle_output. > > Signed-off-by: Kevin Wolf<kw...@redhat.com> > Applied all. Thanks. Regards, Anthony Liguori > --- > hw/virtio-blk.c | 78 ++++++++++++++++++++++++++++++++---------------------- > 1 files changed, 46 insertions(+), 32 deletions(-) > > diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c > index 865352a..82f96e5 100644 > --- a/hw/virtio-blk.c > +++ b/hw/virtio-blk.c > @@ -317,46 +317,60 @@ static void virtio_blk_handle_read(VirtIOBlockReq *req) > } > } > > +typedef struct MultiReqBuffer { > + BlockRequest blkreq[32]; > + int num_writes; > + BlockDriverState *old_bs; > +} MultiReqBuffer; > + > +static void virtio_blk_handle_request(VirtIOBlockReq *req, > + MultiReqBuffer *mrb) > +{ > + if (req->elem.out_num< 1 || req->elem.in_num< 1) { > + fprintf(stderr, "virtio-blk missing headers\n"); > + exit(1); > + } > + > + if (req->elem.out_sg[0].iov_len< sizeof(*req->out) || > + req->elem.in_sg[req->elem.in_num - 1].iov_len< sizeof(*req->in)) { > + fprintf(stderr, "virtio-blk header not in correct element\n"); > + exit(1); > + } > + > + req->out = (void *)req->elem.out_sg[0].iov_base; > + req->in = (void *)req->elem.in_sg[req->elem.in_num - 1].iov_base; > + > + if (req->out->type& VIRTIO_BLK_T_FLUSH) { > + virtio_blk_handle_flush(req); > + } else if (req->out->type& VIRTIO_BLK_T_SCSI_CMD) { > + virtio_blk_handle_scsi(req); > + } else if (req->out->type& VIRTIO_BLK_T_OUT) { > + qemu_iovec_init_external(&req->qiov,&req->elem.out_sg[1], > + req->elem.out_num - 1); > + virtio_blk_handle_write(mrb->blkreq,&mrb->num_writes, > + req,&mrb->old_bs); > + } else { > + qemu_iovec_init_external(&req->qiov,&req->elem.in_sg[0], > + req->elem.in_num - 1); > + virtio_blk_handle_read(req); > + } > +} > + > static void virtio_blk_handle_output(VirtIODevice *vdev, VirtQueue *vq) > { > VirtIOBlock *s = to_virtio_blk(vdev); > VirtIOBlockReq *req; > - BlockRequest blkreq[32]; > - int num_writes = 0; > - BlockDriverState *old_bs = NULL; > + MultiReqBuffer mrb = { > + .num_writes = 0, > + .old_bs = NULL, > + }; > > while ((req = virtio_blk_get_request(s))) { > - if (req->elem.out_num< 1 || req->elem.in_num< 1) { > - fprintf(stderr, "virtio-blk missing headers\n"); > - exit(1); > - } > - > - if (req->elem.out_sg[0].iov_len< sizeof(*req->out) || > - req->elem.in_sg[req->elem.in_num - 1].iov_len< sizeof(*req->in)) { > - fprintf(stderr, "virtio-blk header not in correct element\n"); > - exit(1); > - } > - > - req->out = (void *)req->elem.out_sg[0].iov_base; > - req->in = (void *)req->elem.in_sg[req->elem.in_num - 1].iov_base; > - > - if (req->out->type& VIRTIO_BLK_T_FLUSH) { > - virtio_blk_handle_flush(req); > - } else if (req->out->type& VIRTIO_BLK_T_SCSI_CMD) { > - virtio_blk_handle_scsi(req); > - } else if (req->out->type& VIRTIO_BLK_T_OUT) { > - qemu_iovec_init_external(&req->qiov,&req->elem.out_sg[1], > - req->elem.out_num - 1); > - virtio_blk_handle_write(blkreq,&num_writes, req,&old_bs); > - } else { > - qemu_iovec_init_external(&req->qiov,&req->elem.in_sg[0], > - req->elem.in_num - 1); > - virtio_blk_handle_read(req); > - } > + virtio_blk_handle_request(req,&mrb); > } > > - if (num_writes> 0) { > - do_multiwrite(old_bs, blkreq, num_writes); > + if (mrb.num_writes> 0) { > + do_multiwrite(mrb.old_bs, mrb.blkreq, mrb.num_writes); > } > > /* > ------------------------------ _______________________________________________ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel End of Qemu-devel Digest, Vol 82, Issue 324 ******************************************* __________ Information from ESET NOD32 Antivirus, version of virus signature database 4818 (20100129) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4818 (20100129) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com