Linux Embarcado com
Raspberry Pi
DevFest Sul de Minas
Season 2018
Matheus Castello
Slide 2
Slide 2 text
Who I am?
Matheus de Barros Castello
27 year old, BS in Computer Science
Embedded SW Engineer
Linux Kernel Developer - v4.18 contributions
Maker Enthusiast in Spare Time
“YouTuber”
Slide 3
Slide 3 text
Parceiros
Slide 4
Slide 4 text
Agenda
O que vamos fazer?
Slide 5
Slide 5 text
Conheça seu Hardware
Raspberry Pi 3B
BCM2837
B8132B4PB
BCM43438
SD Card
GPIO
LAN9514
HDMI
USB
Ethernet
PAM2306
Micro USB
Power
Slide 6
Slide 6 text
https://www.raspberrypi.org/documentation/hardware/raspberrypi/
Conheça seu Hardware
Datasheet & Documentação
ARM
IRAM
64KB ~ 128KB
GPU
FIRTS LEVEL BL0 - ROM (SOC)
SECOND PROGRAM LOADER SPL
bootcode.bin
THIRD STAGE BOOTLOADER
U-Boot
Processo de Boot
Linux Embarcado ARM
Slide 9
Slide 9 text
Bootloader
U-BOOT
Slide 10
Slide 10 text
Bootloader
ARM Linux Kernel Boot
Slide 11
Slide 11 text
Bootloader
U-Boot Enviroment Variables
Slide 12
Slide 12 text
DRAM
1GB
IRAM
64KB ~ 128KB
ARM
GPU
FIRTS LEVEL BL0 - ROM (SOC)
SECOND PROGRAM LOADER SPL
bootcode.bin
THIRD STAGE BOOTLOADER
U-Boot
BOOT KERNEL
Device Tree Binary - Kernel Image
ROOTFS
init - systemd
Processo de Boot
Linux Embarcado ARM
Slide 13
Slide 13 text
24,766,703 LINES OF CODE
1681 DEVELOPERS INVOLVED IN v4.13
13,006 PATCHES
Kernel Linux
O Kernel em Alguns Números
Slide 14
Slide 14 text
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Kernel Linux
Linus Torvalds Git Tree
Slide 15
Slide 15 text
LTS or Stable
New Product
Board Support Package
Kernel Linux
Kernel Linux on Market - Board Support Package (BSP)
Slide 16
Slide 16 text
Application (Aka Distro)
C Library (glibc, bionic)
KERNEL
Architecture-Dependent Kernel Code
System Call Interface
KERNEL SPACE
USER SPACE
Kernel Linux
Linux Distributions
Slide 17
Slide 17 text
Kernel Linux
Compile Kernel Linux - Toolchain
1. Computer with Linux Distro
2. git
3. Cross Compile toolchain
Slide 18
Slide 18 text
Kernel Linux
Compile Kernel Linux - Your Version
make command
configura build para arquitetura ARM
define cross compile toolchain
defines configs for my board
Slide 19
Slide 19 text
Kernel Linux
Compile Kernel Linux - Your Version
compressed kernel image
build kernel modules
build device tree source files
use x threads to build
Slide 20
Slide 20 text
Kernel Linux
Compile Kernel Linux - Kconfig
Slide 21
Slide 21 text
Kernel Linux
Compile Kernel Linux - Makefile
• Cada diretorio pode ter seu próprio Makefile
• Makefile tem regras para compilar o código
• Makefile ira compilar opções configuradas no .config
Slide 22
Slide 22 text
Kernel Linux
Configurando GPIO
Device Tree
Device Driver GPIOD API