Skip to content

Commit

Permalink
integration-test: misc
Browse files Browse the repository at this point in the history
  • Loading branch information
phip1611 committed Sep 2, 2024
1 parent 68e7f7c commit bf54c87
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.

## Developer Guide

This is a pretty normal Cargo workspace with two crates. For the integration
test, please read the
corresponding [instructions](./integration-test/README.md).
5 changes: 4 additions & 1 deletion integration-test/bins/multiboot2_chainloader/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[package]
name = "multiboot2_chainloader"
description = "Integrationtest: Multiboot2 chainloader"
description = """
Integrationtest: Multiboot2 chainloader. The loader itself loads via Multiboot1,
but the payload is loaded via Multiboot2 by the loader.
"""
version = "0.1.0"
edition = "2021"
publish = false
Expand Down
2 changes: 0 additions & 2 deletions integration-test/bins/multiboot2_chainloader/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ core::arch::global_asm!(include_str!("start.S"), options(att_syntax));
#[no_mangle]
fn rust_entry(multiboot_magic: u32, multiboot_hdr: *const u32) -> ! {
init_environment();
let x = 0.12 + 0.56;
log::debug!("{x}");
log::debug!("multiboot_hdr={multiboot_hdr:x?}, multiboot_magic=0x{multiboot_magic:x?}");
let mbi = multiboot::get_mbi(multiboot_magic, multiboot_hdr as u32).unwrap();
let module_iter = mbi.modules().expect("Should provide modules");
Expand Down
4 changes: 3 additions & 1 deletion integration-test/bins/multiboot2_payload/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ fn main(multiboot2_magic: u32, multiboot2_hdr: u32) -> anyhow::Result<()> {
if multiboot2_magic != multiboot2::MAGIC {
Err(anyhow::Error::msg("Invalid bootloader magic"))?
}
log::debug!("multiboot2_hdr={multiboot2_hdr:x?}, multiboot2_magic=0x{multiboot2_magic:x?}");
log::debug!(
"multiboot2_hdr=0x{multiboot2_hdr:08x?}, multiboot2_magic=0x{multiboot2_magic:08x?}"
);

let mbi_ptr = (multiboot2_hdr as *const u8).cast();
let mbi = unsafe { BootInformation::load(mbi_ptr) }.map_err(anyhow::Error::msg)?;
Expand Down

0 comments on commit bf54c87

Please sign in to comment.