Chapter 3. C Compiler, Device Drivers, and Useful Developing Techniques
In the previous chapter, we saw how to use the serial console to manage our developer kits and how it can be used to manage the bootloader too. Also, we introduced some device drivers to communicate with the host through a USB cable, and we installed a Debian OS, which is a collection of files in a filesystem, the main and the first filesystem that our embedded systems mount and boot.
In this chapter, we will focus our attention on the C compiler (with its counterpart, the cross-compiler). You will also learn when to use the native or cross-compilation and the differences between them.
Then, we'll see some kernel stuff used later in this book (configuration, recompilation, and the device tree). We'll also look a bit deeper at the device drivers, how they can be compiled, and how they can be put into a kernel module (that is kernel code that can be loaded at runtime). This is because starting from the next chapter, we'll present different kinds of computer peripherals, and for each of them, we'll try to explain how the corresponding device driver works, starting from the compilation stage through the configuration until the final usage. As an example, we'll try to implement a simple driver in order to give you some interesting points of view and some simple advice about kernel programming (which is not covered in this book!).
We will present the root filesystem's internals and spend some words about a particular root filesystem that can be very useful during the early developing stages – the network filesystem. As the final step, we'll propose the usage of an emulator in order to execute a complete target machine's Debian distribution on a host PC.
This chapter still is part of the introduction to this book. Experienced developers who already know these topics well may skip this chapter, but my suggestion is to read the chapter anyway in order to discover which developing tools will be used in the book and, maybe, some new technique to manage your programs.