Uwe Hermann | 43a800c | 2008-08-18 18:55:33 +0000 | [diff] [blame] | 1 | ------------------------------------------------------------------------------- |
| 2 | libpayload README |
| 3 | ------------------------------------------------------------------------------- |
Jordan Crouse | f6145c3 | 2008-03-19 23:56:58 +0000 | [diff] [blame] | 4 | |
Uwe Hermann | 43a800c | 2008-08-18 18:55:33 +0000 | [diff] [blame] | 5 | libpayload is a minimal library to support standalone payloads |
| 6 | that can be booted with firmware like coreboot. It handles the setup |
| 7 | code, and provides common C library symbols such as malloc() and printf(). |
| 8 | |
| 9 | Note: This is _not_ a standard library for use with an operating system, |
| 10 | rather it's only useful for coreboot payload development! |
Paul Menzel | 59e2113 | 2017-06-05 12:46:00 +0200 | [diff] [blame] | 11 | See https://www.coreboot.org for details on coreboot. |
Uwe Hermann | 43a800c | 2008-08-18 18:55:33 +0000 | [diff] [blame] | 12 | |
| 13 | |
| 14 | Installation |
| 15 | ------------ |
| 16 | |
Paul Menzel | 0cdaad3 | 2018-04-06 11:07:27 +0200 | [diff] [blame] | 17 | $ git clone https://review.coreboot.org/coreboot.git |
Uwe Hermann | 43a800c | 2008-08-18 18:55:33 +0000 | [diff] [blame] | 18 | |
Paul Menzel | 72ef888 | 2013-04-04 14:12:26 +0200 | [diff] [blame] | 19 | $ cd coreboot/payloads/libpayload |
Uwe Hermann | 43a800c | 2008-08-18 18:55:33 +0000 | [diff] [blame] | 20 | |
| 21 | $ make menuconfig |
| 22 | |
| 23 | $ make |
| 24 | |
Asami Doi | d97591c | 2019-06-07 16:22:03 +0900 | [diff] [blame] | 25 | $ make install (optional, will install into ./install per default) |
Uwe Hermann | 43a800c | 2008-08-18 18:55:33 +0000 | [diff] [blame] | 26 | |
Asami Doi | d97591c | 2019-06-07 16:22:03 +0900 | [diff] [blame] | 27 | On x86 systems, libpayload will always be 32-bit even if your host OS runs |
| 28 | in 64-bit, so you might have to install the 32-bit libgcc version. |
Uwe Hermann | 43a800c | 2008-08-18 18:55:33 +0000 | [diff] [blame] | 29 | On Debian systems you'd do 'apt-get install gcc-multilib' for example. |
| 30 | |
Asami Doi | d97591c | 2019-06-07 16:22:03 +0900 | [diff] [blame] | 31 | Run 'make distclean' before switching boards. This command will remove |
| 32 | your current .config file, so you need 'make menuconfig' again or |
| 33 | 'make defconfig' in order to set up configuration. Default configuration |
| 34 | is based on 'configs/defconfig'. See the configs/ directory for examples |
| 35 | of configuration. |
| 36 | |
Uwe Hermann | 43a800c | 2008-08-18 18:55:33 +0000 | [diff] [blame] | 37 | |
| 38 | Usage |
| 39 | ----- |
| 40 | |
| 41 | Here's an example of a very simple payload (hello.c) and how to build it: |
| 42 | |
| 43 | #include <libpayload.h> |
| 44 | |
| 45 | int main(void) |
| 46 | { |
| 47 | printf("Hello, world!\n"); |
| 48 | return 0; |
| 49 | } |
| 50 | |
| 51 | Building the payload using the 'lpgcc' compiler wrapper: |
| 52 | |
| 53 | $ lpgcc -o hello.elf hello.c |
| 54 | |
| 55 | Please see the sample/ directory for details. |
| 56 | |
| 57 | |
| 58 | Website and Mailing List |
| 59 | ------------------------ |
| 60 | |
Paul Menzel | a8843de | 2017-06-05 12:33:23 +0200 | [diff] [blame] | 61 | The main website is https://www.coreboot.org/Libpayload. |
Uwe Hermann | 43a800c | 2008-08-18 18:55:33 +0000 | [diff] [blame] | 62 | |
| 63 | For additional information, patches, and discussions, please join the |
Paul Menzel | 59e2113 | 2017-06-05 12:46:00 +0200 | [diff] [blame] | 64 | coreboot mailing list at https://www.coreboot.org/Mailinglist, where most |
Uwe Hermann | 43a800c | 2008-08-18 18:55:33 +0000 | [diff] [blame] | 65 | libpayload developers are subscribed. |
| 66 | |
| 67 | |
| 68 | Copyright and License |
| 69 | --------------------- |
| 70 | |
| 71 | See LICENSES. |