Created
March 5, 2022 06:26
-
-
Save agrif/e237565bd1c84afcb6c2c9d7b5c9c75c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// find the segmented address of STAGE3_ENTRY | |
// be careful: rust *really* wants to optimize STAGE3_ENTRY into a u16 | |
// in the resulting binary | |
let mut buf_address: u32; | |
unsafe { | |
core::arch::asm!( | |
"mov {1}, {0}", | |
in(reg) STAGE3_ENTRY, | |
out(reg) buf_address, | |
); | |
} | |
buf_address -= (BOOT_SEGMENT as u32) << 4; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment