Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IEMPB-0004dh-6D for qemu-devel@nongnu.org; Fri, 27 Jul 2007 05:46:41 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IEMP9-0004c5-Er for qemu-devel@nongnu.org; Fri, 27 Jul 2007 05:46:40 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IEMP7-0004b3-Pu for qemu-devel@nongnu.org; Fri, 27 Jul 2007 05:46:38 -0400 Received: from mail.windriver.com ([147.11.1.11] helo=mail.wrs.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IEMP7-0002V4-9V for qemu-devel@nongnu.org; Fri, 27 Jul 2007 05:46:37 -0400 Received: from ALA-MAIL03.corp.ad.wrs.com (ala-mail03 [147.11.57.144]) by mail.wrs.com (8.13.6/8.13.6) with ESMTP id l6R9kaIx015841 for ; Fri, 27 Jul 2007 02:46:36 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: References: <001201c7cade$8118b8e0$ba00a8c0@kone> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <77D52109-7706-4932-AA0F-7437D0B22DAB@windriver.com> Content-Transfer-Encoding: 7bit From: Paul Borman Subject: Re: [Qemu-devel] Re: QEmu as a Device Software Optimization tool Date: Fri, 27 Jul 2007 05:46:29 -0400 Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org The platform I started with was ppc_prep :-) So, is Python already part of qemu? Personally, I would have a goal that the definition of a device would be simple enough that there would be no reason to have anything more complicated than a simple text file. While I would not suggest that the BSD config file syntax should be used, I do think it is instructive. It has a section for defining macros, really, the standard name/value pairs options KTR # kernel wraparound trace buffer support options "KTR_SIZE=32768" # trace buffer in bytes (def=8K) options "KTR_COMPILE='~0'" # compile in all traces options "KTR_MASK=0" # but turn none of them on Clearly there would be cleaner ways to specify this for QEmu set memory_size 0x10000000 There is also a section that specifies the various devices. Here is a snippet of a kernel for an embedded PPC board I used to work on: # main (on-board io) bus obio0 at root pci0 at obio0 # COM ports # Flags are 0xF00000 for fifo flags F; see com(4). # Default is 0; 1, 2, 3, 4 set receive fifo trigger to 1, 4, 8, 14; # 9 ignores the FIFO on 16550/16550AF. com0 at obio? addr "0xff600300" irq 3 com1 at obio? addr "0xff600400" irq 4 # Crystal Semiconductor Ethernet ce0 at obio? addr "0x7fe00c00" irq 24 # Disk On Chip 2000 driver dc0 at obio? iomem "0x800d0000" iosiz 0x2000 This particular syntax specifies several things: 1) The devices in a generic way 2) How devices are connected 3) The order to search for the devices Again, QEmu would need something slightly different, but at least this demonstrates how a similar problem has been previous solved. There are also pseudo devices pseudo-device loop pseudo-device pty pseudo-device sl 1 QEmu might be able to treat pseudo and "physical" devices the same, or maybe keeping them independent would be good. Using python, or some general purpose scripting language, to create .c files for inclusion in the compilation seems like it may have some merit, though I see these as different issues. I wrote a PPC virtual machine to run on PPC hosts (i.e., more like vmware). When I found that I wanted a little more than a simple ascii file, I settled on pretty much the standard sh syntax. I have written (and am willing to contribute) an embedded version of sh which only calls builtin functions. I used it both for my monitor as well as my config syntax (config files were essentially read by the monitor) -Paul >> Personally though I don't see much benefit to simple syntax config >> files over C files, that are being used now. > > Really? Take a look at ppc_prep_init()... > > I would love to see machine definition done in python. > > -- > Hollis Blanchard > IBM Linux Technology Center > > > >