[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH][SEABIOS] Move qemu config port access functions

From: Kevin O'Connor
Subject: [Qemu-devel] Re: [PATCH][SEABIOS] Move qemu config port access functions into separate file.
Date: Thu, 17 Sep 2009 21:24:11 -0400
User-agent: Mutt/1.5.19 (2009-01-05)

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:
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)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]