Book Image

Beaglebone Essentials

By : Rodolfo Giometti
Book Image

Beaglebone Essentials

By: Rodolfo Giometti

Overview of this book

If you are a developer with some hardware or electrical engineering experience who wants to learn how to use embedded machine-learning capabilities and get access to a GNU/Linux device driver to collect data from a peripheral or to control a device, this is the book for you.
Table of Contents (13 chapters)
12
Index

What is a device driver?


A device driver is a special code that interfaces a physical device into the system and exports it to the user-space processes using a well-defined API. In an Unix-like OS, where everything is a file (see the following section), the physical device is represented as a file, and then the device driver implements all the system calls a process can do on a file.

Tip

The difference between a normal function and a system call is just the fact that the latter is mainly executed in the kernel while a function executes in the user space only.

For example, printf() is a function while write() is a system call. The latter (except for a prologue and an epilogue) executes in the kernel space while the former executes in the user space (even if it calls the write() function to actually write its data to the output stream).

The system calls are used to communicate with the peripherals and other processes and to get access to the kernel internals data. This is why a system call triggers...