Skip to content

Commit 18823ef

Browse files
committed
integrationtest: adapted to latest changes
1 parent 3535b1e commit 18823ef

File tree

2 files changed

+14
-14
lines changed
  • integration-test/bins

2 files changed

+14
-14
lines changed

integration-test/bins/multiboot2_chainloader/src/loader.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use core::ops::Deref;
1+
use alloc::boxed::Box;
22
use elf_rs::{ElfFile, ProgramHeaderEntry, ProgramType};
33
use multiboot2::{
4-
BootLoaderNameTag, CommandLineTag, MemoryArea, MemoryAreaType, MemoryMapTag, ModuleTag,
5-
SmbiosTag,
4+
BootLoaderNameTag, CommandLineTag, MaybeDynSized, MemoryArea, MemoryAreaType, MemoryMapTag,
5+
ModuleTag, SmbiosTag,
66
};
77

88
/// Loads the first module into memory. Assumes that the module is a ELF file.
@@ -43,27 +43,27 @@ pub fn load_module(mut modules: multiboot::information::ModuleIter) -> ! {
4343
// that the basic data structures are usable.
4444

4545
// build MBI
46-
let mbi = multiboot2::builder::InformationBuilder::new()
47-
.bootloader_name_tag(&BootLoaderNameTag::new("mb2_integrationtest_chainloader"))
48-
.command_line_tag(&CommandLineTag::new("chainloaded YEAH"))
46+
let mbi = multiboot2::Builder::new()
47+
.bootloader(BootLoaderNameTag::new("mb2_integrationtest_chainloader"))
48+
.cmdline(CommandLineTag::new("chainloaded YEAH"))
4949
// random non-sense memory map
50-
.memory_map_tag(&MemoryMapTag::new(&[MemoryArea::new(
50+
.mmap(MemoryMapTag::new(&[MemoryArea::new(
5151
0,
5252
0xffffffff,
5353
MemoryAreaType::Reserved,
5454
)]))
55-
.add_module_tag(&ModuleTag::new(
55+
.add_module(ModuleTag::new(
5656
elf_mod.start as u32,
5757
elf_mod.end as u32,
5858
elf_mod.string.unwrap(),
5959
))
6060
// Test that we can add SmbiosTag multiple times.
61-
.add_tag(SmbiosTag::new(1, 1, &[1, 2, 3]).deref())
62-
.unwrap()
63-
.add_tag(SmbiosTag::new(1, 2, &[1, 2, 3]).deref())
64-
.expect("should allow tag multiple times")
61+
.add_smbios(SmbiosTag::new(1, 1, &[1, 2, 3]))
62+
.add_smbios(SmbiosTag::new(2, 3, &[4, 5, 6]))
6563
.build();
6664

65+
let mbi = Box::leak(mbi);
66+
6767
log::info!(
6868
"Handing over to ELF: {}",
6969
elf_mod.string.unwrap_or("<unknown>")
@@ -74,7 +74,7 @@ pub fn load_module(mut modules: multiboot::information::ModuleIter) -> ! {
7474
core::arch::asm!(
7575
"jmp *%ecx",
7676
in("eax") multiboot2::MAGIC,
77-
in("ebx") mbi.as_ptr() as u32,
77+
in("ebx") mbi.as_ptr(),
7878
in("ecx") elf.entry_point() as u32,
7979
options(noreturn, att_syntax));
8080
}

integration-test/bins/multiboot2_payload/src/verify/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use alloc::vec::Vec;
66
use multiboot2::BootInformation;
77

88
pub fn run(mbi: &BootInformation) -> anyhow::Result<()> {
9-
println!("{mbi:#x?}");
9+
println!("MBI: {mbi:#x?}");
1010
println!();
1111

1212
let bootloader = mbi

0 commit comments

Comments
 (0)