blob: d35f685fd5b7551726c36d05710b9af50eec1022 [file] [log] [blame]
Uwe Hermann43a800c2008-08-18 18:55:33 +00001-------------------------------------------------------------------------------
2libpayload README
3-------------------------------------------------------------------------------
Jordan Crousef6145c32008-03-19 23:56:58 +00004
Uwe Hermann43a800c2008-08-18 18:55:33 +00005libpayload is a minimal library to support standalone payloads
6that can be booted with firmware like coreboot. It handles the setup
7code, and provides common C library symbols such as malloc() and printf().
8
9Note: This is _not_ a standard library for use with an operating system,
10rather it's only useful for coreboot payload development!
Paul Menzel59e21132017-06-05 12:46:00 +020011See https://www.coreboot.org for details on coreboot.
Uwe Hermann43a800c2008-08-18 18:55:33 +000012
13
14Installation
15------------
16
Paul Menzel0cdaad32018-04-06 11:07:27 +020017 $ git clone https://review.coreboot.org/coreboot.git
Uwe Hermann43a800c2008-08-18 18:55:33 +000018
Paul Menzel72ef8882013-04-04 14:12:26 +020019 $ cd coreboot/payloads/libpayload
Uwe Hermann43a800c2008-08-18 18:55:33 +000020
21 $ make menuconfig
22
23 $ make
24
Asami Doid97591c2019-06-07 16:22:03 +090025 $ make install (optional, will install into ./install per default)
Uwe Hermann43a800c2008-08-18 18:55:33 +000026
Asami Doid97591c2019-06-07 16:22:03 +090027On x86 systems, libpayload will always be 32-bit even if your host OS runs
28in 64-bit, so you might have to install the 32-bit libgcc version.
Uwe Hermann43a800c2008-08-18 18:55:33 +000029On Debian systems you'd do 'apt-get install gcc-multilib' for example.
30
Asami Doid97591c2019-06-07 16:22:03 +090031Run 'make distclean' before switching boards. This command will remove
32your current .config file, so you need 'make menuconfig' again or
33'make defconfig' in order to set up configuration. Default configuration
34is based on 'configs/defconfig'. See the configs/ directory for examples
35of configuration.
36
Uwe Hermann43a800c2008-08-18 18:55:33 +000037
38Usage
39-----
40
41Here'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
51Building the payload using the 'lpgcc' compiler wrapper:
52
53 $ lpgcc -o hello.elf hello.c
54
55Please see the sample/ directory for details.
56
57
58Website and Mailing List
59------------------------
60
Paul Menzela8843de2017-06-05 12:33:23 +020061The main website is https://www.coreboot.org/Libpayload.
Uwe Hermann43a800c2008-08-18 18:55:33 +000062
63For additional information, patches, and discussions, please join the
Paul Menzel59e21132017-06-05 12:46:00 +020064coreboot mailing list at https://www.coreboot.org/Mailinglist, where most
Uwe Hermann43a800c2008-08-18 18:55:33 +000065libpayload developers are subscribed.
66
67
68Copyright and License
69---------------------
70
71See LICENSES.