Dev/Embedded/FromScratch

From Embeded Linux (and more) Wiki by Nathael
< Dev‎ | Embedded
Revision as of 13:41, 6 December 2024 by Drizzt (talk | contribs) (Created page with "== Introduction == First of all, building your own system image for your board is a good idea.<br /> This may feel a little bit confusing or difficult at first, but you'll find most information here and across this Wiki. It may not be exhaustive or up-to-date, but you'll have all the basics.<br /> '''Building your own images is really important.''' It means that : * You have access to all the sources * You do not depend on others to get what you want, update, or fix yo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Introduction

First of all, building your own system image for your board is a good idea.
This may feel a little bit confusing or difficult at first, but you'll find most information here and across this Wiki. It may not be exhaustive or up-to-date, but you'll have all the basics.

Building your own images is really important.

It means that :

  • You have access to all the sources
  • You do not depend on others to get what you want, update, or fix your system
  • You will learn a lot

What do you need

In order to build your own system image you will need a few things :

- A system running a Linux based distribution. It will be your "host" or "development" system. (Well, the "Linux based" is not mandatory, but it's the one I use).

I'm using a Devuan GNU/Linux system running on a x86_64 computer, but there are alternatives out there, for the distribution as well as for the hardware.
It's best if it has some powerfull processors and plenty of available RAM and storage, but even the smallest system will do the job, it will only take more time.

- A (cross-)compiler toolchain. You'll find (most of) the information related to this part on my page dedicated to cross-compilation.
- A way to fetch the sources of course.
- A target system to run the binaries you'll build. Well you certainly have one, or you'll not be here, though it is also possible to use an emulator on your development system.
- A way to connect to your target's serial console. It may be possible to do it differently, but it's way easier to have a serial link to connect to the system console (UART), and I'll consider you are using this solution.
- Some time, curiosity and will. It's not very difficult, but you may enconter some problem as the systems you'll use are in constant evolution and may not behave the same as when I wrote these lines.

System content

All system images can be split in three parts :

  • The bootloader
  • The Linux kernel
  • The userspace

These three parts may be split further, but it's the basics.

Bootloader

Linux Kernel

Userspace