-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
surtr: enable NX-bit and protect ymir text section
Signed-off-by: smallkirby <ssmallkirby@gmail.com>
- Loading branch information
1 parent
f267ef0
commit 3becda0
Showing
3 changed files
with
38 additions
and
11 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1 +1,7 @@ | ||
pub const page = @import("page.zig"); | ||
|
||
/// Enable NX-bit. | ||
pub fn enableNxBit() void { | ||
const efer_reg: *volatile u64 = @ptrFromInt(0xC000_0080); | ||
efer_reg.* = efer_reg.* | (1 << 11); | ||
} |
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