diff --git a/src/arch/x86_64/firecracker.rs b/src/arch/x86_64/firecracker.rs index c4aedc1..26d4f5f 100644 --- a/src/arch/x86_64/firecracker.rs +++ b/src/arch/x86_64/firecracker.rs @@ -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::(boot_params + E820_ENTRIES_OFFSET)) }; @@ -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; } @@ -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(); }