-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
APS updates #2528
base: main
Are you sure you want to change the base?
APS updates #2528
Conversation
These are some minor updates from walking through the session myself. * Add some context to the `entry.S` slide, which is otherwise a bit terrifying for someone who does not speak ARM assembly. * Include a simple, fake example of MMIO. * Add a "Using It" section to the minimal UART segment, parallel to the better UART * Better explanation of the `unwrap` calls in the logging example. Unwrap is never "unsafe", so remove that word. * Allow dead code in some `.rs` files. * Remove redundant warning about use of memory before MMU setup. * Rephase text about buddy-system * Fix lint warning in spin slide.
ac2c766
to
31003d5
Compare
@@ -8,6 +8,10 @@ Before we can start running Rust code, we need to do some initialisation. | |||
|
|||
<details> | |||
|
|||
This code is in `src/bare-metal/aps/examples/entry.S`. It's not necessary to | |||
understand this in detail -- the takeaway is that typically some low-level setup | |||
is needed to meet Rust's expectations of the system. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I'm teaching I usually walk through the initialisation here, and talk about why cache coherency issues are a problem, because that is a common mistake I've seen. If people are used to doing similar things in C then it's pretty much the same, but if they're not then I think it's important to understand.
assert_eq!( | ||
SOME_DEVICE_BASE_ADDRESS.add(REGISTER_OFFSET).read_volatile(), | ||
0xaa | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this example trying to demonstrate? If you're just showing how to use read_volatile
and write_volatile
then it doesn't need to be in a main
function like this, as you're not going to compile it anyway. Adding an arbitrary offset to an equally arbitrary address probably doesn't add much either.
# Using it | ||
|
||
Let's write a small program using our driver to write to the serial console, and | ||
echo incoming bytes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not what main_minimal
does.
These are some minor updates from walking through the session myself.
entry.S
slide, which is otherwise a bit terrifying for someone who does not speak ARM assembly.unwrap
calls in the logging example. Unwrap is never "unsafe", so remove that word..rs
files.