Skip to content

Commit d7e62d2

Browse files
authored
Merge pull request #382 from rust-osdev/docs
Update comment and docs
2 parents 9c340c5 + 81a3cec commit d7e62d2

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,24 @@ If no features are enabled (`--no-default-features`), Rust 1.57.0 is required.
1717
If only the `instructions` feature is enabled (`--no-default-features --features instructions`), Rust 1.59.0 is required.
1818

1919
If the `nightly` feature or any of its sub-features is enabled, a recent nightly is required.
20+
21+
## Other OS development crates
22+
23+
This crate does not attempt to handle every facet of OS development. Other
24+
useful crates in this space include:
25+
- [`raw-cpuid`](https://crates.io/crates/raw-cpuid): safe wrappers around the
26+
[`cpuid` instruction](https://en.wikipedia.org/wiki/CPUID)
27+
- Provides parsed versions of the CPUID data, rather than just raw binary values.
28+
- Support for AMD and Intel specific values.
29+
- Works on x86 and x86_64 systems, in both user and kernel mode.
30+
- [`uefi`](https://crates.io/crates/uefi): abstractions for
31+
[UEFI](https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface)
32+
(the successor to BIOS)
33+
- Provides UEFI tables, functions, and types.
34+
- Useful for writing UEFI applications, or calling UEFI functions from your OS.
35+
- Works on a variety of modern platforms, not just x86_64.
36+
- [`volatile`](https://crates.io/crates/volatile): interface to
37+
[`read_volatile`](https://doc.rust-lang.org/std/ptr/fn.read_volatile.html) and
38+
[`write_volatile`](https://doc.rust-lang.org/std/ptr/fn.write_volatile.html)
39+
- Makes it easier to program [MMIO](https://en.wikipedia.org/wiki/Memory-mapped_I/O) interfaces and devices.
40+
- Works on any Rust target.

src/structures/paging/frame_alloc.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ use crate::structures::paging::{PageSize, PhysFrame};
44

55
/// A trait for types that can allocate a frame of memory.
66
///
7-
/// This trait is unsafe to implement because the implementer must guarantee that
8-
/// the `allocate_frame` method returns only unique unused frames.
7+
/// # Safety
8+
///
9+
/// The implementer of this trait must guarantee that the `allocate_frame`
10+
/// method returns only unique unused frames. Otherwise, undefined behavior
11+
/// may result from two callers modifying or deallocating the same frame.
912
pub unsafe trait FrameAllocator<S: PageSize> {
1013
/// Allocate a frame of the appropriate size and return it if possible.
1114
fn allocate_frame(&mut self) -> Option<PhysFrame<S>>;

0 commit comments

Comments
 (0)