qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Kevin O'Connor <kevin@koconnor.net>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH][SEABIOS] Move qemu config port access functions into separate file.
Date: Fri, 18 Sep 2009 13:01:20 +0300	[thread overview]
Message-ID: <20090918100120.GC11921@redhat.com> (raw)
In-Reply-To: <20090918012411.GA23213@morn.localdomain>

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<table_count; 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:
<table count><1 table length><table data><2 table length><table data>
...<n table length><table data>

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.

  reply	other threads:[~2009-09-18 10:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-14 12:51 [Qemu-devel] [PATCH][SEABIOS] Move qemu config port access functions into separate file Gleb Natapov
2009-09-15  0:08 ` [Qemu-devel] " Kevin O'Connor
2009-09-15  5:43   ` Gleb Natapov
2009-09-16  2:02     ` Kevin O'Connor
2009-09-17  9:57       ` Gleb Natapov
2009-09-18  1:24         ` Kevin O'Connor
2009-09-18 10:01           ` Gleb Natapov [this message]
2009-09-19 15:16             ` Kevin O'Connor
2009-09-19 17:56               ` Gleb Natapov
2009-09-30  1:09                 ` Kevin O'Connor
2009-09-30  6:35                   ` Gleb Natapov
2009-09-30 17:17                     ` Blue Swirl
2009-09-30 17:31                       ` Gleb Natapov
2009-10-02  1:08                       ` Kevin O'Connor
2009-10-01 16:35   ` Gleb Natapov
2009-10-02  0:51     ` Kevin O'Connor
2009-10-02 14:03       ` Gleb Natapov
2009-10-02 16:52         ` Kevin O'Connor
2009-10-02 18:10           ` Gleb Natapov
2009-10-02 19:31             ` Kevin O'Connor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090918100120.GC11921@redhat.com \
    --to=gleb@redhat.com \
    --cc=kevin@koconnor.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).