UEFI Makes It Easy To Boot Rust Applications

Written by Michael Larabel in Operating Systems on 20 November 2013 at 12:16 AM EST. 33 Comments
OPERATING SYSTEMS
While (U)EFI is frowned upon by many Linux users due to the security disaster known as Secure Boot or other UEFI compatibility problems with running Linux on systems, there are a few benefits.

One of the benefits to UEFI is that it makes it easier to create a bootable application / operating system -- much easier than the BIOS days. Mozilla's Rust programming language can now even be used for booting to such workloads written entirely in the new programming language. Rust is the safe, concurrent language that came out of research at Mozilla and only reached an alpha state in 2012, but is now up to version 0.8 and can host bootable programs.

Eric Holk wrote on his blog about the ease of use in making a bootable system with UEFI. He went on to make a "Hello World" example running off UEFI in this language partially inspired by C.

Eric began his blog post by explaining, "The thing that surprises me most about UEFI is that it now appears possible to boot your machine without ever writing a single line of assembly language. Booting used to require this tedious process of starting out in 16-bit real mode, then transitioning into 32-bit protected mode and then doing it all over again to get into 64-bit mode. UEFI firmwares, on the other hand, will happily load an executable file that you give it and run your code in 64-bit mode from the start. Your startup function receives a pointer to some functions that give you basic console support, as well as an API to access richer features."

Check out his application to learn more about booting with UEFI or the example Rust program that's hosted on GitHub as Boot2Rust.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week