Pass HULK physical memory info to kernel from HELLO

This commit is contained in:
Josh Holtrop 2022-03-25 13:16:36 -04:00
parent cb31e36e90
commit 1225e98276
2 changed files with 12 additions and 0 deletions

View File

@ -264,6 +264,7 @@ private void map_hulk(PageTableEntry * pt_base)
{ {
ulong virt = HULK_VIRTUAL_START; ulong virt = HULK_VIRTUAL_START;
ulong hulk_bin_phys_start = cast(ulong)&hulk_bin_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 hulk_bin_phys_end = cast(ulong)&hulk_bin_end;
ulong phys_iter = hulk_bin_phys_start; ulong phys_iter = hulk_bin_phys_start;
while (phys_iter < hulk_bin_phys_end) 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 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; size_t bss_size = cast(size_t)hulk_header.total_size - hulk_bin_phys_size;
ulong bss_phys = alloc_hulk_bss(bss_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; ulong bss_phys_end = bss_phys + bss_size;
while (bss_phys < bss_phys_end) while (bss_phys < bss_phys_end)
{ {

View File

@ -46,6 +46,15 @@ struct BootInfo
/* Number of memory map entries. */ /* Number of memory map entries. */
size_t memory_map_count; 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. */ /** HULK base virtual address. */