Skip to content

Commit b0a7217

Browse files
committed
Update UEFI docs
- Mention stdio support - Update the example Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
1 parent af68593 commit b0a7217

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/doc/rustc/src/platform-support/unknown-uefi.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,12 @@ cargo build --target x86_64-unknown-uefi -Zbuild-std=std,panic_abort
265265
#### os_str
266266
- While the strings in UEFI should be valid UCS-2, in practice, many implementations just do not care and use UTF-16 strings.
267267
- Thus, the current implementation supports full UTF-16 strings.
268+
#### stdio
269+
- Uses `Simple Text Input Protocol` and `Simple Text Output Protocol`.
270+
- Note: UEFI uses CRLF for new line. This means Enter key is registered as CR instead of LF.
268271

269272
## Example: Hello World With std
270-
The following code features a valid UEFI application, including stdio and `alloc` (`OsString` and `Vec`):
273+
The following code features a valid UEFI application, including `stdio` and `alloc` (`OsString` and `Vec`):
271274

272275
This example can be compiled as binary crate via `cargo` using the toolchain
273276
compiled from the above source (named custom):
@@ -286,6 +289,9 @@ use std::{
286289
};
287290
288291
pub fn main() {
292+
println!("Starting Rust Application...");
293+
294+
// Use System Table Directly
289295
let st = env::system_table().as_ptr() as *mut efi::SystemTable;
290296
let mut s: Vec<u16> = OsString::from("Hello World!\n").encode_wide().collect();
291297
s.push(0);

0 commit comments

Comments
 (0)