Comments (8)
I would like to comment that I am also running into this issue.
I so far always swapped 0xdeadbeaf
for 0xdeadbea0
since that is a multiple of 0x4.
While that works, I am worried I might run into bigger problems later down the line.
from blog_os.
Hi, maybe the read_unaligned and the write_unaligned could be used in this case. I have not encountered this error so far.
Here are some links:
https://doc.rust-lang.org/std/ptr/fn.read_unaligned.html
https://doc.rust-lang.org/std/ptr/fn.write_unaligned.html
from blog_os.
@carloalbertogiordano
Thanks, but those can't be used as the os doesn't contain, or support, the std crate
from blog_os.
These functions are re-exports from libcore, which is supported. So you can write core::ptr::read_unaligned
and core::ptr::write_unaligned
.
from blog_os.
Okay, thanks @bjorn3 ! I haven't tried it, but I think it will work. I'll leave this open for now though, as it should be working without read/write_unaligned
from blog_os.
@bjorn3 Can confirm. core::ptr::write_unaligned
does work.
But, any idea as to why the standard syntax doesn't work anymore?
from blog_os.
Dereferencing unaligned pointers is UB. Previously if you were lucky the compiler wouldn't miscompile it, but to catch this UB, rustc recently added a compiler pass when debug assertions are enabled which adds code to check on every pointer dereference if the pointer is aligned or not and if not aborts. This helps finding this UB.
from blog_os.
Okay, so that's just how rustc compiles it now. Thanks!
from blog_os.
Related Issues (20)
- Post-3.2 Does not compile HOT 2
- post-02 broken on bootloader 0.11.3 and Rust nightly 2023-05-06 HOT 3
- %1 is not a valid Win32 application. (os error 193) HOT 4
- Build-std in cargo.toml is ignored when building HOT 2
- post-04 - Conditional compilation does not seem to work HOT 2
- [Translation] How to help translate to Spanish? HOT 2
- Very very huge Error when using [cargo bootimage] HOT 2
- Is there any way to interact with the filesystem through the bootloader or other crates? HOT 3
- UI Design HOT 2
- Project with bootloader v0.11; Error while compiling `kernel`, says `std` is required by `serde` HOT 8
- cargo bootimage failing HOT 3
- Tests seem to run for both lib and main HOT 2
- Design Enhancement HOT 8
- Table of Content HOT 4
- Has this project been discontinued? don't do this plz because it does do me great favor HOT 1
- Allow a sidebar access to other articles in the website HOT 2
- QEMU Bug in macOS 14: No "Hello, World" in `post-02` - just a black screen. HOT 19
- Add Scheduler tutorial HOT 3
- Unable to run the project as the project crashes after post 3 and i have not even used volatile yet. HOT 4
- Running `cargo test` gives error after following instructions of `post-04` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blog_os.