diff options
author | Marvin Borner | 2020-04-17 19:55:42 +0200 |
---|---|---|
committer | Marvin Borner | 2020-04-17 19:55:42 +0200 |
commit | 27c38d3f6e473d2bf7075fb364db148f22aca203 (patch) | |
tree | feec581b3198056143efab07d154a3dafeb79d80 /src/kernel/smbios/smbios.c | |
parent | 0aea2cf7d4c53f49e48c272ac7427ab337b476db (diff) |
Added multiboot smbios table
idk why, but grub doesn't seem to find a smbios table in qemu. I tried
a local dump of my pc's smbios but this doesn't work either.. *thinking*
Diffstat (limited to 'src/kernel/smbios/smbios.c')
-rw-r--r-- | src/kernel/smbios/smbios.c | 54 |
1 files changed, 5 insertions, 49 deletions
diff --git a/src/kernel/smbios/smbios.c b/src/kernel/smbios/smbios.c index f2650bb..5e48ffa 100644 --- a/src/kernel/smbios/smbios.c +++ b/src/kernel/smbios/smbios.c @@ -1,53 +1,9 @@ -#include <kernel/graphics/vesa.h> #include <stddef.h> +#include <kernel/multiboot.h> +#include <kernel/system.h> #include <kernel/smbios/smbios.h> -struct smbios_entry *smbios = 0; - -size_t smbios_table_len(struct smbios_header *header) -{ - size_t i; - const char *strtab = (char *)header + header->length; - for (i = 1; strtab[i - 1] != '\0' || strtab[i] != '\0'; i++) - ; - return header->length + i + 1; +void smbios_init(struct multiboot_tag_smbios *tag) { + log("%s", ((struct smbios_0 *)tag->tables)->vendor); + return; } - -struct smbios_entry *get_smbios() -{ - if (smbios != 0) - return smbios; - - char *mem = (char *)0xF0000; - int length, i; - unsigned char checksum; - while ((unsigned int)mem < 0x100000) { - if (mem[0] == '_' && mem[1] == 'S' && mem[2] == 'M' && mem[3] == '_') { - length = mem[5]; - checksum = 0; - for (i = 0; i < length; i++) { - checksum += mem[i]; - } - if (checksum == 0) - break; - } - mem += 16; - } - - if ((unsigned int)mem == 0x100000) { - warn("No SMBIOS found!"); - return 0; - } - - smbios = (struct smbios_entry *)mem; - if (smbios->major_version != 2) - warn("Non-supported SMBIOS version"); - smbios_table((struct smbios_header *)mem); - return smbios; -} - -void smbios_table(struct smbios_header *header) -{ - // struct smbios_0 *table = (struct smbios_0 *) (header + sizeof(struct smbios_header)); - // log("\n\n %d", table->bios_version); -}
\ No newline at end of file |