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

Compile error in VGA Buffer with Volatile #991

Closed
Rdna123 opened this issue May 17, 2021 · 2 comments
Closed

Compile error in VGA Buffer with Volatile #991

Rdna123 opened this issue May 17, 2021 · 2 comments

Comments

@Rdna123
Copy link

Rdna123 commented May 17, 2021

rror[E0599]: the method `write` exists for struct `Volatile<ScreenChar>`, but its trait bounds were not satisfied
  --> src\vga_buffer.rs:97:45
   |
55 | struct ScreenChar {
   | -----------------
   | |
   | doesn't satisfy `<ScreenChar as Deref>::Target = _`
   | doesn't satisfy `ScreenChar: Deref`
...
97 |                 self.buffer.chars[row][col].write(ScreenChar {
   |                                             ^^^^^ method cannot be called on `Volatile<ScreenChar>` due to unsatisfied trait bounds
   |
   = note: the following trait bounds were not satisfied:
           `<ScreenChar as Deref>::Target = _`
           `ScreenChar: Deref`

rustc --version
rustc 1.54.0-nightly (5c0292654 2021-05-11)

@bjorn3
Copy link
Contributor

bjorn3 commented May 17, 2021

Which version of volatile are you using? Blog os uses version 0.2.6. The latest version 0.4.4 has a different api which I don't even think is correct due to requiring the creation of a mutable reference to the memory location you need to write to, which I think allows LLVM to insert spurious non-volatile reads and writes. Mixing non-volatile and volatile memory accesses allows for all accesses to be considered non-volatile.
Edit: commented about the correctness issue at rust-osdev/volatile#13 (comment)

@Rdna123
Copy link
Author

Rdna123 commented May 17, 2021

Sorry, forgot to revert dependencies when I came a crossed the broken nightly error

@Rdna123 Rdna123 closed this as completed May 17, 2021
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

No branches or pull requests

2 participants