Course Code: ldd
Duration: 35 hours
Prerequisites:

  • Podstawowa znajomość korzystania z systemu GNU/Linux jako użytkownik końcowy
  • Podstawowa znajomość pracy w powłoce wiersza poleceń
  • Podstawowa wiedza na temat programowania w przestrzeni użytkownika / rozwoju aplikacji
  • Średniozaawansowana znajomość programowania w języku C
  • Zaleca się wcześniejsze uczestnictwo w kursie Architektura systemów GNU/Linux w systemach wbudowanych (mocno zalecane!) i/lub dobre zrozumienie tematów tam omówionych

Overview:

Opis

Ten 5-dniowy kurs szkoleniowy łączy ćwiczenia praktyczne z wykładami, aby zilustrować koncepcje związane z wewnętrznymi mechanizmami jądra GNU/Linux oraz rozwojem sterowników urządzeń. Został zaprojektowany, aby szybko wprowadzić Cię w tematykę. Opisujemy procesy, koncepcje i polecenia niezbędne do pisania sterowników urządzeń GNU/Linux poprzez połączenie teorii i szkolenia praktycznego.

Nie wymyślaj koła na nowo, lecz ucz się od doświadczonego trenera i zdobądź praktyczną wiedzę oraz umiejętność efektywnego jej wykorzystania w swoim własnym projekcie rozwoju systemów wbudowanych.

Dla kogo jest ten kurs?

Osoby zainteresowane lub odpowiedzialne za rozwój lub ocenę sterowników urządzeń GNU/Linux, takie jak inżynierowie oprogramowania, inżynierowie terenowi, menedżerowie (projektów), inżynierowie sprzętu.

Course Outline:

Wprowadzenie

  • krótka historia GNU/Linux
  • licencjonowanie
  • wersjonowanie jądra
  • cykl wydań
  • drzewa jądra
  • główna linia
  • jądro vs. przestrzeń użytkownika
  • mechanizm vs. polityka
  • alternatywy dla sterowników jądra
  • RTOS vs. Linux

Zarządzanie pamięcią

  • Pamięć wirtualna vs. pamięć fizyczna
  • alokacja pamięci w jądrze
  • strony
  • strefy
  • API
  • slab

Łatki jądra

  • cykl życia
  • git
  • źródła jądra
  • tworzenie łatki
  • sprawdzanie łatki
  • naprawa łatki
  • wysyłanie łatki
  • audytowany kod

Moduły jądra

  • pobieranie źródeł jądra
  • konfiguracja/kompilacja/instalacja
  • sterowniki urządzeń (statycznie linkowane, ładowane w czasie wykonywania)
  • init/exit
  • licencjonowanie
  • EXPORT SYMBOL GPL
  • makefile poza drzewem
  • module-init-tools
  • moduł w drzewie jądra
  • Kconfig
  • przekazywanie parametrów
  • sparse

Sterowniki znakowe

  • architektura
  • interfejs użytkownik/jądro
  • podsystem I/O
  • VFS
  • sysfs (urządzenia, magistrala, sterowniki, klasy),
  • kobject/ktype/kset
  • model sterowników jądra Linux
  • pliki urządzeń
  • sterownik znakowy

    • inicjalizacja
    • rejestracja
    • otwarcie, zamknięcie
    • cdev, cdev add, cdev del,...
    • numery major/minor
    • udev, udevmonitor, udevadm

Zaawansowane operacje na sterownikach znakowych

  • ioctl
  • unlocked ioctl
  • compat ioctl
  • interfejs użytkownika
  • interfejs jądra
  • cykl życia procesu
  • uśpienie/blokowanie
  • uśpienie/budzenie
  • kolejka oczekiwania
  • efekt stada
  • poll/select

Debugowanie jądra

  • debugowanie
  • debugowanie jądra

    • wyszukiwanie binarne z git
    • wsparcie debugowania w jądrze
    • printk syslogd, klogd, poziomy logowania, limit szybkości, poziomy debugowania, selektywne podsystemy debugowania
    • debugowanie poprzez zapytania do debugfs
    • debugowanie oops, zgłaszanie oops
    • Magic SysRq Key
    • kgdb/kdb
    • JTAG

Śledzenie

  • gcov
  • lcov
  • oprofile
  • ftrace

    • nop tracer
    • function tracer
    • sched switch tracer
    • function graph tracer
    • dynamic tracer
  • trace-cmd/kernelshark
  • perf
  • LTTng

Przerwania

  • przerwania vs. polling
  • przerwanie
  • sekcje programu
  • powtarzalność
  • zdarzenia
  • obsługa przerwań
  • wspólna obsługa przerwań
  • przepływ przerwań
  • kontrola przerwań

Odraczanie pracy

  • górne/dolne połowy
  • softirqs
  • tasklety
  • kolejki zadań
  • przerwania wątkowe

Współbieżność

  • sekcja krytyczna
  • atomowość
  • warunek wyścigu
  • synchronizacja
  • blokowanie
  • rozwiązania blokujące
  • zakleszczenie
  • rywalizacja
  • co blokować?
  • co można użyć?

    • operacje atomowe
    • spin locks
    • czytelnik-pisarz spin locks
    • semafor
    • semafor binarny
    • mutex
    • czytelnik-pisarz semafor
    • zmienne ukończenia
    • sekwencyjne blokady
    • wyłączenie wywłaszczenia
    • kolejność i bariery

Czas

  • HZ
  • Jiffies
  • duże/małe opóźnienia
  • timery jądra

Wejście/Wyjście sprzętowe

  • Porty I/O
  • Pamięć I/O
  • Jak radzić sobie z efektami ubocznymi dostępu do rejestrów?

Komunikacja użytkownik-jądro

  • put(get)_user()
  • copy to(from)_user()
  • Wejście/Wyjście jądra
  • mapowanie pamięci
  • procfs
  • sysfs
  • debugfs
  • relayfs
  • netlink
  • ioctl

Przenośność

  • rozmiar słowa
  • typy nieprzezroczyste
  • znakowe ze znakiem/bez znaku
  • wyrównanie danych
  • promocja całkowita
  • ponowne wykorzystanie kodu
  • kolejność bajtów
  • zegar systemowy
  • rozmiar strony
  • kolejność instrukcji
  • SMP/wywłaszczenie/wysoka pamięć

O ile nie zaznaczono inaczej, treść i ten program kursu są objęte licencją Uznanie autorstwa-Użycie niekomercyjne-Na tych samych warunkach 4.0 Międzynarodowe (CC BY-NC-SA 4.0).

Sites Published:

United Arab Emirates - Embedded GNU/Linux Kernel Internals and Device Drivers

Qatar - Embedded GNU/Linux Kernel Internals and Device Drivers

Egypt - Embedded GNU/Linux Kernel Internals and Device Drivers

Saudi Arabia - Embedded GNU/Linux Kernel Internals and Device Drivers

South Africa - Embedded GNU/Linux Kernel Internals and Device Drivers

Brasil - Integridade do Kernel GNU/Linux Embarcado e Drivers de Dispositivo

Canada - Embedded GNU/Linux Kernel Internals and Device Drivers

中国 - 嵌入式GNU/Linux内核与设备驱动

香港 - Embedded GNU/Linux Kernel Internals and Device Drivers

澳門 - Embedded GNU/Linux Kernel Internals and Device Drivers

台灣 - Embedded GNU/Linux Kernel Internals and Device Drivers

USA - Embedded GNU/Linux Kernel Internals and Device Drivers

Österreich - Interne Struktur des GNU/Linux-Kernels und Gerätetreiber

Schweiz - Interne Struktur des GNU/Linux-Kernels und Gerätetreiber

Deutschland - Interne Struktur des GNU/Linux-Kernels und Gerätetreiber

Czech Republic - Interní struktura jádra GNU/Linuxu a ovladače zařízení

Denmark - Embedded GNU/Linux Kernel Internals and Device Drivers

Estonia - Embedded GNU/Linux Kernel Internals and Device Drivers

Finland - Embedded GNU/Linux Kernel Internals and Device Drivers

Greece - Εσώτερο Λειτουργικό των Πυρήνων GNU/Linux και Οδηγοί Συσκευών

Magyarország - Beágyazott GNU/Linux Kernel Belső Működése és Eszközmeghajtók

Ireland - Embedded GNU/Linux Kernel Internals and Device Drivers

Luxembourg - Embedded GNU/Linux Kernel Internals and Device Drivers

Latvia - Embedded GNU/Linux Kernel Internals and Device Drivers

España - Integridades internas del kernel y controladores de dispositivos GNU/Linux integrados

Italia - Interni del kernel GNU/Linux e driver di dispositivo

Lithuania - Embedded GNU/Linux Kernel Internals and Device Drivers

Nederland - Inwendige werking van de GNU/Linux-kernel en apparaatstuurprogramma's

Norway - Inne i Linux-kjernen for innbygde systemer og enhetsdrivere

Portugal - Integridade do Kernel GNU/Linux Embarcado e Drivers de Dispositivo

România - Internele Nucleului GNU/Linux și Driverele de Dispozitive

Sverige - Inbyggd GNU/Linux-kärninterna funktioner och enhetsdrivrutiner

Türkiye - Gömülü GNU/Linux Çekirdek İç Yapıları ve Cihaz Sürücüleri

Malta - Embedded GNU/Linux Kernel Internals and Device Drivers

Belgique - Internalités du noyau GNU/Linux et pilotes de périphériques intégrés

France - Internalités du noyau GNU/Linux et pilotes de périphériques intégrés

日本 - 埋め込み GNU/Linux カーネルの内部構造とデバイスドライバ

Australia - Embedded GNU/Linux Kernel Internals and Device Drivers

Malaysia - Embedded GNU/Linux Kernel Internals and Device Drivers

New Zealand - Embedded GNU/Linux Kernel Internals and Device Drivers

Philippines - Embedded GNU/Linux Kernel Internals and Device Drivers

Singapore - Embedded GNU/Linux Kernel Internals and Device Drivers

Thailand - Embedded GNU/Linux Kernel Internals and Device Drivers

Vietnam - Kiến trúc Nhân GNU/Linux Nhúng và Trình điều khiển Thiết bị

India - Embedded GNU/Linux Kernel Internals and Device Drivers

Argentina - Integridades internas del kernel y controladores de dispositivos GNU/Linux integrados

Chile - Integridades internas del kernel y controladores de dispositivos GNU/Linux integrados

Costa Rica - Integridades internas del kernel y controladores de dispositivos GNU/Linux integrados

Ecuador - Integridades internas del kernel y controladores de dispositivos GNU/Linux integrados

Guatemala - Integridades internas del kernel y controladores de dispositivos GNU/Linux integrados

Colombia - Integridades internas del kernel y controladores de dispositivos GNU/Linux integrados

México - Integridades internas del kernel y controladores de dispositivos GNU/Linux integrados

Panama - Integridades internas del kernel y controladores de dispositivos GNU/Linux integrados

Peru - Integridades internas del kernel y controladores de dispositivos GNU/Linux integrados

Uruguay - Integridades internas del kernel y controladores de dispositivos GNU/Linux integrados

Venezuela - Integridades internas del kernel y controladores de dispositivos GNU/Linux integrados

Polska - Wewnętrzne mechanizmy jądra GNU/Linux i sterowniki urządzeń

United Kingdom - Embedded GNU/Linux Kernel Internals and Device Drivers

South Korea - 임베디드 GNU/리눅스 커널 내부 구조 및 장치 드라이버

Pakistan - Embedded GNU/Linux Kernel Internals and Device Drivers

Sri Lanka - Embedded GNU/Linux Kernel Internals and Device Drivers

Bulgaria - Вградени вътрешни принципи на ядрото GNU/Linux и драйвери на устройства

Bolivia - Integridades internas del kernel y controladores de dispositivos GNU/Linux integrados

Indonesia - Embedded GNU/Linux Kernel Internals and Device Drivers

Kazakhstan - Embedded GNU/Linux Kernel Internals and Device Drivers

Moldova - Internele Nucleului GNU/Linux și Driverele de Dispozitive

Morocco - Embedded GNU/Linux Kernel Internals and Device Drivers

Tunisia - Embedded GNU/Linux Kernel Internals and Device Drivers

Kuwait - Embedded GNU/Linux Kernel Internals and Device Drivers

Oman - Embedded GNU/Linux Kernel Internals and Device Drivers

Slovakia - Embedded GNU/Linux Kernel Internals and Device Drivers

Kenya - Embedded GNU/Linux Kernel Internals and Device Drivers

Nigeria - Embedded GNU/Linux Kernel Internals and Device Drivers

Botswana - Embedded GNU/Linux Kernel Internals and Device Drivers

Slovenia - Embedded GNU/Linux Kernel Internals and Device Drivers

Croatia - Embedded GNU/Linux Kernel Internals and Device Drivers

Serbia - Embedded GNU/Linux Kernel Internals and Device Drivers

Bhutan - Embedded GNU/Linux Kernel Internals and Device Drivers

Nepal - Embedded GNU/Linux Kernel Internals and Device Drivers

Uzbekistan - Embedded GNU/Linux Kernel Internals and Device Drivers

US Government - Embedded GNU/Linux Kernel Internals and Device Drivers