#no_std — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #no_std, aggregated by home.social.
-
64 байта и одна константа: разбор переключения контекста в ядре на Rust
В прошлый раз я писал про потерянное пробуждение и получил в комментариях справедливое замечание, что примитив там классический. Так и есть. Сегодня про место, где классики меньше: как в моём ядре устроено переключение контекста, и почему ассемблер там знает смещение поля в структуре Rust. Это неприятная связь. Ассемблеру нужен байтовый доступ к сохранённым регистрам, а раскладку структуры определяет компилятор. Если эти двое разойдутся во мнениях, вы не получите ошибку компиляции. Вы получите ядро, которое пишет регистры мимо и падает где-то далеко от места ошибки.
https://habr.com/ru/articles/1068066/
#rust #ассемблер #переключение_контекста #ядро #операционные_системы #системное_программирование #x8664 #no_std #fpu #xsave
-
I hate #async in #Rust.
I say that after writing 4 toy runtimes for it.I have a very async-shaped problem and I *still* can't use async for it without ugly hacks.
Lifetime hell is trying to kill me. Will self-referential struct save me or finish the job? Let's find out.
Yeah, I'm riding #no_std , no alloc, why do you ask?
-
🦀 atomic_enum: An attribute to create an atomic wrapper around a C-style enum - can be used in #[no_std] environments - Internally, uses AtomicUsize to store the value - The atomic operations have the same semantics as the equivalent operations of AtomicUsize crates.io/crates/atomi... #rustlang
-
Ah i just roasted my sole #ESP32c6 board while measuring something with my voltmeter.
And almost no shop has a replacement in under 20 days.
I was so close prototyping the aquarium temperature regulator for my girlfriend. -
It is my pleasure to announce that I'm leading an #embedded #Rust workshop at the #CCCamp23 . Come on Friday 17:00 to #Schattenland at #ChaosZone .
I'll show you how to use #no_std Rust, aka hard mode. Bring your laptop!
-
So we're gradually rewriting it in #no_std #rust. We can make direct syscalls, which are allowed by our seccomp filter so as to avoid recursion, and that's about it.
Luckily most of what this library does is set up fast IPC to our main process and delegate most of the syscall handling to there, so there's not that much we need to implement in this constrained environment. It's certainly making for some interesting exercises, though.
-
Wrote an implementation of thread local storage in #no_std #rust, for Linux x86_64, with options to a) use libc's thread local storage, b) leverage libc's thread local storage that something in the same process has set up, or c) work without native thread local storage at all.
Toying with the idea of publishing it as a crate but, uh, I guess these requirements are pretty niche.
-
I built a Rust crate to parse MacBinary and resource fork data. As a testbed I created a webpage that uses the crate compiled to WebAssembly to show the data contained within a file you select and allows you to download individual parts, all client-side.
Parsing is done without any heap allocations with makes it `no_std` (embedded) compatible too.
-
Exploring programming patterns can get tedious, when you're rewriting the same example for the third time, each version having different shortcomings.
It's useful to check the ground truth once in a while and see how the piece connects to the bigger system, but that's still more potentially wasted effort.
In totally unrelated news, coding #rust with #no_std is hard mode :)
-
Because the crate I made yesterday (https://crates.io/crates/microasync) didn't have much to offer except for the sync function and yet got so much positive feedback, I thought I'd make another *very small* #rust crate to provide a more proper #async #runtime and IO.
This entire crate and its one dependency together are smaller than the futures-executor crate, while having more features. It's also got #no_std support (only for the runtime, not the IO)!