From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MoaHQ-0005Cm-L8 for qemu-devel@nongnu.org; Fri, 18 Sep 2009 06:01:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MoaHN-0005Ba-3a for qemu-devel@nongnu.org; Fri, 18 Sep 2009 06:01:28 -0400 Received: from [199.232.76.173] (port=38377 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MoaHM-0005BU-PR for qemu-devel@nongnu.org; Fri, 18 Sep 2009 06:01:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6772) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MoaHL-0000c2-W4 for qemu-devel@nongnu.org; Fri, 18 Sep 2009 06:01:24 -0400 Date: Fri, 18 Sep 2009 13:01:20 +0300 From: Gleb Natapov Message-ID: <20090918100120.GC11921@redhat.com> References: <20090914125141.GB30746@redhat.com> <20090915000824.GA16210@morn.localdomain> <20090915054339.GD30746@redhat.com> <20090916020259.GA18131@morn.localdomain> <20090917095728.GN23157@redhat.com> <20090918012411.GA23213@morn.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090918012411.GA23213@morn.localdomain> Subject: [Qemu-devel] Re: [PATCH][SEABIOS] Move qemu config port access functions into separate file. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin O'Connor Cc: qemu-devel@nongnu.org On Thu, Sep 17, 2009 at 09:24:11PM -0400, Kevin O'Connor wrote: > On Thu, Sep 17, 2009 at 12:57:28PM +0300, Gleb Natapov wrote: > > The configuration interface should be able to read streams of data > > though. Qemu uses it to pass additional ACPI tables for instance. So > > it not just simple key->value interface. get_config_u32("ShowBootMenu") > > will work for simple cases but how can we express stream semantic? May be: > > > > table_count = get_config_u16("AdditionalAcpiCount") > > select_config("AdditionalAcpiTables"); > > for (i=0; i > len = config_read(table[i], table_len[i]); > > } > > On coreboot there is the Coreboot FileSystem (CBFS). Basically, the > flash stores a series of named files, and SeaBIOS knows how to iterate > through them. So, for instance, one might find the file > "pci1013,00b8.rom" which contains an option rom for pci device > 1013:00b8, or one might find "floppyimg/FreeDOS" with an image of a > floppy to be emulated. > > So, ideally qemu would do something similar. Maybe something like: Qemu already does something different. For instance acpi tables are transfered as stream formated like this: <1 table length>
<2 table length>
...
I don't think qemu should expose file system API to a BIOS. > copy_config_file("AdditionalAcpiTables", destfileptr, destfilemaxlen). > The exact mechanism for extracting the info is flexible. To be > compatible with the CBFS interface, seabios just needs a way to "walk" > the list of files, find out how big a given file is, and be able to > copy the file to ram. > > If anyone is curious, the cbfs functions are in src/coreboot.c - the > main interface is: > > // Find the file with the given filename. > struct cbfs_file *cbfs_findfile(const char *fname) > // Find next file with the given filename prefix. > struct cbfs_file *cbfs_findprefix(const char *prefix, struct cbfs_file *last) > // Determine the uncompressed size of a datafile. > u32 cbfs_datasize(struct cbfs_file *file) > // Copy a file to memory (uncompressing if necessary) > int cbfs_copyfile(struct cbfs_file *file, void *dst, u32 maxlen) > > -Kevin -- Gleb.