Advance Linux Programming

Advance Linux Programming for Application Developer

Description:

This course, explains the best practices of Application programing and debugging skills
using a Host and embedded environment. Unlike most Linux courses, that use hands on
demonstration. This course uses native desktop and an ARM9 EMULATOR that’s a good
way to experiment most the concepts.

Duration: 3 days

Course objectives:

  • Kernel architecture overview
  • Process and memory management
  • The /proc for investigating and controlling processes
  • Process and POSIX Threads
  • Scheduling and CPU Management
  • IPC mechanisms
  • Investing Application
    • Profiling and Code coverage
    • Memory leak and corruption
    • Tracing applications
    • debugging using GDB

Target audience:

Experienced C programmers and developers intending to explore How Linux can be used
is real time and embedded environment

Pre-requisites:

  • Very Good knowledge of C programming
  • Strong awareness on UNIX/Linux commands with GNU tools and build essentials
  • Have undergone the essential embedded Linux programming for Developers or
    has equivalent knowledge

Lab requirements:

  • An internet ready laptop/workstation with high-end configuration (Intel Core i5
    or above with at least 4 GB of RAM) is recommended, with windows or macOS
    with pdf readers,
  • Latest Virtual Box preferred to be pre-Installed on their respective OS. One can
    visit https://www.virtualbox.org/wiki/Downloads and choose their HOST(OS)
    specific package.
  • Participants must ensure that at least 40 GB of free disk-space is available on
    their laptops/workstations – as this is required for installing a pre-configured
    Linux setup as a Virtual Box appliance for hands-on practice session in this
    training program
  • The speaker/trainer would carry the preinstalled Linux disk image
    Participants can also choose to work on an existing Linux environment accessible
    to them with support for root access and ability to fully customize their existing
    setup and reboot them.
  • Whiteboard, markers and scribble pads + pens for participants.
  • A high-resolution (1024×768 or above) LCD Projector with support to connect to
    trainer’s laptop (Apple MacBookPro/Win/Linux
  • Whiteboard + Markers

Detailed Coverage

Day 1

  • Introduction to kernel service layer architecture
  • Process and Threads
    • Multitasking, Multiprocessing, and Multithreading
    • Process Address Map, memory map regions
    • Process security and controls
  • Hierarchy, types, and services
  • The /proc interface
    • The layout
    • Understanding the proc objects
  • Strategy to get the secured information for a particular PID
  • Process programming using OS specific calls
    • Process programming API
    • Multi Threaded programming with PTHREAD API
    • System resources management
  • Linux Scheduling control and programming API
    • Real time SCHED_FIFO, SCHED_RR
    • Timesharing CFS, IDEAL and Batches
  • Affinity control
    • Soft and Hard
    • Configuring the CPU
  • Linux I/O essentials, file systems, secured system calls

Day 2

  • Handling Asynchronous notification using signals
    • Type of signals
    • Registering and controlling events
    • Disabling, Masking, and unmasking Signals
    • Examine the pending signals
    • User defined signals
    • Investigation signals for a running process
  • Inter process communication
    • Pipes and FIFO
      • Redirection
      • Serial buffer management
    • Messages queues using OS based API and POSIX
      • Type based buffer handling
      • Messages with priority
    • Handling I/O mapped and Memory Mapped devices
    • Shared memory using OS based API and POSIX
      • Attaching/Detaching the process for process
      • Using shared page for POSIX
  • Semaphore and Mutex
    • POSIX Semaphore & Pithead based implementation
    • Deadlocks, Priority inversion and controlling
  • Sockets & I/O multiplexing
    • Select/pselect/poll/ppoll/event poll
    • I/O frameworks

Day-3

Application debugging

  • Investigating applications
  • Profiling and Code Coverage
    • Using gprof for profiling C programs
    • Using gcov for code coverage analysis
  • Memory profilers
    • Memory checking and Heap profiling using Valgrind
    • Using electic fence for profiling
    • Using dmalloc and libduma for memory debugging
    • Traces and hooks for heap with signals
    • Tracing for ltrace, mtrace, strace
  • Debugging techniques
    • The gdb architecture
    • Cross debugging and interface
      • Host GDB binary and gdbserver
    • GDB Commands
    • Running program session with GDB
    • Examining the Stack
    • Examining the source files and data
    • Analyzing core dumps
    • Debugging running processes
    • Time traveling and recording
  • Debugging remote applications
    • The gdb architecture
    • Cross debugging and interface
      • Host GDB binary and gdbserver
      • Attaching remote process on host
    • Debug over a QEMU backbone