Skip to content

Commit 6d6670c

Browse files
committed
wip
1 parent 1e1ef79 commit 6d6670c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

multiboot2/src/lib.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,27 +1218,33 @@ mod tests {
12181218
let addr = bytes.0.as_ptr() as usize;
12191219
let bi = unsafe { load(addr) };
12201220
let bi = bi.unwrap();
1221-
test_grub2_boot_info(bi, addr, string_addr, &bytes.0, &string_bytes.0);
1221+
1222+
test_grub2_boot_info(&bi, addr, string_addr, &bytes.0, &string_bytes.0);
12221223
let bi = unsafe { load_with_offset(addr, 0) };
12231224
let bi = bi.unwrap();
1224-
test_grub2_boot_info(bi, addr, string_addr, &bytes.0, &string_bytes.0);
1225+
test_grub2_boot_info(&bi, addr, string_addr, &bytes.0, &string_bytes.0);
12251226
let offset = 8usize;
12261227
for i in 0..8 {
12271228
bytes.0[796 + i] = ((string_addr - offset as u64) >> (i * 8)) as u8;
12281229
}
12291230
let bi = unsafe { load_with_offset(addr - offset, offset) };
12301231
let bi = bi.unwrap();
12311232
test_grub2_boot_info(
1232-
bi,
1233+
&bi,
12331234
addr,
12341235
string_addr - offset as u64,
12351236
&bytes.0,
12361237
&string_bytes.0,
12371238
);
1239+
1240+
// Check that the MBI's debug output can be printed without SEGFAULT.
1241+
// If this works, it is a good indicator than transitively a lot of
1242+
// stuff works.
1243+
println!("{bi:#?}");
12381244
}
12391245

12401246
fn test_grub2_boot_info(
1241-
bi: BootInformation,
1247+
bi: &BootInformation,
12421248
addr: usize,
12431249
string_addr: u64,
12441250
bytes: &[u8],

0 commit comments

Comments
 (0)