From 46ffa54048faa994d3865bd11fbf4009c389a418 Mon Sep 17 00:00:00 2001 From: Ryan Cohen Date: Sat, 30 Apr 2022 13:30:53 -0400 Subject: [PATCH 1/3] Add documentation links for `SimpleFileSystem`. Adds documentation for rust-osdev#416 --- src/proto/media/fs.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/proto/media/fs.rs b/src/proto/media/fs.rs index 2c77e6f03..32df63da3 100644 --- a/src/proto/media/fs.rs +++ b/src/proto/media/fs.rs @@ -9,6 +9,16 @@ use core::ptr; /// /// This interface is implemented by some storage devices /// to allow file access to the contained file systems. +/// +/// # Accessing `SimpleFileSystem` protocol +/// +/// Use [`BootServices::get_image_file_system`] to retrieve the `SimpleFileSystem` +/// protocol associated with a given image handle. +/// +/// See the [`BootServices`] documentation for more details of how to open a protocol. +/// +/// [`BootServices::get_image_file_system`]: crate::table::boot::BootServices::get_image_file_system +/// [`BootServices`]: crate::table::boot::BootServices#accessing-protocols #[repr(C)] #[unsafe_guid("964e5b22-6459-11d2-8e39-00a0c969723b")] #[derive(Protocol)] From 20c1288b87c8b4880dad9b56178820080339b1fb Mon Sep 17 00:00:00 2001 From: Ryan Cohen Date: Sat, 30 Apr 2022 13:52:27 -0400 Subject: [PATCH 2/3] Fix `BootServices` and `RuntimeServices` documentation links. These links now show that they link to functions in `SystemTable`. Fix documentation for rust-osdev#416 --- src/table/boot.rs | 4 ++-- src/table/runtime.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/table/boot.rs b/src/table/boot.rs index cd1d4463f..f0ecd5f2c 100644 --- a/src/table/boot.rs +++ b/src/table/boot.rs @@ -21,9 +21,9 @@ use core::{ptr, slice}; /// /// # Accessing `BootServices` /// -/// A reference to `BootServices` can only be accessed by calling [`boot_services`]. +/// A reference to `BootServices` can only be accessed by calling [`SystemTable::boot_services`]. /// -/// [`boot_services`]: crate::table::SystemTable::boot_services +/// [`SystemTable::boot_services`]: crate::table::SystemTable::boot_services /// /// # Accessing protocols /// diff --git a/src/table/runtime.rs b/src/table/runtime.rs index 9272033cd..ef20eed15 100644 --- a/src/table/runtime.rs +++ b/src/table/runtime.rs @@ -21,9 +21,9 @@ use core::{fmt, ptr}; /// /// # Accessing `RuntimeServices` /// -/// A reference to `RuntimeServices` can only be accessed by calling [`runtime_services`]. +/// A reference to `RuntimeServices` can only be accessed by calling [`SystemTable::runtime_services`]. /// -/// [`runtime_services`]: crate::table::SystemTable::runtime_services +/// [`SystemTable::runtime_services`]: crate::table::SystemTable::runtime_services #[repr(C)] pub struct RuntimeServices { header: Header, From 1530946a35ad36f5c26e440790e83a78bf729b70 Mon Sep 17 00:00:00 2001 From: Ryan Cohen Date: Sat, 30 Apr 2022 14:00:55 -0400 Subject: [PATCH 3/3] Add documentation links for accessing an `Output` protocol. Add documentation for rust-osdev#416 --- src/proto/console/text/output.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/proto/console/text/output.rs b/src/proto/console/text/output.rs index 7f0d5c59d..5f298de78 100644 --- a/src/proto/console/text/output.rs +++ b/src/proto/console/text/output.rs @@ -7,6 +7,19 @@ use core::fmt::{Debug, Formatter}; /// /// It implements the fmt::Write trait, so you can use it to print text with /// standard Rust constructs like the `write!()` and `writeln!()` macros. +/// +/// # Accessing `Output` protocol +/// +/// The standard output and standard error output protocols can be accessed +/// using [`SystemTable::stdout`] and [`SystemTable::stderr`], respectively. +/// +/// An `Output` protocol can also be accessed like any other UEFI protocol. +/// See the [`BootServices`] documentation for more details of how to open a +/// protocol. +/// +/// [`SystemTable::stdout`]: crate::table::SystemTable::stdout +/// [`SystemTable::stderr`]: crate::table::SystemTable::stderr +/// [`BootServices`]: crate::table::boot::BootServices#accessing-protocols #[repr(C)] #[unsafe_guid("387477c2-69c7-11d2-8e39-00a0c969723b")] #[derive(Protocol)]