Libpayload: Difference between revisions
Jump to navigation
Jump to search
m (→Libc Coverage) |
m (→Libc Coverage) |
||
Line 50: | Line 50: | ||
| colspan=2 | '''assert.h''' | | colspan=2 | '''assert.h''' | ||
|- | |- | ||
|- bgcolor="#eeeeee" valign="top" | |||
| style="background:red" | no | | style="background:red" | no | ||
| | | assert() | ||
|- bgcolor="#6699ff" | |- bgcolor="#6699ff" | ||
| colspan=2 | '''ctype.h''' | | colspan=2 | '''ctype.h''' | ||
|- | |- | ||
|- bgcolor="#eeeeee" valign="top" | |||
| style="background:red" | no | | style="background:red" | no | ||
| | | int isalnum(int character) | ||
|- | |- | ||
|- bgcolor="#dddddd" valign="top" | |||
| style="background:red" | no | | style="background:red" | no | ||
| | | int isalpha(int character) | ||
|- | |- | ||
|- bgcolor="#eeeeee" valign="top" | |||
| style="background:red" | no | | style="background:red" | no | ||
| | | int iscntrl(int character) | ||
|- | |- | ||
|- bgcolor="#dddddd" valign="top" | |||
| style="background:lime" | yes | | style="background:lime" | yes | ||
| | | int isdigit(int character) | ||
|- | |- | ||
|- bgcolor="#eeeeee" valign="top" | |||
| style="background:red" | no | | style="background:red" | no | ||
| | | int isgraph(int character) | ||
|- | |- | ||
|- bgcolor="#dddddd" valign="top" | |||
| style="background:red" | no | | style="background:red" | no | ||
| | | int islower(int character) | ||
|- | |- | ||
|- bgcolor="#eeeeee" valign="top" | |||
| style="background:red" | no | | style="background:red" | no | ||
| | | int isprint(int character) | ||
|- | |- | ||
|- bgcolor="#dddddd" valign="top" | |||
| style="background:red" | no | | style="background:red" | no | ||
| | | int ispunct(int character) | ||
|- | |- | ||
|- bgcolor="#eeeeee" valign="top" | |||
| style="background:lime" | yes | | style="background:lime" | yes | ||
| | | int isspace(int character) | ||
|- | |- | ||
|- bgcolor="#dddddd" valign="top" | |||
| style="background:red" | no | | style="background:red" | no | ||
| | | int isupper(int character) | ||
|- | |- | ||
|- bgcolor="#eeeeee" valign="top" | |||
| style="background:red" | no | | style="background:red" | no | ||
| | | int isxdigit(int character) | ||
|- bgcolor="#6699ff" | |- bgcolor="#6699ff" | ||
Line 522: | Line 534: | ||
|} | |} | ||
|} | |} | ||
Revision as of 01:39, 9 April 2008
libpayload is a small BSD-licensed static library (a lightweight implementation of common and useful functions) intended to be used as a basis 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.
- The libpayload functions can be tested and scrutinized outside payload development.
- Payloads themselves may be partly host-tested, e.g. against an emulation libpayload.
Just give us a main() and a pocket full of dreams and we'll do the rest.
Features
- Provides a subset of libc functions (e.g. malloc, printf, strcmp, etc).
- Provides an optional tiny (n)curses implementation.
- Provides various small drivers for
- keyboard
- PC speaker
- NVRAM/CMOS access
- serial console
- VGA
- Geode framebuffer
- Reads and parses the coreboot table.
Payloads using libpayload
- coreinfo is a small payload which can display system information such as PCI info, an NVRAM dump, or the coreboot v3 printk buffer.
- GRUB invaders has been ported successfully to libpayload (patch pending).
- tint (a console tetris clone) has been successfully ported to libpayload.
- lxdialog from the Linux kconfig utility has been ported to be usable when linked with libpayload (patch pending).
Downloading and building libpayload
$ svn co svn://coreboot.org/repos/trunk/payloads/libpayload $ cd libpayload $ make menuconfig $ make
Libc Coverage
|
|
Usage Example
hello.c:
#include <libpayload.h> int main(void) { printf("Hello, world!\n"); halt(); return 0; }
Build example:
lpgcc -o hello.elf hello.c
I, the copyright holder of this work, hereby release it into the public domain. This applies worldwide.
In case this is not legally possible: |