diff options
author | H. Peter Anvin <hpa@zytor.com> | 2010-02-07 11:56:19 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-02-07 11:56:19 -0800 |
commit | f4cc3c07ffbdc3e2a429df556beb480a78988cfe (patch) | |
tree | 6a68d82f4d341baf06a64a42c3b4a76df87398be /com32/sysdump | |
parent | 33bf122c1bc1ee98a98a5459847bf3f6acc1e33d (diff) | |
download | syslinux-f4cc3c07ffbdc3e2a429df556beb480a78988cfe.tar.gz |
sysdump: handle the case of more than one DMI table
On the offchance a system has more than one valid DMI table, record
them all. Also record the address of the signature structure and of
the table itself.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32/sysdump')
-rw-r--r-- | com32/sysdump/dmi.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/com32/sysdump/dmi.c b/com32/sysdump/dmi.c index 9e57b4b7..64f95a9a 100644 --- a/com32/sysdump/dmi.c +++ b/com32/sysdump/dmi.c @@ -64,8 +64,11 @@ static void dump_smbios(struct backend *be, size_t dptr) { const struct smbios_header *smb = (void *)dptr; struct smbios_header smx = *smb; + char filename[32]; - cpio_hdr(be, MODE_FILE, smb->dmi.tbllen + 32, "dmidata"); + snprintf(filename, sizeof filename, "dmi/%05x.%08x", + dptr, smb->dmi.tbladdr); + cpio_hdr(be, MODE_FILE, smb->dmi.tbllen + 32, filename); /* * Adjust the address of the smbios table to be 32, to @@ -86,8 +89,11 @@ static void dump_old_dmi(struct backend *be, size_t dptr) struct dmi_header dmi; char pad[16]; } fake; + char filename[32]; - cpio_hdr(be, MODE_FILE, dmi->tbllen + 32, "dmidata"); + snprintf(filename, sizeof filename, "dmi/%05x.%08x", + dptr, dmi->tbladdr); + cpio_hdr(be, MODE_FILE, dmi->tbllen + 32, filename); /* * Adjust the address of the smbios table to be 32, to @@ -106,14 +112,15 @@ void dump_dmi(struct backend *be) { size_t dptr; + cpio_mkdir(be, "dmi"); + /* Search for _SM_ or _DMI_ structure */ for (dptr = 0xf0000 ; dptr < 0x100000 ; dptr += 16) { if (is_smbios(dptr)) { dump_smbios(be, dptr); - break; + dptr += 16; /* Skip the subsequent DMI header */ } else if (is_old_dmi(dptr)) { dump_old_dmi(be, dptr); - break; } } } |