Budapest University of Technology and Economics, Faculty of Electrical Engineering and Informatics

    címtáras azonosítással

    vissza a tantárgylistához   nyomtatható verzió    

    Embedded Linux and its Platforms

    A tantárgy neve magyarul / Name of the subject in Hungarian: Beágyazott Linux és platformjai

    Last updated: 2022. október 18.

    Budapest University of Technology and Economics
    Faculty of Electrical Engineering and Informatics


    Course ID Semester Assessment Credit Tantárgyfélév
    VIMIAC19 5 2/2/0/v 5  
    3. Course coordinator and department Dr. Kovácsházy Tamás,
    4. Instructors

    Dr. Kovácsházy, Tamás associate professor, MIT

    Szántó, Péter master lecturer, MIT
    5. Required knowledge Programming C/C++, Microcontroller Based Systems, Computer Architectures, Operating Systems, Computer Networks
    6. Pre-requisites

    Embedded Software Development

    Microcontroller Based Systems
    7. Objectives, learning outcomes and obtained knowledge

    The primary goal of the course is to introduce students to the details of embedded Linux application (user-space) development, including platform selection. In terms of platforms, we touch on the classic PC (x86) platform, but we mainly focus on modern heterogeneous architecture system chips (SoC) and the FPGA platform.

    We describe the possibilities of the embedded Linux user-space software, the development process, the typical basic tasks, e.g. command line and configuration processing, program execution and lifecycle management details (systemd), parallel and real-time execution (in multicore and heterogeneous environments). In addition, the file system and network management will also be introduced at an introductory level.

    We cover the video subsystem of Linux (V4L2), high-level solutions supporting hardware-accelerated image and video processing (GStreamer, FFmpeg, OpenCV), and the programming possibilities of parallel execution units (graphics processors, FPGAs) (OpenCL, CUDA).

    We introduce the typical structure of complex, heterogeneous System-on-Chip (SoC) solutions (e.g. TI AM3x/4x/5x/6x, NXP i.MXx, NVIDIA Jetson), reconfigurable SoCs (e.g. Xilinx MPSoC, Versal) and their architecture. We present the design of the software environment of reconfigurable hardware, as well as the possibilities of unique, hardware-accelerated application development.
    8. Synopsis

     Synopsis of lectures:

    1. Introduction to embedded Linux, the structure and platforms of Linux (SoC, FPGA, etc.), SW execution model and memory management (virtual storage management and its consequences), possibilities and consequences of managing peripherals in Linux (user- and kernel-space).

    2. Using the Shell. Basics of Linux programs, command line and configuration management. File system and its usage, including /proc, /sys, etc. file systems. Using a serial port (UART) in a programmed way.

    3. Scheduler,  influencing the scheduler, real-time scheduling. Use of processes and threads and their consequences. Samples of event-driven programming (select, poll, epol). Basics of system startup and process management (systemd and its alternatives).

    4. Mutual exclusion, communication and synchronization in Linux. Solutions for shared memory (between threads running in the context of a process). Mutex, readers-writer lock, user-space spinlock, conditional variable, and their use.

    5. Inter-process communication (IPC) at low level and high level (DBUS). Event management, pipelines, shared memory between processes and its use, file locking, DBUS basics.

    6. Subsystems suitable for managing embedded peripherals, a brief introduction to the Device Tree. GPIO management in Linux and the impact of programming models on performance. A/D and D/A management, I2C, SPI and CAN management in Linux, construction of related subsystems.

    7. User-space drivers, USB management and TUN/TAP in user mode. Accessing memory-mapped peripherals in user mode, advantages and disadvantages.

    8. Low-level (socket) and high-level (HTTP, etc.) network management, intermediate layers (Middleware).

    9. Heterogeneous architecture support, task scheduling and communication with external HW accelerators (real-time cores, AI acceleration, OpenCV acceleration with example, etc).

    10. Multimedia subsystem of Linux: Video for Linux (V4L2). Overview of multimedia frameworks: Gstreamer, FFmpeg.

    11. SoC, concept, characteristic structure. Fixed function and programmable hardware units, their integration into the system. Construction of GPUs.

    12. Programming model of heterogeneous systems: OpenCL and CUDA.

    13. Characteristics of FPGA-based SoC devices (Intel, Lattice, Xilinx). Description of processor subsystem, programmable logic and other system elements. High-level description of FPGA-based accelerators: OpenCL and HLS.


    Synopsis of exercises:

    Exercise 1: Setup of the Development System

    Exercise 2: Shell programming and command line management, serial port management with termio.

    Exercise 3: Creating processes and threads, influencing schedule (RT and CPU affinity), process management with systemd

    Exercise 4: Select and poll/epol based complex SW architectures

    Exercise 5: Mutual exclusion and synchronization in shared memory, use of IPC solutions

    Exercise 6: GPIO (with GPIO user-space library and mapped to memory) management in a user program, I2C and SPI management (writing a user-space's driver and using an existing kernel driver)

    Exercise 7: User-space USB peripheral management (periphery implemented on MCU, with ready-made code and communication protocol specification)

    Exercise 8: Socket programming, HTTP client programming (downloading information from a program from a server)

    Exercise 9: Remoteproc and rpmsg in practice, on an OpenCV heterogeneous system chip (remoteproc and rpmsg at high-level)

    Exercise 10: Using the V4L2 user space API.

    Exercise 11: Using Gstreamer.

    Exercise 12: OpenCL/CUDA basics: host code and simple kernel.

    Exercise 13: OpenCL/CUDA: kernel programming.

    9. Method of instruction Lecture with theoretical material and practical demonstration of materials and exercises.
    10. Assessment

    In lecture term:

    Participation in the exercises: We check the participation in the exercises, participation in at least 2/3 of the exercises is mandatory in order to be able to get a signature and take the exam.

    Completion of homework: Completion of the homework to an acceptable level is required to get a signature and being able to take the exam.

    The homework is to be created as a functional system using embedded Linux. The assignment specification must be submitted by the end of the 4th teaching week. Design of the prototype showing key concepts can be presented until Week 8. The complete, functional task with documentation can be submitted at the end of the lecture term.

    In examination period:

    Oral exam

    11. Recaps

    Practices cannot be repeated, at least 2/3 of them must be attended (9 in the case of 13 or 14 practices, 8 in the case of 12, the actual number depends on the schedule of the semester).

    The specification can be submitted until the 8th week of the lecture term, and the prototypes showing the designs and key concepts of the homework can be submitted until the 14th week of the lecture term. The submission of the final homework can be made during the repetition week, if the preliminary documents (specification and prototype) have been handed in according to the replacement conditions specified for them.

    Homework cannot be replaced by an exam.

    12. Consultations

    Consultations with lecturers and practice leaders are possible upon request at a pre-arranged time.

    13. References, textbooks and resources W. Richard Stevens (Author), Stephen A. Rago, „Advanced Programming in the UNIX Environment (3rd Edition) (Addison-Wesley Professional Computing Series, 2013.
    Frank Vasquez, Chris Simmonds, "Mastering Embedded Linux Programming", ‎ Packt Publishing; 3rd ed. edition, 2021.
    14. Required learning hours and assignment
    Kontakt óra56
    Félévközi készülés órákra0
    Felkészülés zárthelyire0
    Házi feladat elkészítése30
    Kijelölt írásos tananyag elsajátítása20
    15. Syllabus prepared by

    Dr. Kovácsházy, Tamás associate professor, MIT

    Szántó, Péter master lecturer, MIT