Skip to content

Commit

Permalink
xxx
Browse files Browse the repository at this point in the history
  • Loading branch information
phip1611 committed Aug 12, 2024
1 parent 9380151 commit d8ec443
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
17 changes: 15 additions & 2 deletions integration-test/bins/multiboot2_chainloader/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,21 @@ fn rust_entry(multiboot_magic: u32, multiboot_hdr: *const u32) -> ! {
assert_eq!(multiboot_magic, multiboot2::MAGIC);
let mbi = unsafe { multiboot2::BootInformation::load(multiboot_hdr.cast()) }.unwrap();

if let Some(mmap) = mbi.memory_map_tag() {
log::debug!("old memory map:",);
for desc in &mmap.memory_areas()[0..2] {
log::warn!(
" start=0x{:016x?} size={:016x?} type={:?}",
desc.start_address(),
desc.size(),
desc.typ(),
);
}
}

if let Some(mmap) = mbi.efi_memory_map_tag() {
log::debug!("efi memory map:",);
for desc in mmap.memory_areas() {
for desc in mmap.memory_areas().take(2) {
log::warn!(
" start=0x{:016x?} size={:016x?} type={:?}, attr={:?}",
desc.phys_start,
Expand All @@ -35,6 +47,7 @@ fn rust_entry(multiboot_magic: u32, multiboot_hdr: *const u32) -> ! {
);
}
}
panic!();

loader::load_module(&mbi);
//loader::load_module(&mbi);
}
6 changes: 3 additions & 3 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
let
sources = import ./nix/sources.nix;
pkgs = import sources.nixpkgs {};
pkgs = import sources.nixpkgs { };
in
pkgs.mkShell rec {
packages = with pkgs; [
Expand All @@ -10,12 +10,12 @@ pkgs.mkShell rec {
niv

# integration test
grub2 # for grub-file
grub2 # for grub-file
qemu
xorriso

(pkgs.writeShellScriptBin "run-integrationtest" ''
./integration-test/run.sh
./integration-test/run.sh
'')
];

Expand Down

0 comments on commit d8ec443

Please sign in to comment.