Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 3.65 KB

Building-Embedded-Linux.md

File metadata and controls

39 lines (26 loc) · 3.65 KB

Back | Next | Contents
Building Embedded Linux - Full Custom

The Basics

Summary

We will look into building a fully functional embedded linux OS for the DE10-Nano. There are several images available online, but what's the fun in that eh? 😄 It's more fun to build our own linux OS from scratch.

Yocto or Full Custom?

There are a few ways to build Embedded Linux and you may have heard of Yocto and OpenEmbedded thrown about a lot. Yocto uses a lot of the configuration from OpenEmbedded (called recipes) and basically gives you a nice polished version of Linux that you can use. Yocto makes it really convenient to build a working Linux OS, that is, once you get over the steep learning curve of Yocto (think days, not weeks). Only after you understand the basics of Yocto and have worked with it for a while will you really appreciate it and what it does for you. However, one key thing to remember about Yocto is that it's meant for manufacturers to build a limited version of the OS that does exactly what it needs to and nothing more. It is not a general purpose Linux OS like Debian. For example, if you build routers or microwaves that run Linux which the end user will most likely never interact with, then Yocto is great. But for a hobbyist like me, that's a no go. I want to play with my DE10-Nano and so I chose to go with a full-fledged Debian Linux.

But this means that we have to take care of everything ourselves. Yocto can be configured to auto-build the Bootloader with the SPL, the Kernel, the rootFS and generate a nice sdcard.img file for you to just burn onto your SD Card. We get none of those benefits with our Debian build, we'll just have to do everything ourselves.

What do we need for Embedded Linux?

There are a few steps we need to go through to build a working embedded linux OS:

  • Device ROM - Every embedded device, including the DE10-Nano, has some instructions that get executed as soon as the device gets powered on. These instructions point the device to read the preloader binary from a specific storage location such as SD Card, eMMC etc. There's nothing for us to do here, it's a ROM.
  • Preloader - The preloader is a binary that is provided by the manufacturer which in our case is Intel/Altera. This does some basic setup before it hands over to the Bootloader. In our case, we'll have the Preloader combined with the bootloader.
  • Bootloader - The bootloader does some hardware initialization before it hands over to the Kernel to initialize the OS.
  • Kernel - The kernel is the heart of the OS and contains all the information about the hardware on the board.
  • RootFS - The root filesystem is the location where we work and write programs etc.

Next | Building the Universal Bootloader (U-Boot)
Back | Overview

Building Embedded Linux - Full Custom | Table of Contents