Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

APS updates #2528

wants to merge 1 commit into from

Conversation

djmitche
Copy link
Collaborator

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.

@djmitche djmitche requested a review from qwandor December 21, 2024 23:44
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.
@@ -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.
Copy link
Collaborator

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
);
Copy link
Collaborator

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.
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants