Libpayload

From coreboot
Revision as of 00:02, 28 February 2008 by Whiterocker (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Overview

Currently a concept rather than shipping code, libpayload is a coreboot subproject that intends to provide a lightweight implementation of common and useful functions for coreboot payloads. The benefits of linking a coreboot payload against libpayload are:

  • payloads do not have to implement and maintain low-level code for I/O, common functions, etc,
  • payloads can be recompiled and deployed for CPU architectures supported by coreboot in the future,
  • libpayload functions tested and scrutinized outside payload development,
  • payloads themselves may be partly host-tested, e.g. against an emulation libpayload,
  • leads to the possibility of payloads using dynamic linking, reducing total payload footprint.

just give us a main() and a pocket full of dreams and we'll do the rest

Feature Wish List

  • Basics
    • coreboot services and structures (e.g. read CMOS, device tree)
    • subset of C-library functions (e.g. printf, puts, getch)
    • light ncurses from the Google Summer Of Code project
  • Fancies
    • directFB
    • TWIN

Usage Example

hello_payload.c:

#include <stdio.h>

int main( void )
{
    printf( "Hello, world!\n" );
    return 0;
}

build:

libpayload-gcc -o hello_payload hello_payload.c