Code Monkey home page Code Monkey logo

intel / unicorn-for-efi Goto Github PK

View Code? Open in Web Editor NEW
32.0 4.0 7.0 12.97 MB

Unicorn Engine port for UEFI firmware

Home Page: https://www.unicorn-engine.org/

License: GNU General Public License v2.0

Ruby 0.65% CMake 0.27% Makefile 0.12% Python 1.76% F# 0.76% C# 0.10% Go 0.54% C 90.16% Haskell 0.56% Java 1.59% Pascal 0.81% Shell 0.75% Rust 0.57% Visual Basic 6.0 0.67% C++ 0.43% Objective-C 0.24% Assembly 0.01% NASL 0.01%
uefi unicorn efi firmware

unicorn-for-efi's Introduction

Unicorn Engine port for UEFI firmware

Last updated: March 4th, 2024.

This fork of the Unicorn Engine brings support for building Unicorn-based applications and drivers in the UEFI firmware environment. This was developed as part of MultiArchUefiPkg.

This repo is intended to be temporary, as part of upstreaming activities. Our intention is to merge the UEFI support and assorted fixes into the main project repository.

See README.md for the original Unicorn Engine README.

Building

Currently the supported targets are AARCH64 UEFI and RISCV64 UEFI.

You need the TianoCore UEFI EDK2 environment set up. Here's an example for how the some of the Unicorn sample apps could be built in an EDK2 environment targeting RISCV64:

. edksetup.sh
export GCC5_RISCV64_PREFIX=riscv64-linux-gnu-

build -a RISCV64 -t GCC5 -p unicorn/efi/UnicornPkg.dsc -b DEBUG

You get UnicornSampleX86, UnicornSampleArm64 and UnicornSampleRV. The latter shows how it's possible to link against multiple target emulation libraries.

MultiArchUefiPkg itself is a great example of how to use Unicorn with UEFI.

Tested Compilers

Here's a rough idea of what's supposed to work. File bugs if UnicornPkg doesn't build for you.

AArch64

  • gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)

RISC-V

X64

  • gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
  • gcc version 13.1.0 (Homebrew GCC 13.1.0)

FAQ

Help, building UnicornPkg.dsc crashes during linking!

You're using a smaller machine and LTO is consuming all memory. Modify the UC_LTO_JOBS build parameter in UnicornPkg.dsc If the value is too high, the build may abort. If the value is too low, the build may take forever.

Help, building UnicornPkg.dsc takes forever!

Modify the UC_LTO_JOBS build parameter in UnicornPkg.dsc to a higher value or 'auto'. If the value is too high, the build may abort. If the value is too low, the build may take forever.

Note: newer versions of GCC (e.g. GCC 13) do much better with LTO compared to GCC 9, both in terms of speed and resource use.

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.