Write HELLO memory map debug data to serial port
This commit is contained in:
parent
0781962e9f
commit
4500f3cbca
@ -162,7 +162,10 @@ hello_env = env "hello", use: %w[ldc2 x86_64-w64-mingw32-gcc] do |env|
|
||||
env.add_builder(CheckThreadLocal)
|
||||
env.add_builder(HulkBinObj)
|
||||
env["sources"] = glob("src/hello/**/*.d")
|
||||
env["sources"] += ["src/hulk/writef.d"]
|
||||
env["sources"] += %w[
|
||||
src/hulk/serial.d
|
||||
src/hulk/writef.d
|
||||
]
|
||||
env["sources"] += glob("uefi-d/source/**/*.d")
|
||||
env.HulkBinObj("^/hulk_bin.S", hulk_env.expand("^/hulk.bin"))
|
||||
env.Object("^/hulk_bin.o", "^/hulk_bin.S")
|
||||
|
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user