From b46dbba837aadd02806c789b0f0575ac3ba08cf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8E=9F=E7=94=B0=E8=8E=93=E8=8E=93?= Date: Tue, 26 May 2020 21:33:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20`no=5Fstd`=20=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In a bare metal environment no code has been loaded before your program. --- src/intro/no-std.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/intro/no-std.md b/src/intro/no-std.md index 724d540..5ecda10 100644 --- a/src/intro/no-std.md +++ b/src/intro/no-std.md @@ -9,7 +9,7 @@ ## 裸机环境 -在裸机环境中,系统在运行你的代码之前,没有未加载任何代码。因为没有操作系统的支持,我们将无法使用标准库。 +在裸机环境中,系统在运行你的代码之前,未加载任何代码。因为没有操作系统的支持,我们将无法使用标准库。 相反,程序及其使用的crate只能直接使用硬件(裸机)来运行。为了防止Rust加载标准库,必须使用`no_std`。可通过[核心库](https://doc.rust-lang.org/core/)获得标准库中与平台无关的部分。核心库还排除了嵌入式环境中并不总是需要的东西。其中之一是用于动态内存分配的内存分配器。如果您需要此功能或任何其他功能,通常会有第三方crate实现。 @@ -42,4 +42,4 @@ [alloc-cortex-m]: https://github.com/rust-embedded/alloc-cortex-m ## 其他资料 -* [RFC-1184](https://github.com/rust-lang/rfcs/blob/master/text/1184-stabilize-no_std.md) \ No newline at end of file +* [RFC-1184](https://github.com/rust-lang/rfcs/blob/master/text/1184-stabilize-no_std.md)