Increase RAM available to the bootstrap environment to 8G

The kexec-fiwix part is a band-aid, since this hardcodes an
additional 4GiB RAM right at the start of PAE address space.
Proper fix would be passing on the real e820 memory map from
BIOS.
This commit is contained in:
Googulator 2023-11-13 10:27:47 +01:00
parent 54747ca104
commit 99c138387d
2 changed files with 10 additions and 2 deletions

View file

@ -256,7 +256,7 @@ print(shutil.which('chroot'))
system_a.prepare(create_initramfs=True, kernel_bootstrap=True)
run(args.qemu_cmd,
'-enable-kvm',
'-m', "4G",
'-m', "8G",
'-smp', str(args.cores),
'-no-reboot',
'-drive', 'file=' + os.path.join(system_a.tmp_dir, 'sysa.img') + ',format=raw',

View file

@ -123,7 +123,7 @@ int main() {
/* Set memory map info */
pmultiboot_info->mmap_addr = next_avail_mem;
pmultiboot_info->mmap_length = 7 * sizeof(multiboot_memory_map_t);
pmultiboot_info->mmap_length = 8 * sizeof(multiboot_memory_map_t);
multiboot_memory_map_t *pmultiboot_memory_map = (multiboot_memory_map_t *) next_avail_mem;
pmultiboot_memory_map->size = sizeof(multiboot_memory_map_t) - sizeof(multiboot_uint32_t);
@ -168,6 +168,14 @@ int main() {
pmultiboot_memory_map->type = MULTIBOOT_MEMORY_RESERVED;
pmultiboot_memory_map++;
pmultiboot_memory_map->size = sizeof(multiboot_memory_map_t) - sizeof(multiboot_uint32_t);
pmultiboot_memory_map->addr = 1;
pmultiboot_memory_map->addr = pmultiboot_memory_map->addr << 32;
pmultiboot_memory_map->len = 1;
pmultiboot_memory_map->len = pmultiboot_memory_map->len << 32;
pmultiboot_memory_map->type = MULTIBOOT_MEMORY_AVAILABLE;
pmultiboot_memory_map++;
next_avail_mem += pmultiboot_info->mmap_length;
/* Set boot loader name */