Comments (8)
I personally need x86 support. As it stands, uefi-rs doesn't support anything that is not x86_64. This means no support for ARM, 32-bit x86, or Itanium. I have two questions:
- Would simply adding an
EFICALL
ABI in upstream rust be sufficient? I was thinking that adding an ABI to the list of ABIs and have it select the right underlying ABI in adjust_abi would be enough for our purposes. - In the absence of the above, would a proc macro not work? Using syn's
VisitorMut
, we could make a very simple proc macro like this playground. This macro could be an attribute macro tacked on structs and functions alike, handling both in the same way, which makes for a fairly elegant solution.
from uefi-rs.
Submitted a PR to rust-lang/rust: rust-lang/rust#65809
from uefi-rs.
This might be part of a bigger issue with supporting 32-bit UEFI. I've tried building for IA32 and it looks like there are a lot of other issues with it (issues with linker / name mangling, lack of compiler-builtins support for some functions).
I think the easiest solution for now would be to simply use extern "win64"
everywhere, and drop support for 32-bit.
from uefi-rs.
Related (unfortunately stalled) discussion: rust-lang/rust#54527
from uefi-rs.
Hi guys. We're writing a crate called efi which is very similar to uefi-rs and has almost the same goals. Just like you we're also planning an x86 build and have run into the problem of missing compiler-builtins for 32-bit. Do you happen to know the reasons for them not being implemented? Is it simply that 32-bit is low priority and nobody got to implementing them or there's a technical reason? I know you're not the maintainers of compiler_builtins, but I figured you might already have done some research on this topic :D.
We're building on Windows, by the way, and did not run into any tooling issues like @GabrielMajeri mentioned above fortunately. That's probably because Windows is a more natural home for UEFI development given its heritage.
cc @imor
from uefi-rs.
Is it simply that 32-bit is low priority
Unless somebody comes and contributes implementations for the specific functions, there will be no 32-bit support. compiler-builtins
is, like most projects, a community-driven effort.
there's a technical reason
In practice there are very few PCs with 32-bit-only UEFI implementations, and it's likely they will become even rarer as time goes on. 32-bit UEFI is also more likely to be buggy, due to less testing being done on it.
from uefi-rs.
Thanks Gabriel 👍. UEFI 32-bit being rare is very useful info for us. As we continue further work on our crate, we'll see if one of us can find time to implement missing builtins.
from uefi-rs.
@roblabla The idea of adding a new ABI to the compiler sounds good to me. The discussion over on rust-lang/rust stalled because the compiler team wanted to move ABI definitions to a JSON format, but that's beyond the scope of the issue. I'd say you could come up with a PR for `extern "uefi``.
As for the proc macro, sure, we could do that, but the initial idea was to get this integrated in the compiler to ensure consistency across different UEFI crates.
from uefi-rs.
Related Issues (20)
- Nevermind... HOT 1
- How to make a runtime driver? 🤔 HOT 9
- Allow getting a MemoryMap from a pointer
- how can I found the `Miscellaneous Protocols` and use it HOT 17
- Cannot load kernel.elf from loader by using `uefi-rs` HOT 2
- Is it a pretty way for exit_boot_services()? HOT 2
- Boot Linux after running the application HOT 5
- How to obtain a protocol interface HOT 2
- How to convert value returned by `get_variable_boxed()` into a printable `str`? HOT 5
- Potentially Outdated QEMU command in book HOT 2
- Fix `uefi_services` memory unsafety if application exits before exiting boot services HOT 1
- Release uefi-0.25.0 HOT 7
- Release uefi-raw-0.4.0, uefi-0.25.0, and uefi-services-0.22.0 HOT 4
- Bring back some form of "test latest release" CI job
- Memory Leak occurs when `GraphicsOutput::query_mode` is called. HOT 4
- Rethink (im)mutabiltiy of device paths (`DevicePathBuilder` / `install_protocol_interface`) HOT 4
- Consider renovatebot instead of dependabot
- Allow building device paths as constants HOT 2
- Dependency Dashboard
- Tracking Issue: High-level API filesystem usability HOT 4
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 uefi-rs.