summaryrefslogtreecommitdiff
path: root/src/arch
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
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')
-rw-r--r--src/arch/amd64/debugger.c2
-rw-r--r--src/arch/amd64/mboot.c26
2 files changed, 26 insertions, 2 deletions
diff --git a/src/arch/amd64/debugger.c b/src/arch/amd64/debugger.c
index 4df59f7..2356e4a 100644
--- a/src/arch/amd64/debugger.c
+++ b/src/arch/amd64/debugger.c
@@ -300,7 +300,7 @@ static int debugger_prompt(struct isr_regs *state) {
case 's': // step (n)
rflags->tf = 1;
dbg_steps = atol(buf + 1) - 1;
- if (dbg_steps < 0) dbg_steps = 0;
+ //if (dbg_steps < 0) dbg_steps = 0;
return 0;
case 'b': // breakpoints
{
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;