There are users who would like to see the UUID at startup, and it probably won't bother others.
Related RHBZ: 876250.
Signed-off-by: Laszlo Ersek lersek@redhat.com --- src/util.h | 1 + src/bootsplash.c | 15 ++++++++++++++- src/output.c | 15 +++++++++++++++ 3 files changed, 30 insertions(+), 1 deletions(-)
diff --git a/src/util.h b/src/util.h index 7723bb1..aafa9b0 100644 --- a/src/util.h +++ b/src/util.h @@ -227,6 +227,7 @@ void __set_code_invalid(struct bregs *regs, u32 linecode, const char *fname); void __set_code_unimplemented(struct bregs *regs, u32 linecode , const char *fname); void hexdump(const void *d, int len); +void format_uuid(char buf[37], const u8 uuid[16]);
#define dprintf(lvl, fmt, args...) do { \ if (CONFIG_DEBUG_LEVEL && (lvl) <= CONFIG_DEBUG_LEVEL) \ diff --git a/src/bootsplash.c b/src/bootsplash.c index 78023a5..622d86e 100644 --- a/src/bootsplash.c +++ b/src/bootsplash.c @@ -12,6 +12,7 @@ #include "jpeg.h" // splash #include "vbe.h" // struct vbe_info #include "bmp.h" // bmp_alloc +#include "paravirt.h" // qemu_cfg_get_uuid
/**************************************************************** @@ -33,6 +34,18 @@ call16_int10(struct bregs *br) * VGA text / graphics console ****************************************************************/
+static void +print_hello(void) +{ + u8 uuid[16] = { 0 }; + char uuid_str[37]; + + qemu_cfg_get_uuid(uuid); + format_uuid(uuid_str, uuid); + + printf("SeaBIOS (version %s)\nMachine UUID %s\n\n", VERSION, uuid_str); +} + void enable_vga_console(void) { @@ -45,7 +58,7 @@ enable_vga_console(void) call16_int10(&br);
// Write to screen. - printf("SeaBIOS (version %s)\n\n", VERSION); + print_hello(); }
static int diff --git a/src/output.c b/src/output.c index 83de7f4..f4cdbc0 100644 --- a/src/output.c +++ b/src/output.c @@ -474,6 +474,21 @@ hexdump(const void *d, int len) debug_serial_flush(); }
+void format_uuid(char buf[37], const u8 uuid[16]) +{ + snprintf(buf, 37 + , "%02x%02x%02x%02x" + "-%02x%02x" + "-%02x%02x" + "-%02x%02x" + "-%02x%02x%02x%02x%02x%02x" + , uuid[ 0], uuid[ 1], uuid[ 2], uuid[ 3] + , uuid[ 4], uuid[ 5] + , uuid[ 6], uuid[ 7] + , uuid[ 8], uuid[ 9] + , uuid[10], uuid[11], uuid[12], uuid[13], uuid[14], uuid[15]); +} + static void dump_regs(struct bregs *regs) {
On Mon, Dec 10, 2012 at 06:11:08PM +0100, Laszlo Ersek wrote:
There are users who would like to see the UUID at startup, and it probably won't bother others.
The patch isn't going to work for non-qemu users (eg, coreboot).
-Kevin
On 12/11/12 05:54, Kevin O'Connor wrote:
On Mon, Dec 10, 2012 at 06:11:08PM +0100, Laszlo Ersek wrote:
There are users who would like to see the UUID at startup, and it probably won't bother others.
The patch isn't going to work for non-qemu users (eg, coreboot).
Also even with qemu the uuid might not be set (just start qemu without -uuid $something), that case needs to be handled too. Easiest is probably to just not print it when not preset.
cheers, Gerd
On 12/11/12 11:10, Gerd Hoffmann wrote:
On 12/11/12 05:54, Kevin O'Connor wrote:
On Mon, Dec 10, 2012 at 06:11:08PM +0100, Laszlo Ersek wrote:
There are users who would like to see the UUID at startup, and it probably won't bother others.
The patch isn't going to work for non-qemu users (eg, coreboot).
Also even with qemu the uuid might not be set (just start qemu without -uuid $something), that case needs to be handled too. Easiest is probably to just not print it when not preset.
How can I distinguish "unset" from "set to all zeros"?
Thanks! Laszlo
Also even with qemu the uuid might not be set (just start qemu without -uuid $something), that case needs to be handled too. Easiest is probably to just not print it when not preset.
How can I distinguish "unset" from "set to all zeros"?
"set to all zeros" equals "unset", no? I doubt all zeros is a valid uuid in the first place ...
cheers, Gerd
On 12/11/12 15:52, Gerd Hoffmann wrote:
Also even with qemu the uuid might not be set (just start qemu without -uuid $something), that case needs to be handled too. Easiest is probably to just not print it when not preset.
How can I distinguish "unset" from "set to all zeros"?
"set to all zeros" equals "unset", no? I doubt all zeros is a valid uuid in the first place ...
Correct. I started reading the SMBIOS spec, and "Table 3 – Required Structures and Data" says
[...] System Information (Type 1) [...] UUID field identifies the system’s non-zero UUID value. [...] [...]
Thanks! Laszlo
"bootsplash.c" and "smbios.c" are both SRC32FLAT, thus I figure I can call across. "output.c" is SRC32SEG, but(?) "bootsplash.c" already calls printf().
v1->v2: - Retrieve the UUID from SMBIOS table type 1, wherever it has been installed from. - Don't print an all-zeros (= unset) UUID.
Laszlo Ersek (3): add smbios_locate_uuid() helper function add format_uuid() utility function enable_vga_console(): print machine UUID under seabios version message
src/smbios.h | 1 + src/util.h | 1 + src/bootsplash.c | 21 ++++++++++++++++++++- src/output.c | 16 ++++++++++++++++ src/smbios.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 85 insertions(+), 1 deletions(-)
On Tue, Dec 11, 2012 at 05:16:37PM +0100, Laszlo Ersek wrote:
"bootsplash.c" and "smbios.c" are both SRC32FLAT, thus I figure I can call across. "output.c" is SRC32SEG, but(?) "bootsplash.c" already calls printf().
output.c is compiled into all three modes (16bit, 32bit flat, and 32bit segmented) - see the SRCBOTH define in the Makefile. This is done so that all three modes can access the dprintf code.
In any case, it's fine to call both snprintf and printf in bootsplash.c/smbios.c.
-Kevin
Signed-off-by: Laszlo Ersek lersek@redhat.com --- src/smbios.h | 1 + src/smbios.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 0 deletions(-)
diff --git a/src/smbios.h b/src/smbios.h index 9d54e80..c1fe7f6 100644 --- a/src/smbios.h +++ b/src/smbios.h @@ -165,4 +165,5 @@ struct smbios_type_127 { struct smbios_structure_header header; } PACKED;
+const u8 *smbios_locate_uuid(const struct smbios_entry_point *ep); #endif // smbios.h diff --git a/src/smbios.c b/src/smbios.c index fc84aad..5874bec 100644 --- a/src/smbios.c +++ b/src/smbios.c @@ -521,3 +521,50 @@ smbios_init(void) smbios_entry_point_init(max_struct_size, p - start, start, nr_structs); free(start); } + +const u8 * +smbios_locate_uuid(const struct smbios_entry_point *ep) +{ + u32 addr, end; + + if (ep == NULL) + return NULL; + + addr = ep->structure_table_address; + end = addr + ep->structure_table_length; + + /* the following takes care of any initial wraparound too */ + while (addr < end) { + const struct smbios_structure_header *hdr; + + /* partial structure header */ + if (end - addr < sizeof(struct smbios_structure_header)) + return NULL; + + hdr = (struct smbios_structure_header *)addr; + + /* partial structure */ + if (end - addr < hdr->length) + return NULL; + + /* any Type 1 structure version will do that has the UUID */ + if (hdr->type == 1 && + hdr->length >= offsetof(struct smbios_type_1, uuid) + 16) + return (u8 *)(addr + offsetof(struct smbios_type_1, uuid)); + + /* done with formatted area, skip string-set */ + addr += hdr->length; + + while (end - addr >= 2 && + (*(u8 *)addr != '\0' || + *(u8 *)(addr+1) != '\0')) + ++addr; + + /* structure terminator not found */ + if (end - addr < 2) + return NULL; + + addr += 2; + } + return NULL; +}
Signed-off-by: Laszlo Ersek lersek@redhat.com --- src/util.h | 1 + src/output.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/src/util.h b/src/util.h index 7723bb1..aafa9b0 100644 --- a/src/util.h +++ b/src/util.h @@ -227,6 +227,7 @@ void __set_code_invalid(struct bregs *regs, u32 linecode, const char *fname); void __set_code_unimplemented(struct bregs *regs, u32 linecode , const char *fname); void hexdump(const void *d, int len); +void format_uuid(char buf[37], const u8 uuid[16]);
#define dprintf(lvl, fmt, args...) do { \ if (CONFIG_DEBUG_LEVEL && (lvl) <= CONFIG_DEBUG_LEVEL) \ diff --git a/src/output.c b/src/output.c index 83de7f4..b6263b6 100644 --- a/src/output.c +++ b/src/output.c @@ -474,6 +474,22 @@ hexdump(const void *d, int len) debug_serial_flush(); }
+void +format_uuid(char buf[37], const u8 uuid[16]) +{ + snprintf(buf, 37 + , "%02x%02x%02x%02x" + "-%02x%02x" + "-%02x%02x" + "-%02x%02x" + "-%02x%02x%02x%02x%02x%02x" + , uuid[ 0], uuid[ 1], uuid[ 2], uuid[ 3] + , uuid[ 4], uuid[ 5] + , uuid[ 6], uuid[ 7] + , uuid[ 8], uuid[ 9] + , uuid[10], uuid[11], uuid[12], uuid[13], uuid[14], uuid[15]); +} + static void dump_regs(struct bregs *regs) {
There are users who would like to see the UUID at startup, and it probably won't bother others.
Related RHBZ: 876250.
Signed-off-by: Laszlo Ersek lersek@redhat.com --- src/bootsplash.c | 21 ++++++++++++++++++++- 1 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/src/bootsplash.c b/src/bootsplash.c index 78023a5..a0fea61 100644 --- a/src/bootsplash.c +++ b/src/bootsplash.c @@ -12,6 +12,7 @@ #include "jpeg.h" // splash #include "vbe.h" // struct vbe_info #include "bmp.h" // bmp_alloc +#include "smbios.h" // smbios_locate_uuid
/**************************************************************** @@ -33,6 +34,24 @@ call16_int10(struct bregs *br) * VGA text / graphics console ****************************************************************/
+static void +print_hello(void) +{ + const u8 *uuid; + u8 empty_uuid[16] = { 0 }; + + printf("SeaBIOS (version %s)\n", VERSION); + + uuid = smbios_locate_uuid(SMBiosAddr); + if (uuid != NULL && memcmp(uuid, empty_uuid, sizeof empty_uuid) != 0) { + char uuid_str[37]; + + format_uuid(uuid_str, uuid); + printf("Machine UUID %s\n", uuid_str); + } + printf("\n"); +} + void enable_vga_console(void) { @@ -45,7 +64,7 @@ enable_vga_console(void) call16_int10(&br);
// Write to screen. - printf("SeaBIOS (version %s)\n\n", VERSION); + print_hello(); }
static int
On Tue, Dec 11, 2012 at 05:16:40PM +0100, Laszlo Ersek wrote:
There are users who would like to see the UUID at startup, and it probably won't bother others.
Related RHBZ: 876250.
Out of curiosity, why do they want to see the UUID?
-Kevin
On 12/12/12 01:36, Kevin O'Connor wrote:
On Tue, Dec 11, 2012 at 05:16:40PM +0100, Laszlo Ersek wrote:
There are users who would like to see the UUID at startup, and it probably won't bother others.
Related RHBZ: 876250.
Out of curiosity, why do they want to see the UUID?
I've received permission from our customer to respond with their words verbatim:
What are the business requirements:
Need to provide SMBIOS GUID (uuid in RHEV) to desktop engineers responsible for building Windows virtual desktops on RHEV-D, using Microsoft SCCM (PXE boot, "bare metal" install of OS). They have access to the guests via user portal and are accustomed to obtaining this information in the BIOS POST screen upon startup (as in the case of VWware VMs and physical desktop PCs). They do not have access to or familiarity with REST API or gPXE command line interface.
What are the functional requirements:
Have the BIOS of guests display the SMBIOS GUID (a.k.a. uuid) at POST, as this is expected behavior on a real PC. We want to use the same process for building PCs on VMs as we do for building them on physical hardware, taking advantage of existing infrastructure and skill sets.
Thank you for considering the series. Laszlo
On Wed, Dec 12, 2012 at 05:37:22PM +0100, Laszlo Ersek wrote:
On 12/12/12 01:36, Kevin O'Connor wrote:
On Tue, Dec 11, 2012 at 05:16:40PM +0100, Laszlo Ersek wrote:
There are users who would like to see the UUID at startup, and it probably won't bother others.
Related RHBZ: 876250.
Out of curiosity, why do they want to see the UUID?
I've received permission from our customer to respond with their words verbatim:
What are the business requirements:
Okay. One thing I'd request is to not complicate bootsplash.c or output.c with this. Instead, how about implementing the code in a function (eg, display_uuid() ) in smbios.c, have it do all the detection/formatting/printf, and call it from post.c.
-Kevin
There are users who would like to see the UUID at startup, and it probably won't bother others.
Related RHBZ: 876250.
Signed-off-by: Laszlo Ersek lersek@redhat.com --- v2->v3: - moved everything to display_uuid() in smbios.c, called from maininit()
v1->v2: - Retrieve the UUID from SMBIOS table type 1, wherever it has been installed from. - Don't print an all-zeros (= unset) UUID.
src/smbios.h | 1 + src/post.c | 3 ++ src/smbios.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 0 deletions(-)
diff --git a/src/smbios.h b/src/smbios.h index 9d54e80..5bf0392 100644 --- a/src/smbios.h +++ b/src/smbios.h @@ -165,4 +165,5 @@ struct smbios_type_127 { struct smbios_structure_header header; } PACKED;
+void display_uuid(void); #endif // smbios.h diff --git a/src/post.c b/src/post.c index 3705c3b..f3b56b8 100644 --- a/src/post.c +++ b/src/post.c @@ -261,6 +261,9 @@ maininit(void) // Run vga option rom vga_setup();
+ // SMBIOS tables and VGA console are ready, print UUID + display_uuid(); + // Do hardware initialization (if running synchronously) if (!CONFIG_THREADS || !CONFIG_THREAD_OPTIONROMS) { init_hw(); diff --git a/src/smbios.c b/src/smbios.c index fc84aad..aaa99bc 100644 --- a/src/smbios.c +++ b/src/smbios.c @@ -521,3 +521,71 @@ smbios_init(void) smbios_entry_point_init(max_struct_size, p - start, start, nr_structs); free(start); } + +void +display_uuid(void) +{ + u32 addr, end; + u8 *uuid; + u8 empty_uuid[16] = { 0 }; + + if (SMBiosAddr == NULL) + return; + + addr = SMBiosAddr->structure_table_address; + end = addr + SMBiosAddr->structure_table_length; + + /* the following takes care of any initial wraparound too */ + while (addr < end) { + const struct smbios_structure_header *hdr; + + /* partial structure header */ + if (end - addr < sizeof(struct smbios_structure_header)) + return; + + hdr = (struct smbios_structure_header *)addr; + + /* partial structure */ + if (end - addr < hdr->length) + return; + + /* any Type 1 structure version will do that has the UUID */ + if (hdr->type == 1 && + hdr->length >= offsetof(struct smbios_type_1, uuid) + 16) + break; + + /* done with formatted area, skip string-set */ + addr += hdr->length; + + while (end - addr >= 2 && + (*(u8 *)addr != '\0' || + *(u8 *)(addr+1) != '\0')) + ++addr; + + /* structure terminator not found */ + if (end - addr < 2) + return; + + addr += 2; + } + + /* parsing finished, UUID not found */ + if (addr == end) + return; + + uuid = (u8 *)(addr + offsetof(struct smbios_type_1, uuid)); + if (memcmp(uuid, empty_uuid, sizeof empty_uuid) == 0) + return; + + printf("Machine UUID" + " %02x%02x%02x%02x" + "-%02x%02x" + "-%02x%02x" + "-%02x%02x" + "-%02x%02x%02x%02x%02x%02x\n" + , uuid[ 0], uuid[ 1], uuid[ 2], uuid[ 3] + , uuid[ 4], uuid[ 5] + , uuid[ 6], uuid[ 7] + , uuid[ 8], uuid[ 9] + , uuid[10], uuid[11], uuid[12], uuid[13], uuid[14], uuid[15]); +}
On 12/14/12 12:59, Laszlo Ersek wrote:
There are users who would like to see the UUID at startup, and it probably won't bother others.
Related RHBZ: 876250.
Signed-off-by: Laszlo Ersek lersek@redhat.com
v2->v3:
- moved everything to display_uuid() in smbios.c, called from maininit()
Diff with v2:
diff --git a/src/bootsplash.c b/src/bootsplash.c index a0fea61..78023a5 100644 --- a/src/bootsplash.c +++ b/src/bootsplash.c @@ -12,7 +12,6 @@ #include "jpeg.h" // splash #include "vbe.h" // struct vbe_info #include "bmp.h" // bmp_alloc -#include "smbios.h" // smbios_locate_uuid
/**************************************************************** @@ -34,24 +33,6 @@ call16_int10(struct bregs *br) * VGA text / graphics console ****************************************************************/
-static void -print_hello(void) -{ - const u8 *uuid; - u8 empty_uuid[16] = { 0 }; - - printf("SeaBIOS (version %s)\n", VERSION); - - uuid = smbios_locate_uuid(SMBiosAddr); - if (uuid != NULL && memcmp(uuid, empty_uuid, sizeof empty_uuid) != 0) { - char uuid_str[37]; - - format_uuid(uuid_str, uuid); - printf("Machine UUID %s\n", uuid_str); - } - printf("\n"); -} - void enable_vga_console(void) { @@ -64,7 +45,7 @@ enable_vga_console(void) call16_int10(&br);
// Write to screen. - print_hello(); + printf("SeaBIOS (version %s)\n\n", VERSION); }
static int diff --git a/src/output.c b/src/output.c index b6263b6..83de7f4 100644 --- a/src/output.c +++ b/src/output.c @@ -474,22 +474,6 @@ hexdump(const void *d, int len) debug_serial_flush(); }
-void -format_uuid(char buf[37], const u8 uuid[16]) -{ - snprintf(buf, 37 - , "%02x%02x%02x%02x" - "-%02x%02x" - "-%02x%02x" - "-%02x%02x" - "-%02x%02x%02x%02x%02x%02x" - , uuid[ 0], uuid[ 1], uuid[ 2], uuid[ 3] - , uuid[ 4], uuid[ 5] - , uuid[ 6], uuid[ 7] - , uuid[ 8], uuid[ 9] - , uuid[10], uuid[11], uuid[12], uuid[13], uuid[14], uuid[15]); -} - static void dump_regs(struct bregs *regs) { diff --git a/src/post.c b/src/post.c index 3705c3b..f3b56b8 100644 --- a/src/post.c +++ b/src/post.c @@ -261,6 +261,9 @@ maininit(void) // Run vga option rom vga_setup();
+ // SMBIOS tables and VGA console are ready, print UUID + display_uuid(); + // Do hardware initialization (if running synchronously) if (!CONFIG_THREADS || !CONFIG_THREAD_OPTIONROMS) { init_hw(); diff --git a/src/smbios.c b/src/smbios.c index 5874bec..aaa99bc 100644 --- a/src/smbios.c +++ b/src/smbios.c @@ -522,16 +522,18 @@ smbios_init(void) free(start); }
-const u8 * -smbios_locate_uuid(const struct smbios_entry_point *ep) +void +display_uuid(void) { u32 addr, end; + u8 *uuid; + u8 empty_uuid[16] = { 0 };
- if (ep == NULL) - return NULL; + if (SMBiosAddr == NULL) + return;
- addr = ep->structure_table_address; - end = addr + ep->structure_table_length; + addr = SMBiosAddr->structure_table_address; + end = addr + SMBiosAddr->structure_table_length;
/* the following takes care of any initial wraparound too */ while (addr < end) { @@ -539,18 +541,18 @@ smbios_locate_uuid(const struct smbios_entry_point *ep)
/* partial structure header */ if (end - addr < sizeof(struct smbios_structure_header)) - return NULL; + return;
hdr = (struct smbios_structure_header *)addr;
/* partial structure */ if (end - addr < hdr->length) - return NULL; + return;
/* any Type 1 structure version will do that has the UUID */ if (hdr->type == 1 && hdr->length >= offsetof(struct smbios_type_1, uuid) + 16) - return (u8 *)(addr + offsetof(struct smbios_type_1, uuid)); + break;
/* done with formatted area, skip string-set */ addr += hdr->length; @@ -562,9 +564,28 @@ smbios_locate_uuid(const struct smbios_entry_point *ep)
/* structure terminator not found */ if (end - addr < 2) - return NULL; + return;
addr += 2; } - return NULL; + + /* parsing finished, UUID not found */ + if (addr == end) + return; + + uuid = (u8 *)(addr + offsetof(struct smbios_type_1, uuid)); + if (memcmp(uuid, empty_uuid, sizeof empty_uuid) == 0) + return; + + printf("Machine UUID" + " %02x%02x%02x%02x" + "-%02x%02x" + "-%02x%02x" + "-%02x%02x" + "-%02x%02x%02x%02x%02x%02x\n" + , uuid[ 0], uuid[ 1], uuid[ 2], uuid[ 3] + , uuid[ 4], uuid[ 5] + , uuid[ 6], uuid[ 7] + , uuid[ 8], uuid[ 9] + , uuid[10], uuid[11], uuid[12], uuid[13], uuid[14], uuid[15]); } diff --git a/src/smbios.h b/src/smbios.h index c1fe7f6..5bf0392 100644 --- a/src/smbios.h +++ b/src/smbios.h @@ -165,5 +165,5 @@ struct smbios_type_127 { struct smbios_structure_header header; } PACKED;
-const u8 *smbios_locate_uuid(const struct smbios_entry_point *ep); +void display_uuid(void); #endif // smbios.h diff --git a/src/util.h b/src/util.h index aafa9b0..7723bb1 100644 --- a/src/util.h +++ b/src/util.h @@ -227,7 +227,6 @@ void __set_code_invalid(struct bregs *regs, u32 linecode, const char *fname); void __set_code_unimplemented(struct bregs *regs, u32 linecode , const char *fname); void hexdump(const void *d, int len); -void format_uuid(char buf[37], const u8 uuid[16]);
#define dprintf(lvl, fmt, args...) do { \ if (CONFIG_DEBUG_LEVEL && (lvl) <= CONFIG_DEBUG_LEVEL) \
On Fri, Dec 14, 2012 at 12:59:39PM +0100, Laszlo Ersek wrote:
There are users who would like to see the UUID at startup, and it probably won't bother others.
Related RHBZ: 876250.
Signed-off-by: Laszlo Ersek lersek@redhat.com
v2->v3:
- moved everything to display_uuid() in smbios.c, called from maininit()
Thanks. I committed this change.
-Kevin
In the v2->v3 change of what would become commit 37676f83 http://www.seabios.org/pipermail/seabios/2012-December/005166.html, the defense against an initial "addr > end" condition ("wraparound") was erroneously loosened.
Signed-off-by: Laszlo Ersek lersek@redhat.com --- src/smbios.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/smbios.c b/src/smbios.c index aaa99bc..23713a2 100644 --- a/src/smbios.c +++ b/src/smbios.c @@ -569,8 +569,8 @@ display_uuid(void) addr += 2; }
- /* parsing finished, UUID not found */ - if (addr == end) + /* parsing finished or skipped entirely, UUID not found */ + if (addr >= end) return;
uuid = (u8 *)(addr + offsetof(struct smbios_type_1, uuid));
On Tue, Dec 18, 2012 at 05:11:39AM +0100, Laszlo Ersek wrote:
In the v2->v3 change of what would become commit 37676f83 http://www.seabios.org/pipermail/seabios/2012-December/005166.html, the defense against an initial "addr > end" condition ("wraparound") was erroneously loosened.
Thanks - I pushed this change.
-Kevin
On 12/11/12 05:54, Kevin O'Connor wrote:
On Mon, Dec 10, 2012 at 06:11:08PM +0100, Laszlo Ersek wrote:
There are users who would like to see the UUID at startup, and it probably won't bother others.
The patch isn't going to work for non-qemu users (eg, coreboot).
At least on qemu, I figured
afterReloc() [src/post.c] maininit() init_bios_tables() smbios_init() [src/smbios.c] qemu_cfg_smbios_load_external() -- via add_struct() macro smbios_init_type_1() -- via add_struct() macro, if qemu_cfg_smbios_load_external() fails qemu_cfg_smbios_load_field() -- linear search in QEMU_CFG_SMBIOS_ENTRIES qemu_cfg_smbios_entries() qemu_cfg_skip() / qemu_cfg_read() smbios_entry_point_init() vga_setup() [src/optionroms.c] enable_vga_console() [src/bootsplash.c] printf("SeaBIOS (version %s)\n\n", VERSION); [src/output.c]
I wanted to avoid parsing the SMBIOS System Information structure we just populated in smbios_init(). Looks like there's no way around it.
Can I base that parsing on SMBiosAddr? It seems to be set in all cases after init_bios_tables() returns. The above tree (init_bios_tables()->smbios_init()) is qemu specific, but:
(coreboot) init_bios_tables coreboot_copy_biostable scan_tables copy_table
(xen) init_bios_tables xen_copy_biostables copy_table
(common) copy_table copy_smbios /* ... */ SMBiosAddr = newpos
I'll try to rewrite the patch with SMBiosAddr.
Thanks! Laszlo