Write HELLO memory map debug data to serial port
This commit is contained in:
1 parent
0781962e9f
commit
4500f3cbca
2 files changed
+13
-1
No files matched your search
@@ -11,6 +11,7 @@ import hulk.pagetable;
|
||||
import hulk.cpu;
|
||||
import hulk.memory;
|
||||
import ldc.llvmasm;
|
||||
import hulk.serial;
|
||||
|
||||
__gshared EFI_SYSTEM_TABLE * st;
|
||||
/** HULK binary start address, 4KB-aligned. */
|
||||
@@ -205,6 +206,7 @@ private void get_memory_map(ulong * physical_address_limit, UINTN * memory_map_k
|
||||
}
|
||||
if (descriptor.Type >= efi_to_hulk_memory_map_type.length)
|
||||
{
|
||||
Serial.writefln("Unexpected descriptor type %u", descriptor.Type);
|
||||
continue;
|
||||
}
|
||||
bootinfo().memory_map[count].base = descriptor.PhysicalStart;
|
||||
@@ -217,6 +219,7 @@ private void get_memory_map(ulong * physical_address_limit, UINTN * memory_map_k
|
||||
bootinfo().bss_phys = bootinfo().memory_map[count].base;
|
||||
bootinfo().memory_map[count].base += hulk_bss_size();
|
||||
bootinfo().memory_map[count].size -= hulk_bss_size();
|
||||
Serial.writefln("Locating HULK BSS at %x", bootinfo().bss_phys);
|
||||
found_bss = true;
|
||||
}
|
||||
if ((!found_stack) &&
|
||||
@@ -226,6 +229,7 @@ private void get_memory_map(ulong * physical_address_limit, UINTN * memory_map_k
|
||||
bootinfo().stack_phys = bootinfo().memory_map[count].base;
|
||||
bootinfo().memory_map[count].base += hulk_stack_size();
|
||||
bootinfo().memory_map[count].size -= hulk_stack_size();
|
||||
Serial.writefln("Locating HULK stack at %x", bootinfo().stack_phys);
|
||||
found_stack = true;
|
||||
}
|
||||
if ((!found_fb_buffer1) &&
|
||||
@@ -235,8 +239,13 @@ private void get_memory_map(ulong * physical_address_limit, UINTN * memory_map_k
|
||||
bootinfo().fb_buffer1_phys = bootinfo().memory_map[count].base;
|
||||
bootinfo().memory_map[count].base += fb_size;
|
||||
bootinfo().memory_map[count].size -= fb_size;
|
||||
Serial.writefln("Locating HULK FB1 at %x", bootinfo().fb_buffer1_phys);
|
||||
found_fb_buffer1 = true;
|
||||
}
|
||||
Serial.writefln("Memory range %x:%x (%u)",
|
||||
bootinfo().memory_map[count].base,
|
||||
bootinfo().memory_map[count].base + bootinfo().memory_map[count].size - 1u,
|
||||
bootinfo().memory_map[count].type);
|
||||
}
|
||||
bootinfo().memory_map_count = count;
|
||||
if ((!found_bss) || (!found_stack) || (!found_fb_buffer1))
|
||||
|
||||
Reference in new issue
Block a user