Skip to content

Commit

Permalink
fix(firecracker): add individual memory regions
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Kröning <[email protected]>
  • Loading branch information
mkroening committed Nov 17, 2024
1 parent c8fad18 commit 6bb062c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/arch/x86_64/firecracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ pub unsafe fn boot_kernel(kernel_info: LoadedKernel) -> ! {
);
}

let mut fdt = Fdt::new("firecracker").unwrap();

// Load the boot_param memory-map information
let linux_e820_entries =
unsafe { *(sptr::from_exposed_addr::<u8>(boot_params + E820_ENTRIES_OFFSET)) };
Expand Down Expand Up @@ -206,6 +208,8 @@ pub unsafe fn boot_kernel(kernel_info: LoadedKernel) -> ! {

let entry_end = entry_start + entry_size;

fdt = fdt.memory(entry_start..entry_end).unwrap();

if start_address == 0 {
start_address = entry_start as usize;
}
Expand All @@ -223,11 +227,6 @@ pub unsafe fn boot_kernel(kernel_info: LoadedKernel) -> ! {
start_address, end_address
);

let mut fdt = Fdt::new("firecracker")
.unwrap()
.memory(start_address as u64..end_address as u64)
.unwrap();

if let Some(command_line) = command_line {
fdt = fdt.bootargs(command_line).unwrap();
}
Expand Down

0 comments on commit 6bb062c

Please sign in to comment.