b3f7ffc12bbc18c4383d46d74639cf72b8514147
[coreboot.git] / payloads / libpayload / README
1 -------------------------------------------------------------------------------
2 libpayload README
3 -------------------------------------------------------------------------------
4
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!
11 See http://coreboot.org for details on coreboot.
12
13
14 Installation
15 ------------
16
17  $ svn co svn://coreboot.org/repos/trunk/payloads/libpayload
18
19  $ cd libpayload
20
21  $ make menuconfig
22
23  $ make
24
25  $ sudo make install (optional, will install into /opt per default)
26
27 As libpayload is for 32bit x86 systems only, you might have to install the
28 32bit libgcc version, otherwise your payloads will fail to compile.
29 On Debian systems you'd do 'apt-get install gcc-multilib' for example.
30
31
32 Usage
33 -----
34
35 Here's an example of a very simple payload (hello.c) and how to build it:
36
37  #include <libpayload.h>
38
39  int main(void)
40  {
41      printf("Hello, world!\n");
42      return 0;
43  }
44
45 Building the payload using the 'lpgcc' compiler wrapper:
46
47  $ lpgcc -o hello.elf hello.c
48
49 Please see the sample/ directory for details.
50
51
52 Website and Mailing List
53 ------------------------
54
55 The main website is http://www.coreboot.org/Libpayload.
56
57 For additional information, patches, and discussions, please join the
58 coreboot mailing list at http://coreboot.org/Mailinglist, where most
59 libpayload developers are subscribed.
60
61
62 Copyright and License
63 ---------------------
64
65 See LICENSES.
66