diff options
author | Gordon Willem Klok <gwk@cvs.openbsd.org> | 2007-08-06 16:12:26 +0000 |
---|---|---|
committer | Gordon Willem Klok <gwk@cvs.openbsd.org> | 2007-08-06 16:12:26 +0000 |
commit | fd9da30339ae16bb1f626e662baec9f419539c17 (patch) | |
tree | fbaa8a010f04f756f17b5b62ae752e1dd9c81e4e /sys | |
parent | e8cd5215ebe0d932bf680e94eeb7955ac2721eda (diff) |
Spew smbios bios table vendor/version/release date into the dmesg. Diff
from theo.
ok deraadt
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/amd64/amd64/bios.c | 21 | ||||
-rw-r--r-- | sys/arch/i386/i386/bios.c | 21 |
2 files changed, 39 insertions, 3 deletions
diff --git a/sys/arch/amd64/amd64/bios.c b/sys/arch/amd64/amd64/bios.c index f6177fd3b99..cbf4319e5e8 100644 --- a/sys/arch/amd64/amd64/bios.c +++ b/sys/arch/amd64/amd64/bios.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bios.c,v 1.11 2007/03/29 15:00:15 gwk Exp $ */ +/* $OpenBSD: bios.c,v 1.12 2007/08/06 16:12:25 gwk Exp $ */ /* * Copyright (c) 2006 Gordon Willem Klok <gklok@cogeco.ca> * @@ -77,6 +77,9 @@ void bios_attach(struct device *parent, struct device *self, void *aux) { struct bios_softc *sc = (struct bios_softc *)self; + struct smbios_struct_bios *sb; + struct smbtable bios; + char scratch[64]; vaddr_t va; paddr_t pa, end; u_int8_t *p; @@ -121,6 +124,22 @@ bios_attach(struct device *parent, struct device *self, void *aux) printf(": SMBIOS rev. %d.%d @ 0x%lx (%d entries)", hdr->majrev, hdr->minrev, hdr->addr, hdr->count); + + bios.cookie = 0; + if (smbios_find_table(SMBIOS_TYPE_BIOS, &bios)) { + sb = bios.tblhdr; + printf("\n%s:", sc->sc_dev.dv_xname); + if ((smbios_get_string(&bios, sb->vendor, + scratch, sizeof(scratch))) != NULL) + printf(" vendor %s", scratch); + if ((smbios_get_string(&bios, sb->version, + scratch, sizeof(scratch))) != NULL) + printf(" version \"%s\"", scratch); + if ((smbios_get_string(&bios, sb->release, + scratch, sizeof(scratch))) != NULL) + printf(" date %s", scratch); + } + smbios_info(sc->sc_dev.dv_xname); break; } diff --git a/sys/arch/i386/i386/bios.c b/sys/arch/i386/i386/bios.c index 23ef73d4698..bb5d7f8bfd0 100644 --- a/sys/arch/i386/i386/bios.c +++ b/sys/arch/i386/i386/bios.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bios.c,v 1.69 2007/03/29 15:00:15 gwk Exp $ */ +/* $OpenBSD: bios.c,v 1.70 2007/08/06 16:12:25 gwk Exp $ */ /* * Copyright (c) 1997-2001 Michael Shalayeff @@ -141,8 +141,10 @@ biosattach(struct device *parent, struct device *self, void *aux) #if (NPCI > 0 && NPCIBIOS > 0) || NAPM > 0 struct bios_attach_args *bia = aux; #endif + struct smbios_struct_bios *sb; + struct smbtable bios; volatile u_int8_t *va; - char *str; + char scratch[64], *str; int flags; /* remember flags */ @@ -262,6 +264,21 @@ biosattach(struct device *parent, struct device *self, void *aux) printf(", SMBIOS rev. %d.%d @ 0x%lx (%d entries)", sh->majrev, sh->minrev, sh->addr, sh->count); + bios.cookie = 0; + if (smbios_find_table(SMBIOS_TYPE_BIOS, &bios)) { + sb = bios.tblhdr; + printf("\n%s:", sc->sc_dev.dv_xname); + + if ((smbios_get_string(&bios, sb->vendor, + scratch, sizeof(scratch))) != NULL) + printf(" vendor %s", scratch); + if ((smbios_get_string(&bios, sb->version, + scratch, sizeof(scratch))) != NULL) + printf(" version \"%s\"", scratch); + if ((smbios_get_string(&bios, sb->release, + scratch, sizeof(scratch))) != NULL) + printf(" date %s", scratch); + } smbios_info(sc->sc_dev.dv_xname); break; } |