Coder Social home page Coder Social logo

uefi-cpp's Introduction

UEFI++

An object-oriented wrapper for UEFI

Note: I am no longer maintaining this project, instead I am working on an equivalent library for the Rust programming language.

This project is a C++ wrapper for the UEFI specification, intended for people who write UEFI applications (OS loaders, shells, etc.)

This wrapper supports both 32 and 64 bit UEFI architectures.

The project is composed of two parts:

  • The headers in the UEFI folder, which contain the base structures from the UEFI specification.
  • The headers in the UEFI++ folder, which contain some classes to make UEFI easier to use.

The current version is based on Version 2.6 of the UEFI specification, available here.

Example

Here's some code that uses the old, C-style API of the specification:

systemTable->ConOut->OutputString(systemTable->ConOut, L"Hello UEFI!");

Here's some code that uses the new C++ API:

systemTable.consoleOut.outputString(u"Hello UEFI!");

And here's one that's even more modern:

// Set the stream's output.
out.setOutput(*systemTable.consoleOut);

out << "Hello UEFI!";

Performance difference? Zero. Zero cost abstractions make this possible.

Features

  • Uses modern C++14 features (constexpr, static_assert, strongly typed enums).
  • Mainly intended for UEFI applications, not tested for UEFI drivers.
  • Relies on some C/C++ headers, but does not require a hosted standard library.

Required software

  • C++14 compatible compiler (Clang, GCC).

  • A C++14 standard library (including the C headers). This wrapper only uses non-hosted functions from the standard lib, therefore it doesn't require a runtime. Some of the required headers:

    • <cstdint>: for cross-architecture integer types.
    • <cstddef>: for size_t.
    • <type_traits>: for some template metaprogramming and static assertions.
    • <utility>: for some utility functions (e.g. std::swap()).
  • (Optional) QEmu with OVMF to be able to test UEFI apps in a virtual machine.

  • (Optional) Doxygen to generate documentation.

License

The files included in this repository are licensed under the Mozilla Public License, Version 2.0.

This means you are free to use the header files, even in a proprietary program, as long as they are unmodified. You must open source any modifications to the headers you use.

See the license for more information.

Contributions

Anyone is welcome to contribute to this project.

Please try to adhere to modern C++ coding style & guidelines and avoid C-style hacks. Use the Issues tab to submit bugs or feature requests, or submit improved code as Pull requests.

uefi-cpp's People

Contributors

gabrielmajeri avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

uefi-cpp's Issues

Set up continuous integration

Set up continuous integration using Semaphore.

  • Build a source file which includes the header (without actually running it).

  • Write unit tests and run them in QEMU with OVMF.

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.