arm-trusted-firmware
c2rust
arm-trusted-firmware | c2rust | |
---|---|---|
9 | 46 | |
1,823 | 3,682 | |
1.6% | 1.4% | |
9.9 | 9.4 | |
2 days ago | 6 days ago | |
C | Rust | |
GNU General Public License v3.0 or later | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
arm-trusted-firmware
- A Close Look at a Spinlock
-
This happens more than I'd like to admit.
I have a PinePhone Pro, and I'm trying to figure out a reasonable way to get more than one half of ten minutes of battery life out of it, while still receiving notifications. I figure the best route to go will be to create a service that holds ports open, while the CPU is completely asleep, and either run it on the modem's processor or, as an possibility for the PinePhone Pro, but not the original Pinephone, run it on the m0 core used for power management.
-
Booting Modern Intel CPUs
Arm v7 was a Wild West, but with v8, Arm tried to standardize a lot. The Arm Trusted Firmware is the reference boot firmware implementation for v8+ CPUs: https://github.com/ARM-software/arm-trusted-firmware.
I'd think most of the referece documents can be discovered from that code base.
Relatedly, from the perspective of hands-on programming, the System Programmer's guide is the manual to start with.
-
โRust is safeโ is not some kind of absolute guarantee of code safety
I assure you that there is no lack of skill; that is just what happens over the course of ten years in a 300,000 line code-base and multiple hundreds of contributors: https://github.com/ARM-software/arm-trusted-firmware/blob/master/Makefile
-
The PocketReform is a made-in-Berlin Linux handheld
The ARM Trusted Firmware is what typically runs in the secure world, and it is indeed open source: https://github.com/ARM-software/arm-trusted-firmware
ROM code generally speaking is not open source, but has been dumped on occasion.
- Unpaid social media moderators perform labor worth at least $3.4 million a year on Reddit alone
-
Will we ever get any coreboot / libreboot support or any PSP source code releases??
The reference Trustzone implementation for ARM is open source https://github.com/ARM-software/arm-trusted-firmware , so I really can't think of some reason the ARM license would have to do with it.
-
SMP support for aarch64
SMP support (at least as far as CPU suspend and hotplug goes) is usually handled by TrustZone firmware on aarch64, not by the kernel (see PSCI). If you write your own OS on a bare-metal platform you can of course do what you want, but if you're looking for existing sources that's where you'd have to look. https://github.com/ARM-software/arm-trusted-firmware is a common reference implementation that supports a bunch of platforms, but many others (e.g. all Samsung and Qualcomm phones) also use their own proprietary stuff which is not publicly available.
-
Dissecting the Apple M1 GPU, part III -- Prototype Mesa compiler can now spin a cube
Come again? https://github.com/ARM-software/arm-trusted-firmware
c2rust
-
Converting the Kernel to C++
A recent practical example of the former: the fish shell re-wrote incrementally from C++ to Rust, and is almost finished https://github.com/fish-shell/fish-shell/discussions/10123
An example of the latter: c2rust, which is a work in progress but is very impressive https://github.com/immunant/c2rust
It currently translates into unsafe Rust, but the strategy is to separate the "compile C to unsafe Rust" steps and the "compile unsafe Rust to safe Rust" steps. As I see it, as it makes the overall task simpler, allows for more user freedom, and makes the latter potentially useful even for non-transpiled code. https://immunant.com/blog/2023/03/lifting/
-
Best tools to convert code between languages?
But not all transpilers are between languages where at least one of them is designed to be transpiled. For example, c2rust can transpile, as the name suggests, C to (ugly, unsafe) Rust. A while ago there was a Java -> C compiler in GCC (GCJ), but it's pretty out of date now.
-
Translate C code to Rust working with libc
I do not know about your specific issue but you may be interested by https://github.com/immunant/c2rust
-
Rewrite in Rust or Use Rust-bindings
You should also consider using C2Rust (they're even working on C -> safe Rust translation)
-
Emitting Safer Rust with C2Rust
> The date at the bottom of the article is 2022-06-13. Has there been further progress?
The article links to their github repo:
https://github.com/immunant/c2rust
There's commits in the last hour, so at least some signal of life.
-
Writing an OS in Rust to run on RISC-V
This is arguably already the state of things.
Rust might get compiled down through MIR, down through LLVM IR, down to assembly or wasm... which then might be JIT or AOT (re)compiled into other bytecodes... which might perhaps be decompiled back up to C... and C might be retranslated back to horrific unsafe-spamming Rust by the likes of https://c2rust.com/. We've come full circle!
The main issue is that retranslating high level languages into other high level languages isn't something that there's actually a lot of demand for, especially commercially, especially given the N x M translation matrix going on. So a lot of the projects "stabilize" (get abandoned). And automatically translating between the idioms of those languages gets even nastier in terms of matrix bloat.
Well, you've got stuff like MSIL and JVM bytecodes which are higher level, and preserve more type information, and can be compiled to / decompiled from while still preserving more structure, but they still form competing incompatible ecosystems.
-
Will Carbon Replace C++?
That's the wrong direction. What's needed are intelligent converters which convert less-strict languages to more-strict ones.
Non-intelligent converters just make a mess. Here's c2rust.[1]
Classic C++ to modern C++, plus a compiler flag to lock out all the old unsafe stuff, would be an achievement.
[1] https://c2rust.com/
- What would you rewrite in Rust?
-
Red Black Tree in Rust
Well, technically, it's not hard to build such data structures. If you are willing to liberally use raw pointers, UnsafeCell, MaybeUninit and ManuallyDrop, then you can more-or-less write C-equivalent code in unsafe Rust. (there are even transpilers from C to Rust)
-
In Rust We Trust โ A Transpiler from Unsafe C to Safer Rust
/uj This transpiles from C to unsafe Rust using an existing tool, then strips the unsafe keyword from the generated function signatures
What are some alternatives?
lru-rs - An implementation of a LRU cache
min-sized-rust - ๐ฆ How to minimize Rust binary size ๐ฆ
too-many-lists - Learn Rust by writing Entirely Too Many linked lists
subsurface - This is the official upstream of the Subsurface divelog program
darwin-xnu - Legacy mirror of Darwin Kernel. Replaced by https://github.com/apple-oss-distributions/xnu
librope - UTF-8 rope library for C
docs - Hardware and software docs / wiki
checkedc - Checked C is an extension to C that lets programmers write C code that is guaranteed by the compiler to be type-safe. The goal is to let people easily make their existing C code type-safe and eliminate entire classes of errors. Checked C does not address use-after-free errors. This repo has a wiki for Checked C, sample code, the specification, and test code.
pinephone_modem_sdk - Pinephone Modem SDK: Tools to build your own bootloader, kernel and rootfs
zz - ๐บ๐ ZetZ a zymbolic verifier and tranzpiler to bare metal C [Moved to: https://github.com/zetzit/zz]
8VIM - A Text Editor inside a keyboard, drawing it's inspiration from 8pen and Vim.
rtorrent - rTorrent BitTorrent client