-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
78 additions
and
146 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 |
---|---|---|
|
@@ -3,10 +3,14 @@ name = "Boot2Snow" | |
version = "0.1.0" | ||
authors = ["xuserwhat <[email protected]>"] | ||
|
||
[dependencies.compiler_builtins] | ||
git = "https://github.com/rust-lang-nursery/compiler-builtins" | ||
features = ["mem"] | ||
|
||
[dependencies] | ||
uefi = {path = "../../../share/libuefi"} | ||
uefi = {path = "../../../share/uefi"} | ||
uefi_alloc = {path = "../../../share/uefi_alloc"} | ||
rlibc = "1.0" | ||
compiler_builtins = { git = "https://github.com/rust-lang-nursery/compiler-builtins" } | ||
utf16_literal = "0.1.0" | ||
|
||
[lib] | ||
|
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,30 @@ | ||
use alloc::{String, Vec}; | ||
use core::char; | ||
|
||
pub fn wstr(string: &str) -> Vec<u16> { | ||
let mut wstring = vec![]; | ||
|
||
for c in string.chars() { | ||
wstring.push(c as u16); | ||
} | ||
wstring.push(0); | ||
|
||
wstring | ||
} | ||
|
||
pub fn nstr(wstring: *const u16) -> String { | ||
let mut string = String::new(); | ||
|
||
let mut i = 0; | ||
loop { | ||
let w = unsafe { *wstring.offset(i) }; | ||
i += 1; | ||
if w == 0 { | ||
break; | ||
} | ||
let c = unsafe { char::from_u32_unchecked(w as u32) }; | ||
string.push(c); | ||
} | ||
|
||
string | ||
} |
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 |
---|---|---|
|
@@ -14,4 +14,4 @@ | |
"eliminate-frame-pointer": false, | ||
"linker-flavor": "ld", | ||
"morestack": false | ||
} | ||
} |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Submodule uefi_alloc
added at
6a3fb5
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.