about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAyush Singh <ayushdevel1325@gmail.com>2023-10-02 00:05:05 +0530
committerAyush Singh <ayushdevel1325@gmail.com>2023-10-02 00:06:09 +0530
commitb0a72173bbbdb2cd7b2c7411d66232f271fc6ec7 (patch)
treed1c988b9c9cecf5458ea62cc7e6de803a324ecb5
parentaf685931799459879b2a8995524755a06ffb5eec (diff)
downloadrust-b0a72173bbbdb2cd7b2c7411d66232f271fc6ec7.tar.gz
rust-b0a72173bbbdb2cd7b2c7411d66232f271fc6ec7.zip
Update UEFI docs
- Mention stdio support
- Update the example

Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
-rw-r--r--src/doc/rustc/src/platform-support/unknown-uefi.md8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/doc/rustc/src/platform-support/unknown-uefi.md b/src/doc/rustc/src/platform-support/unknown-uefi.md
index 68cd7fae319..370939520dc 100644
--- a/src/doc/rustc/src/platform-support/unknown-uefi.md
+++ b/src/doc/rustc/src/platform-support/unknown-uefi.md
@@ -265,9 +265,12 @@ cargo build --target x86_64-unknown-uefi -Zbuild-std=std,panic_abort
 #### os_str
 - While the strings in UEFI should be valid UCS-2, in practice, many implementations just do not care and use UTF-16 strings.
 - Thus, the current implementation supports full UTF-16 strings.
+#### stdio
+- Uses `Simple Text Input Protocol` and `Simple Text Output Protocol`.
+- Note: UEFI uses CRLF for new line. This means Enter key is registered as CR instead of LF.
 
 ## Example: Hello World With std
-The following code features a valid UEFI application, including stdio and `alloc` (`OsString` and `Vec`):
+The following code features a valid UEFI application, including `stdio` and `alloc` (`OsString` and `Vec`):
 
 This example can be compiled as binary crate via `cargo` using the toolchain
 compiled from the above source (named custom):
@@ -286,6 +289,9 @@ use std::{
 };
 
 pub fn main() {
+  println!("Starting Rust Application...");
+
+  // Use System Table Directly
   let st = env::system_table().as_ptr() as *mut efi::SystemTable;
   let mut s: Vec<u16> = OsString::from("Hello World!\n").encode_wide().collect();
   s.push(0);