diff options
Diffstat (limited to 'src/kernel/main.c')
-rw-r--r-- | src/kernel/main.c | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/src/kernel/main.c b/src/kernel/main.c index 10f0446..36257e9 100644 --- a/src/kernel/main.c +++ b/src/kernel/main.c @@ -123,7 +123,24 @@ struct elf_tag { struct module_tag { uint32_t start; uint32_t end; - uint8_t argument[1]; +} __attribute__ ((__packed__)); + +struct smbios_tag { + uint8_t major_version; + uint8_t minor_version; + uint16_t padding[3]; +} __attribute__ ((__packed__)); + +struct apm_table { + uint16_t version; + uint16_t cs_32; + uint32_t ip_32; + uint16_t cs_16; + uint16_t ds_16; + uint16_t flags; + uint16_t cs_32_length; + uint16_t cs_16_length; + uint16_t ds_16_lenth; } __attribute__ ((__packed__)); struct boot_device_tag boot_device; @@ -169,9 +186,9 @@ uint32_t main(void) { put_32_hex(module->start); put_sz(" - "); put_32_hex(module->end - 1); - if (*module->argument) { + if (*(uint8_t *)(module + 1)) { put_sz("\n Argument: "); - put_sz(module->argument); + put_sz((uint8_t *)(module + 1)); } break; @@ -355,6 +372,24 @@ uint32_t main(void) { break; } + case APM_TABLE: { + struct apm_table *table = (struct apm_table *)(tag_pointer + 1); + put_sz(": APM table\n v"); + put_16_dec(table->version); + //TODO + break; + } + + case SMBIOS_TABLE: { + struct smbios_tag *tag = (struct smbios_tag *)(tag_pointer + 1); + put_sz(": SMBIOS\n v"); + put_8_dec(tag->major_version); + put_char('.'); + put_8_dec(tag->minor_version); + //TODO + break; + } + case IMAGE_BASE_ADDR: put_sz(": image address\n 0x"); put_32_hex(text_base = *(uint32_t *)(tag_pointer + 1)); |