-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* The bootloader now implements SSE and AVX support and enables AVX if found. * Rewrote SSE code in rust using inline ASM and made SSE and AVX features. * Deleted SSE assembly and formatted code. * Aded a use statement to fix a compile error. * Removed AVX support. * Tested SSE support and formatted code. * Formatted code and ensured that the bootloader *actually* built. * Got SSE t ofinally work (haven't committed in a while because of lack of time) * Aded bit_field dependency. Formatted code. * Moved SSE into its own module. Made deps for SSE entirely optional. Removed botloader dep from test kernel. * Added function call to enable SSE if SSE feature is enabled
- Loading branch information
Showing
8 changed files
with
50 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/// Enables Streaming SIMD Extensions (SSE) support for loaded kernels. | ||
#[cfg(feature = "sse")] | ||
pub fn enable_sse() { | ||
use bit_field::BitField; | ||
use x86_64::registers::control::Cr0; | ||
let mut flags = Cr0::read_raw(); | ||
flags.set_bit(2, false); | ||
flags.set_bit(1, true); | ||
flags.set_bit(9, true); | ||
flags.set_bit(10, true); | ||
unsafe { | ||
Cr0::write_raw(flags); | ||
} | ||
// For now, we must use inline ASM here | ||
let mut cr4: u64; | ||
unsafe { | ||
asm!("mov %cr4, $0" : "=r" (cr4)); | ||
} | ||
cr4.set_bit(9, true); | ||
cr4.set_bit(10, true); | ||
unsafe { | ||
asm!("mov $0, %cr4" :: "r" (cr4) : "memory"); | ||
} | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.