• Stars
    star
    516
  • Rank 85,693 (Top 2 %)
  • Language
    TeX
  • License
    Other
  • Created over 5 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Bootlin embedded Linux and kernel training materials
How to compile these materials
==============================

First, you may install the packages needed to compile the materials
(example on Ubuntu 22.04):

sudo apt install --no-install-recommends git-core inkscape \
texlive-latex-base texlive-latex-extra texlive-font-utils dia \
python3-pygments texlive-fonts-recommended \
texlive-fonts-extra make texlive-xetex texlive-extra-utils \
fonts-inconsolata fonts-liberation \
xfonts-scalable lmodern texlive-science texlive-plain-generic \
texlive-lang-french

Then, run 'make help' to see what available targets are.

For example:

make full-linux-kernel-slides.pdf
make full-linux-kernel-labs.pdf

Compiling issues
================

 * If the materials stop compiling after upgrading your distro,
   you may have to run "make clean" to get the materials to
   compile again.

   Example case: https://tex.stackexchange.com/questions/352017/miktex-and-beamer-error-beamerendinputifotherversion

Labs formatting guidelines
==========================

 * To create a new lab, the chapter must start with a 'subchapter'
   command, as in:

\subchapter{Bootloader – U-Boot}{Objectives: Set up serial
  communication, compile and install the X-Loader and U-Boot
  bootloaders, use basic U-Boot commands, set up TFTP communication
  with the development workstation.}

 * You can use \section{} and \subsection{} to create sections in your
   lab document.

 * To add some fixed-sized font text (function names, file or
   directory paths, commands) inside a paragraph of normal text, use
   the \code macro as follows:

Blabla. Look in the \code{/usr/bin} directory. Blabla.

   Note that the \code{} macro doesn't require escaping of $ or _
   signs:

You can look for the \code{platform_device_register()} function in the
\code{$HOME/linux/blabla.c} file.

   This macro *MUST* be used instead of {\tt }, because \code{}
   provides proper line wrapping on dashes, slashes and so on, which
   helps in keeping the line of text within the width of the page.

   Note that this macro cannot be used in section titles or chapter
   titles. In this case {\tt } needs to be used (and inside {\tt },
   the _ or $ signs have to be escaped).

 * To add some fixed-size font text as a complete paragraph, use the
   'verbatim' environment:

In order to build the kernel run:

\begin{verbatim}
make blabla_defconfig
make
\end{verbatim}

   Here as well, it does not require escaping of $ or _ signs.

 * To add URLs, use the \url{https://foobar.com} macro. This will
   create a clickable link in the resulting PDF file.

 * If needed, you can locally reduce the size of a
   \begin{verbatim}...\end{verbatim} environment by doing:

\small
\begin{verbatim}
...
\end{verbatim}
\normalsize

   This must be used parsimoniously because changing the font size all
   the time is not very pretty. But since the verbatim environment
   does not do line wrapping, it may sometimes be necessary.

   Note that in addition to \small, you can also use other sizes, see
   https://en.wikibooks.org/wiki/LaTeX/Fonts#Built-in_sizes .

Slides formatting guidelines
============================

  * A new training should start with a file containing the setup of the
    various variables needed such as authors and a slide created using the
    titleframe macro. This new file should be created in the common/ directory
    with the name <training-name>-title.tex

  * Every new chapter should be split in order to allow its possible use in
    other trainings as well. Each new file should contain only one subsection
    and should be named <training-name>-<section-name>-<subsection-name>.tex.
    New sections should be in a separate file named
    <training-name>-<section-name>-title.tex. All the aggregation would be done
    by the Makefile

Syntax Highlighting
===================

The LaTeX package minted is included to have a nice syntax
highlighting and advanced code formatting features. It uses pygments
as backend, so in order to use it, one needs to install the
debian/Ubuntu package python-pygments.

A basic example for C code is:

\begin{minted}{c}
....
\end{minted}

Of course, it can take a lot of options that you can find in the
minted's documentation present at:
http://mirrors.ctan.org/macros/latex/contrib/minted/minted.pdf

Emacs usage in LaTeX
====================

Install the AUCTex package which contains an improved Emacs
environment for editing LaTeX documents:

sudo apt install auctex

In your ~/.emacs.el file, add the following lines:

(load "auctex.el" nil t t)
(require 'latex)
(add-to-list 'LaTeX-verbatim-macros-with-braces "code")
(add-to-list 'LaTeX-verbatim-macros-with-braces "url")

The important point here is that this tells Emacs to consider the
\code{} and \url{} macros as a verbatim macro, so that even if special
characters such as $, _ or % are not escaped inside these macros,
Emacs text colorization will not go crazy.

Nice keyboard shortcuts with AUCTex:

 * C-c RET to insert a macro, or embed the selected text into a
   macro. Very useful to quickly place a few words inside a \code{}
   macro

 * C-c C-e to insert an environment, such as verbatim, or embed the
   selected text into such an environment.

Diagrams
========

The recommended program to do diagrams is Dia:

 apt install dia

When saving a file, please make sure to unselect the "Compressed saved
files" option, so that the .dia files are raw XML files, and not
gzipped compressed files. Having raw XML files is much better for
version control, and will allow, to some extent, merging .dia diagrams
after conflicts.

The fonts to be used are "Latin Modern Sans" for normal text and
"Inconsolata" for the code/paths.

Here are some suggested color couples you can use for the border and
background of boxes and other elements. Using similar colors for all
diagrams will make our training documents much more coherent and nice
to look at.

 * Blue boxes
    borders:    #5CACFF
    background: #ADD8E6

 * Yellowish boxes
    borders:    #D9CB2F
    background: #FFF8A8

 * Grey boxes
    borders:    #868686
    background: #E5E5E5

 * Brownish boxes
    borders:    #A34804
    background: #FFD192

 * Purple boxes
    borders:    #2F004A
    background: #EFB9FF

 * Green boxes
    borders:    #6A8954
    background: #C5E387

 * Red/pink boxes
    borders:    #CC1F1A
    background: #FFACAC

If you want to easily add all these colors to Dia, add the following
fragment to ~/.dia/persistence (or replace the existing
role="color-menu" XML tag):

------------------8<-----------------8<-----------------------------
<dia:list role="color-menu">
 <dia:attribute name="listvalue">
  <dia:string>##5CACFF
#ADD8E6
#D9CB2F
#FFF8A8
#868686
#E5E5E5
#A34804
#FFD192
#2F004A
#EFB9FF
#6A8954
#C5E387
#CC1F1A
#FFACAC#</dia:string>
 </dia:attribute>
</dia:list>
------------------8<-----------------8<-----------------------------

More Repositories

1

elixir

The Elixir Cross Referencer
C
852
star
2

snagboot

Generic recovery and reflashing tool for embedded platforms
Python
204
star
3

toolchains-builder

Shell
83
star
4

simplest-yocto-setup

Working example of a yocto setup without unnecessary complications
BitBake
75
star
5

libva-v4l2-request

LibVA implementation for the Linux Video4Linux2 Request API
C
68
star
6

linux-cedrus

Mainline Kernel repository for the Allwinner VPU reverse engineering effort
C
55
star
7

mali-blobs

Mali OpenGL ES userspace libraries for Allwinner SoCs
C
54
star
8

buildroot-external-st

External Buildroot tree for STMicroelectronics boards configurations
Python
51
star
9

buildroot-toolchains

The fork of Buildroot used for building toolchains.
Makefile
22
star
10

v4l2-request-test

A standalone tool to test the Linux Video4Linux2 Request API
Objective-C
22
star
11

lavabo

Remote control boards in a LAVA setup.
Python
21
star
12

pdf-link-checker

Checks for broken hyperlinks in PDF documents
Python
19
star
13

mali-driver

C
15
star
14

v4l2-hantro-h264-encoder

V4L2 Hantro H264 encoder userspace
C
13
star
15

toolchains-webpage

The webpage of http://toolchains.bootlin.com/
Jinja
11
star
16

cedrus

Code to deal with the Allwinner VPU on top of a mainline kernel
C
11
star
17

buildroot

Makefile
8
star
18

kernel-builder

A simple kernel autobuilder, mostly borrowed from KernelCI's one.
Python
6
star
19

libva-dump

libVA implementation to dump metadata and slices from videos
C
6
star
20

libdrm-sun4i

libdrm with support for Allwinner's MB32 modifier and associated GEM buffer creation
C
5
star
21

spear_usbloader

USB boot image loader for SPEAr SOC
C
4
star
22

buildroot-ci

Makefile
4
star
23

v4l2-cedrus-enc-test

V4L2 cedrus H.264 encoder userspace
C
4
star
24

kvm-manager

Scripts to manage Linux KVM virtual machines
Shell
3
star
25

test_suite

Shell
3
star
26

pcimem

devmem like tool but for PCI resources access from userspace (BAR)
C
3
star
27

lava-server

2
star
28

squashfs-utils

C
2
star
29

custom_tests_tool

Python
2
star
30

ci-scripts

Our CI scripts
Shell
2
star
31

update-wordpress-page

Python
2
star
32

lava-devices-configs

2
star
33

video-scripts

Scripts used by Bootlin to produce videos, in particular encoding to the VP8 and Ogg/Theora formats.
Python
2
star
34

android-training-vendor-ti-beagleboneblack

Makefile
1
star
35

android-training-hardware-ti-sgx

C
1
star
36

android-training-manifest

1
star
37

odf-tools

Various tools for manipulating, checking and converting ODF (LibreOffice) documents
Python
1
star