2
1

introduction.txt 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. About Buildroot
  2. ===============
  3. Buildroot is a set of Makefiles and patches that allows you to easily
  4. generate a cross-compilation toolchain, a root filesystem and a Linux
  5. kernel image for your target. Buildroot can be used for one, two or
  6. all of these options, independently.
  7. Buildroot is useful mainly for people working with embedded systems.
  8. Embedded systems often use processors that are not the regular x86
  9. processors everyone is used to having in his PC. They can be PowerPC
  10. processors, MIPS processors, ARM processors, etc.
  11. A compilation toolchain is the set of tools that allows you to compile
  12. code for your system. It consists of a compiler (in our case, +gcc+),
  13. binary utils like assembler and linker (in our case, +binutils+) and a
  14. C standard library (for example
  15. http://www.gnu.org/software/libc/libc.html[GNU Libc],
  16. http://www.uclibc.org/[uClibc] or
  17. http://www.fefe.de/dietlibc/[dietlibc]). The system installed on your
  18. development station certainly already has a compilation toolchain that
  19. you can use to compile an application that runs on your system. If
  20. you're using a PC, your compilation toolchain runs on an x86 processor
  21. and generates code for an x86 processor. Under most Linux systems, the
  22. compilation toolchain uses the GNU libc (glibc) as the C standard
  23. library. This compilation toolchain is called the "host compilation
  24. toolchain". The machine on which it is running, and on which you're
  25. working, is called the "host system". The compilation toolchain is
  26. provided by your distribution, and Buildroot has nothing to do with it
  27. (other than using it to build a cross-compilation toolchain and other
  28. tools that are run on the development host).
  29. As said above, the compilation toolchain that comes with your system
  30. runs on and generates code for the processor in your host system. As
  31. your embedded system has a different processor, you need a
  32. cross-compilation toolchain - a compilation toolchain that runs on
  33. your host system but generates code for your target system (and target
  34. processor). For example, if your host system uses x86 and your target
  35. system uses ARM, the regular compilation toolchain on your host runs on
  36. x86 and generates code for x86, while the cross-compilation toolchain
  37. runs on x86 and generates code for ARM.
  38. Even if your embedded system uses an x86 processor, you might be
  39. interested in Buildroot for two reasons:
  40. * The compilation toolchain on your host certainly uses the GNU Libc
  41. which is a complete but huge C standard library. Instead of using
  42. GNU Libc on your target system, you can use uClibc which is a tiny C
  43. standard library. If you want to use this C library, then you need a
  44. compilation toolchain to generate binaries linked with it. Buildroot
  45. can do that for you.
  46. * Buildroot automates the building of a root filesystem with all
  47. needed tools like busybox. That makes it much easier than doing it
  48. by hand.
  49. You might wonder why such a tool is needed when you can compile +gcc+,
  50. +binutils+, +uClibc+ and all the other tools by hand. Of course doing
  51. so is possible but, dealing with all of the configure options and
  52. problems of every +gcc+ or +binutils+ version is very time-consuming
  53. and uninteresting. Buildroot automates this process through the use
  54. of Makefiles and has a collection of patches for each +gcc+ and
  55. +binutils+ version to make them work on most architectures.
  56. Moreover, Buildroot provides an infrastructure for reproducing the
  57. build process of your kernel, cross-toolchain, and embedded root
  58. filesystem. Being able to reproduce the build process will be useful
  59. when a component needs to be patched or updated or when another person
  60. is supposed to take over the project.