mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Setup Rust: fix typo in attribute name
This commit is contained in:
committed by
Philipp Oppermann
parent
3453fbfa2f
commit
8c45ffff6a
@@ -52,7 +52,7 @@ pub extern fn rust_main() {}
|
|||||||
Let's break it down:
|
Let's break it down:
|
||||||
|
|
||||||
- `#!` defines an [attribute] of the current module. Since we are at the root module, they apply to the crate itself.
|
- `#!` defines an [attribute] of the current module. Since we are at the root module, they apply to the crate itself.
|
||||||
- The `features` attribute is used to allow the specified _feature-gated_ attributes in this crate. You can't do that in a stable/beta compiler, so this is one reason we need a Rust nighly.
|
- The `feature` attribute is used to allow the specified _feature-gated_ attributes in this crate. You can't do that in a stable/beta compiler, so this is one reason we need a Rust nighly.
|
||||||
- The `no_std` attribute prevents the automatic linking of the standard library. We can't use `std` because it relies on operating system features like files, system calls, and various device drivers. Remember that currently the only “feature” of our OS is printing `OKAY` :).
|
- The `no_std` attribute prevents the automatic linking of the standard library. We can't use `std` because it relies on operating system features like files, system calls, and various device drivers. Remember that currently the only “feature” of our OS is printing `OKAY` :).
|
||||||
- A `#` without a `!` afterwards defines an attribute for the _following_ item (a function in our case).
|
- A `#` without a `!` afterwards defines an attribute for the _following_ item (a function in our case).
|
||||||
- The `no_mangle` attribute disables the automatic [name mangling] that Rust uses to get unique function names. We want to do a `call rust_main` from our assembly code, so this function name must stay as it is.
|
- The `no_mangle` attribute disables the automatic [name mangling] that Rust uses to get unique function names. We want to do a `call rust_main` from our assembly code, so this function name must stay as it is.
|
||||||
|
|||||||
Reference in New Issue
Block a user