mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-24 09:53:24 +00:00
Give multiboot2 entry magic a name
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
41d8e4228f
commit
c932878dd1
@ -12,6 +12,8 @@ use crate::{config::PHYS_OFFSET, vm::paddr_to_vaddr};
|
|||||||
|
|
||||||
global_asm!(include_str!("boot.S"));
|
global_asm!(include_str!("boot.S"));
|
||||||
|
|
||||||
|
const MULTIBOOT2_ENTRY_MAGIC: u32 = 0x36d76289;
|
||||||
|
|
||||||
static MB2_INFO: Once<BootInformation> = Once::new();
|
static MB2_INFO: Once<BootInformation> = Once::new();
|
||||||
|
|
||||||
pub fn init_bootloader_name() {
|
pub fn init_bootloader_name() {
|
||||||
@ -187,7 +189,7 @@ extern "Rust" {
|
|||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
/// The entry point of Rust code called by inline asm.
|
/// The entry point of Rust code called by inline asm.
|
||||||
unsafe extern "C" fn __multiboot2_entry(boot_magic: u32, boot_params: u64) -> ! {
|
unsafe extern "C" fn __multiboot2_entry(boot_magic: u32, boot_params: u64) -> ! {
|
||||||
assert_eq!(boot_magic, 0x36d76289_u32);
|
assert_eq!(boot_magic, MULTIBOOT2_ENTRY_MAGIC);
|
||||||
MB2_INFO.call_once(|| unsafe {
|
MB2_INFO.call_once(|| unsafe {
|
||||||
BootInformation::load(boot_params as *const BootInformationHeader).unwrap()
|
BootInformation::load(boot_params as *const BootInformationHeader).unwrap()
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user