Coder Social home page Coder Social logo

rust-firmware's Introduction

rust-firmware

A demo for pure rust based firmware.

rust-rust-ipl/ResetVector is derived from EDKII

rust-uefi-payload is derived from rust-hypervisor-firmware

Quick Start (QemuFsp)

Note: If your build host is behind company’s firewall, it is important to set up proxy correctly.

Note: Build QemuFsp need VS2015 toolchain and make sure nasm curl can be found in your environment.

1. Build QemuFsp

cargo run -p build-fsp --bin build_qemu_fsp_release

2. Build resetvector rust-ipl and rust-uefi-payload

cargo xbuild --target x86_64-unknown-uefi --release

3. Generate firmware file (use rust-firmware-tool).

cargo run -p rust-firmware-tool -- target/x86_64-unknown-uefi/release/ResetVector.bin target/x86_64-unknown-uefi/release/rust_ipl.efi target/x86_64-unknown-uefi/release/rust-uefi-payload.efi target/x86_64-unknown-uefi/release/final.bin

4. Run final.bin in Qemu

qemu-system-x86_64 -m 4G -machine q35 -drive if=pflash,format=raw,unit=0,file=target/x86_64-unknown-uefi/release/final.bin -serial mon:stdio -nographic -vga none -nic none

Known limitation

This package is only the sample code to show the concept. It does not have a full validation such as robustness functional test and fuzzing test. It does not meet the production quality yet. Any codes including the API definition, the libary and the drivers are subject to change.

rust-firmware's People

Contributors

jyao1 avatar kailun-qin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rust-firmware's Issues

enable writable global variable

The reason is that some rust lib will require writable global variable to register a trait instance. (such as heap, or log)

This can be done by PE data section relocation to temp ram.

td payload hob base and td payload stack base is mistake.

td payload hob base should at memory_top - TD_PAYLOAD_EVENT_LOG_SIZE
td payload stack base should at memory_top - TD_PAYLOAD_EVENT_LOG_SIZE - TD_PAYLOAD_HOB_SIZE- TD_PAYLOAD_STACK_SIZE
td payload stack top should at memory_top - TD_PAYLOAD_EVENT_LOG_SIZE - TD_PAYLOAD_HOB_SIZE

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.