summaryrefslogtreecommitdiff
path: root/src/arch/amd64/mboot.c
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-02-02 10:31:51 -0500
committerFreya Murphy <freya@freyacat.org>2024-02-02 10:31:51 -0500
commit95f52a55ad556d956c483abfc28a11603b75f4a8 (patch)
tree210868e9cc62b47c0941cddc836c1f2212d8ff6f /src/arch/amd64/mboot.c
parentmerge virtnodes on alloc (diff)
downloadcorn-95f52a55ad556d956c483abfc28a11603b75f4a8.tar.gz
corn-95f52a55ad556d956c483abfc28a11603b75f4a8.tar.bz2
corn-95f52a55ad556d956c483abfc28a11603b75f4a8.zip
better print and mem
Diffstat (limited to 'src/arch/amd64/mboot.c')
-rw-r--r--src/arch/amd64/mboot.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/arch/amd64/mboot.c b/src/arch/amd64/mboot.c
index f39dd79..315747e 100644
--- a/src/arch/amd64/mboot.c
+++ b/src/arch/amd64/mboot.c
@@ -133,19 +133,43 @@ static void read_cmdline(
shim_info->cmdline[size] = '\0';
}
+static const char *segment_type[] = {
+ "Reserved",
+ "Free",
+ "Reserved",
+ "ACPI Reserved",
+ "Hibernation",
+ "Defective",
+ "Unknown"
+};
+
static void read_memory_map(
struct boot_info *shim_info,
struct mboot_tag_mmap *map
) {
int idx = 0;
uintptr_t i = (uintptr_t)map->entries;
+ kprintf("MEMORY MAP\n");
+ char buf[20];
for ( ;
i < (uintptr_t)map->entries + map->size;
i += map->entry_size, idx++
) {
struct mboot_mmap_entry *seg = (struct mboot_mmap_entry *) i;
+ const char *type = NULL;
+ if (seg->type > 4)
+ type = segment_type[6];
+ else
+ type = segment_type[seg->type];
+ kprintf("ADDR: 0x%16p LEN: %4s TYPE: %s (%d)\n",
+ (void *)seg->addr,
+ btoa(seg->len, buf),
+ type,
+ seg->type
+ );
+ if (seg->type != 1 || seg->len < 1)
+ continue;
shim_info->map.entries[idx].addr = seg->addr;
- shim_info->map.entries[idx].type = seg->type;
shim_info->map.entries[idx].len = seg->len;
}
shim_info->map.entry_count = idx;