diff options
author | Benji Dial <Benji3.141@gmail.com> | 2019-12-27 11:10:56 -0500 |
---|---|---|
committer | Benji Dial <Benji3.141@gmail.com> | 2019-12-27 11:10:56 -0500 |
commit | 3f3f9a806dc63ad827fe28724dabe694f6e67f1e (patch) | |
tree | 441ff1f1617086e200af097575889735dc08b0ad /src/kernel/main.c | |
parent | 1f309e75b808f7f9576a3f60dbbe925d1e43a714 (diff) | |
download | portland-os-3f3f9a806dc63ad827fe28724dabe694f6e67f1e.tar.gz |
apm and smbios stubs, get_char can now wait for printable
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)); |