mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-04 12:14:19 +01:00
584d792f5a
It prints nothing on my VM. Don't know if it works on a physical machine.
27 lines
755 B
C
27 lines
755 B
C
#include "bios.h"
|
|
|
|
#include <kenv.h>
|
|
|
|
static void kenvLookup(const char* name, FFstrbuf* result)
|
|
{
|
|
ffStrbufEnsureFree(result, 255);
|
|
int len = kenv(KENV_GET, name, result->chars, 256);
|
|
if(len > 0)
|
|
result->length = (uint32_t) len;
|
|
}
|
|
|
|
void ffDetectBios(FFBiosResult* bios)
|
|
{
|
|
ffStrbufInit(&bios->error);
|
|
ffStrbufInit(&bios->biosDate);
|
|
ffStrbufInit(&bios->biosRelease);
|
|
ffStrbufInit(&bios->biosVendor);
|
|
ffStrbufInit(&bios->biosVersion);
|
|
|
|
//https://wiki.ghostbsd.org/index.php/Kenv
|
|
kenvLookup("smbios.bios.reldate", &bios->biosDate);
|
|
kenvLookup("smbios.system.product", &bios->biosRelease);
|
|
kenvLookup("smbios.bios.vendor", &bios->biosVendor);
|
|
kenvLookup("smbios.bios.version", &bios->biosVersion);
|
|
}
|