Linux Kernel University Course∗
Programme Details∗
-
Intro. Linux: обзор, установка, настройка. Файловая система. Командная оболочка. Утилиты. Bash: command line, shell scripting.
-
Bash: advanced shell scripting, special variables, operators, functions, signals, debugging.
-
Git: main rules, commands, branching, merging, rebase, project workflow.
-
C Programming in Linux. GCC, CLANG. Develop and debug code. Creating a shared and static library. Linux kernel coding style.
-
Writing Secure Code in C. CERT C Coding Standard. Make: Overview, Running, Rules, Variables, Options, Targets, Conditionals.
-
ARM architecture overview. ST32F4xx. GlobalLogic StarterKit.
-
Data input/output. Serial interfaces.
-
Accelerometer (LIS302DL). LCD 1602 (HD44780).
-
Linux kernel: overview, structure, building, installing.
-
Виртуальная файловая система. Программный интерфейс. Ресурсы.
-
Модули. Зависимости. Загрузка/выгрузка. Диагностика. Отладка.
-
Драйвер символьного устройства. Назначение. Различия. Major и minor значения. Основные операции. Порядок инициализации. IOCTLs.
-
Board Configuration. Device Tree. ACPI.
-
Time Management.
-
Memory Management.
-
Interrupts Handling.
-
Concurrency and Synchronization.
Development Tools∗
- GNU Compiler Collection.
- Clang в составе LLVM (Ubuntu packages, download page). Удобные инструменты: LeakSanitizer, scan-build, ClangFormat.
- Cppcheck.
- Valgrind.
- Git.
- GitLab.
References∗
Linux∗
- The Linux Kernel documentation.
- Разделы и файловые системы Linux.
- Стандарт иерархии файловой системы.
- Специальная файловая система - procfs.
- Стандартные права Unix.
- Bash.
- Искусство программирования на языке сценариев командной оболочки.
- Стандартные потоки ввода-вывода.
- Перенаправление ввода-вывода.
- Разработка модулей ядра Linux.
- Отладка в ядре. Общие положения.
- Отладка в ядре. Практические советы.
Git∗
- Git Reference Manual.
- Pro Git book.
- Git How To
- Git - Tutorial.
- The 11 Rules of GitLab Flow.
- Introduction to GitLab Flow.
- Setting Up Git.
C Programming Language∗
- Wiki. ANSI C.
- ISO/IEC 9899:1999 - Standard for Programming Language C (C99). The latest draft.
- ISO/IEC 9899:2011 - Standard for Programming Language C (C11). The latest draft.
- ISO/IEC 9899:2018 - Standard for Programming Language C (С17/C18). The latest draft.
- ISO/IEC 9899:yyyy - Standard for Programming Language C (C2x). The latest draft.
- SEI CERT C Coding Standard.
- C Reference.
- GNU Make Manual.
- Making Code More Secure with GCC: Part 1, Part 2.
GlobalLogic StarterKit∗
- BSP for GlobalLogic Starter Kit.
- STM32F4Discovery Schematic.
- GL StarterKit Schematic.
- STM32CubeIDE + GL StarterKit Getting Started.
- Getting started with STM32CubeF4 MCU Package for STM32F4 Series.
- LIS3DSH. MEMS digital output motion sensor: ultra-low-power high-performance three-axis "nano" accelerometer.
- LSM9DS1. iNEMO inertial module: 3D accelerometer, 3D gyroscope, 3D magnetometer.
- STM32F103.
- STM32F40x.
Presentations∗
- Git introduction.
- Shell scripting. Bash. Pipelines.
- Make.
- Обзор архитектуры ARM. ST32F407. STM32F4DISCOVERY. Video: STM32F103 Getting Started.
- Data Input/Output Serial Interfaces.
- MEMS.
- Kernel Overview and Modules.
- Kernel Building.
- Kernel Module Interfaces.
- Orange Pi.
- Device Tree.
- ACPI.
- Time Management.
- MPU6050.
- Memory Management and Allocators.
- ST7735 TFT Display SPI (User Manual).
- SSD1306 OLED Display I2C.
- Interrupts Handling.
- Concurrency and Synchronization (1, 2).
Examples∗
Practice Tasks∗
Exercises | Tasks | Details |
---|---|---|
Exercise #1 | Task #1 | Bash: command line, shell scripting |
Exercise #2 | Task #2 | Git: main rules, commands, branching, merging |
Exercise #3 | Task #3 | C Programming in Linux. GCC, CLANG. Linux kernel coding style |
Exercise #4 | ARM architecture overview. ST32F4xx. GlobalLogic StarterKit | |
Exercise #5 | Task #4 | Data input/output. Serial interfaces |
Exercise #6 | Accelerometer (LIS302DL). LCD 1602 (HD44780). Example | |
Exercise #7 | Linux kernel: overview, structure, building, installing | |
Exercise #8 Exercise #9 | Task #5 | Виртуальная файловая система. Программный интерфейс. Ресурсы Examples: procfs, sysfs |
Exercise #10 | Task #6 | Драйвер символьного устройства |
Exercise #11 | Board Configuration. Device Tree. ACPI | |
Task #7 | Time Management | |
Exercise #12 | Task #8 | Memory Management |
Exercise #13 | Interrupts Handling | |
Exercise #14 | Task #9 | Concurrency and Synchronization |
Notes∗
Set the Proxy for APT on Ubuntu∗
- Create
proxy.conf
:
sudo touch /etc/apt/apt.conf.d/proxy.conf
- Add the following lines:
Acquire {
HTTP::proxy "http://172.17.10.2:3128";
HTTPS::proxy "http://172.17.10.2:3128";
}
Configure Git∗
# Set user name and email:
git config --global user.name "Name Surname"
git config --global user.email "mailbox@example.com"
# Set Nano as the default text editor:
git config --global core.editor "nano"
# Configure a global proxy if all access to all repos require this proxy:
git config --global http.proxy "172.17.10.2:3128"
# Unset a proxy
git config --global --unset http.proxy
Commit Requirements∗
- Use signature when committing, this will be automatically done by the
git commit -s
(name needs to be set in~/.gitconfig
). - No more than 72 characters on line (use your signature string as a basic ruler).
- Empty line between title and description and between description and signature.
-
Commit title should be like: Topic: Action the_rest_title_text
- Topic describes the area of changes, e.g.
Lesson1:
orLCD:
. - Action should start from capital letter, e.g.
Add
,Fix
,Implement
(notadded
,implemented
). -
The whole title should give enough info about the commit when using
git log --oneline
-
No dot at the end of the title.
- Topic describes the area of changes, e.g.
-
Commit description should describe why and how it was done, and not what was done (this is visible in diff).
-
For example, a bad description:
Changed short to int -
The correct one should be:
Moved to a bigger data type because of overflow in some corner cases
-
Description is not needed in the "title says it all" cases.
-
Branch Requirements∗
- Use feature branches, no direct commits on master.
- Always create branches even for single-commit changes.
- Always check your code for code style compliance.
- Branch at each commit should be buildable and working.
- Pushed commits are never rebased.
How to become a Git/Lab/Hub master
- Create a Git repository for every new project.
- Create a new branch for every new feature.
- Use merge/pull requests to merge code to Master.