Compare commits

...

2 Commits

Author SHA1 Message Date
f236a64b21 HELLO: Be more welcoming 2022-03-25 13:17:22 -04:00
1225e98276 Pass HULK physical memory info to kernel from HELLO 2022-03-25 13:16:36 -04:00
2 changed files with 13 additions and 1 deletions

View File

@ -264,6 +264,7 @@ private void map_hulk(PageTableEntry * pt_base)
{
ulong virt = HULK_VIRTUAL_START;
ulong hulk_bin_phys_start = cast(ulong)&hulk_bin_start;
bootinfo.hulk_phys = hulk_bin_phys_start;
ulong hulk_bin_phys_end = cast(ulong)&hulk_bin_end;
ulong phys_iter = hulk_bin_phys_start;
while (phys_iter < hulk_bin_phys_end)
@ -278,6 +279,8 @@ private void map_hulk(PageTableEntry * pt_base)
size_t hulk_bin_phys_size = hulk_bin_phys_end - hulk_bin_phys_end;
size_t bss_size = cast(size_t)hulk_header.total_size - hulk_bin_phys_size;
ulong bss_phys = alloc_hulk_bss(bss_size);
bootinfo.bss_phys = bss_phys;
bootinfo.bss_size = bss_size;
ulong bss_phys_end = bss_phys + bss_size;
while (bss_phys < bss_phys_end)
{
@ -347,7 +350,7 @@ extern (C) EFI_STATUS efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE * st)
console.clear();
console.writeln("HELLO, HOS EFI Lightweight LOader, v0.1.0");
console.writeln("Welcome to HELLO, HOS EFI Lightweight LOader, v0.1.0");
console.writeln("Firmware vendor: '%S', version: 0x%x", st.FirmwareVendor, st.FirmwareVendor);
if (!set_graphics_mode())

View File

@ -46,6 +46,15 @@ struct BootInfo
/* Number of memory map entries. */
size_t memory_map_count;
/* Physical address of HULK. */
ulong hulk_phys;
/* Physical address used for HULK bss section. */
ulong bss_phys;
/* Size of HULK bss region. */
ulong bss_size;
}
/** HULK base virtual address. */