This article presents a comprehensive staged learning path for Linux, progressing from installation and basic commands through system administration and kernel development prerequisites, accompanied by an extensive curated list of essential books covering software engineering fundamentals.
This article explains embedded systems as specialized computers embedded in devices like washing machines, cars, and smartwatches, covering their hardware components, software architectures, real-time requirements, development tools, and emerging edge AI applications.
This extensive article explains Linux memory management fundamentals, covering physical and virtual memory, allocation and release mechanisms, key kernel functions, performance tuning, leak detection, fragmentation handling, and real‑world code samples for developers and system engineers.
The article explains that university C programming courses omit Linux, Makefile, git, and gdb because of limited class hours, outdated curricula, and many instructors' lack of experience, arguing that self‑learning these tools often yields better results.
The article walks developers through the root causes of high CPU consumption when using select/poll, explains why epoll solves these bottlenecks, and provides a complete, pure‑C implementation that covers socket setup, epoll creation, registration, event loops, level‑trigger vs edge‑trigger modes, and performance comparisons.
This article walks through the complete Linux file I/O workflow—from opening, reading, and writing files, to kernel‑level system call execution and the differences among five major I/O models—explaining buffers, caches, blocking vs. non‑blocking modes, and performance‑impacting trade‑offs.
The article chronicles French programmer Fabrice Bellard’s extraordinary career, highlighting his groundbreaking C projects—from the LZEXE compressor and the Harissa JVM to FFmpeg, QEMU, TinyCC, QuickJS, and a record‑breaking Pi calculation—showcasing how a single developer reshaped multiple domains of software engineering.
The article outlines a step‑by‑step learning roadmap for embedded software engineers, emphasizing the need to define goals, master C and hardware basics, understand RTOS and Linux, build hands‑on projects, develop debugging skills, and commit to continuous learning.
This article explains the fork system call in the Linux kernel, details the copy‑on‑write (COW) mechanism that underpins its efficiency, provides code examples, and explores practical scenarios and performance implications for process creation, memory usage, and concurrent server programming.
This comprehensive guide explains Linux system calls—the sole interface between user‑space programs and the kernel—covering their purpose, core logic for process, file, and memory management, the underlying interrupt mechanisms, parameter handling, and real‑world C code examples.
The article examines Linus Torvalds’s original Git init implementation, walking through the C source files, explaining how directories are created, why a 40‑byte offset is added to allocated memory, and highlighting a missing free() call that leads to a memory leak, while discussing when manual deallocation is necessary.
The article walks through a C programmer's journey from hard‑coded if‑else shape handling to embedding function pointers in structs, introducing shared function tables, automatic initialization, memory savings, inheritance via table overrides, and finally showing how C++ virtual functions automate the same mechanism.
This comprehensive guide explains the inner workings of the C malloc function, covering memory layout, stack vs heap, glibc memory pools, system calls like brk/sbrk and mmap, allocation strategies, fragmentation, alignment, multithreading safety, and comparisons with calloc, realloc, and C++ new.
This comprehensive guide breaks down Linux inter‑process communication (IPC) by explaining its core concepts, why it’s needed, and detailing six mechanisms—pipes, named pipes, message queues, shared memory, semaphores/PV operations, signals, and sockets—complete with code samples, diagrams, and real‑world usage scenarios.
This article compiles a comprehensive set of technical interview questions and concise answers covering Linux kernel‑user communication, interrupt handling, memory allocation strategies, macros, endianness, cache hierarchy, process context, DMA, virtual memory translation, debugging tools, and driver initialization, aimed at candidates preparing for embedded Linux driver roles.
This article explains the core principles of memory alignment on Linux, shows how misaligned data harms CPU cache and execution speed, provides concrete C code examples and benchmark results, and offers practical techniques—including compiler directives and struct layout tricks—to achieve optimal performance.
This comprehensive guide explains why traditional I/O models become bottlenecks in high‑performance computing, introduces the modern io_uring framework with its submission and completion queues, walks through its design goals, core concepts, workflow, performance comparisons, optimization tips, real‑world use cases, and provides complete C examples for practical adoption.
In an age where AI can generate code, mastering C remains essential because it reveals the low‑level mechanisms of memory, pointers, and CPU behavior that high‑level languages hide, enabling developers to write high‑performance software and stay valuable in the job market.
This article walks readers through Linux file‑system fundamentals, explains the role of the Virtual File System (VFS), dives deep into ext2 structures such as superblocks, group descriptors, block and inode bitmaps, and provides complete C code for reading file contents directly by inode number.
This article thoroughly explains Linux shared memory, covering its advantages over other IPC methods, the kernel data structures, virtual‑physical mapping, creation and destruction APIs, copy‑on‑write behavior, and provides complete example code for inter‑process communication.
This article explains the purpose of Linux's separate signal stack, how it differs from the regular process stack, the mechanics of signal delivery, practical code examples for enabling and using it, and why it matters for stability, real‑time processing, multithreading, and performance optimization.
This comprehensive guide explains the Linux process stack architecture, stack frame layout, function call mechanics, dynamic growth limits, common pitfalls such as stack overflow and memory leaks, and demonstrates debugging techniques with gdb, pstack, and perf, plus a real‑world C++ example.
This article guides readers through Linux file system fundamentals, explaining the role of the virtual file system (VFS), detailed structures of the ext2 superblock, group descriptors, block and inode bitmaps, and provides C code examples for extracting and reading file data directly via inode numbers.
This article explains how AIoT‑era embedded devices evolve from simple C/assembly code to reusable, portable frameworks by applying design patterns such as the Observer pattern and a custom responsibility‑chain model for low‑power management, complete with code examples, memory‑pool handling, and test cases.
This article presents a comprehensive collection of low‑level C optimization techniques for embedded systems, covering algorithm selection, data type choices, arithmetic shortcuts, loop transformations, structure layout, function inlining, register usage, and many practical code examples to dramatically improve execution speed and reduce code size.
This article explains three practical categories for C functions—pure functions with no side effects, functions that read external state without modifying it, and functions that both read and depend on external variables—showing how the classification aids memoization, re‑entrancy reasoning, and inline‑function usage.
Pure Functionsc-programmingfunction classification
This article explains the most common C language compilation, linking, and runtime error codes, shows why they occur, and provides clear examples and step‑by‑step fixes so beginners can quickly diagnose and resolve their code problems.
This guide walks Linux developers and operators through the fundamentals of kernel memory management, common memory bugs, and step‑by‑step configuration and usage of KASAN—including shadow memory, compile‑time instrumentation, kernel build options, and practical code examples—to quickly locate and fix out‑of‑bounds, use‑after‑free, and leak issues.
The article explains the Linux kernel's warning against new typedefs, citing Linus Torvalds' preference for struct usage, coding style guidelines, and practical reasons such as readability and maintainability in a large codebase.
RT-Thread, a Chinese open‑source real‑time operating system, offers a highly scalable kernel, rich component ecosystem, and modular design; this article examines its core libraries, module classifications, typical IoT and industrial applications, and provides detailed C code examples for thread management, synchronization, device drivers, file systems, and networking.
This article explains how memory alignment in Linux—driven by hardware granularity, kernel allocation policies, and compiler optimizations—affects struct layout, cross‑platform compatibility, and execution speed, and provides practical techniques and testing methods to ensure optimal performance and reliability.
This article explains how to apply layered architecture and time‑slice (time‑slot) design in microcontroller programming, using a keypad‑scanning example to illustrate hardware, driver, and application layers, and shows how RTC‑based interrupts can manage multiple concurrent timers efficiently.
This article explains how to design decoupled embedded software by using a layered architecture, event‑driven mechanisms, pipeline‑filter data flows, and dependency injection, providing concrete C code examples and practical guidelines for each technique to improve maintainability and scalability.
This article explains what memory leaks are, distinguishes different leak types such as space leaks and fragmentation, shows how unreferenced allocations cause hidden waste, and introduces common detection tools like Valgrind, AddressSanitizer, and tcmalloc Heap Profiler.
A curious geek ran the classic 1993 FPS DOOM continuously on an outdated handheld for two and a half years, discovering that the game’s 32‑bit timer eventually overflows and crashes, highlighting how long‑running client software can hit hidden integer overflow bugs.
This guide explains how to achieve clean decoupling in embedded software by employing a systematic layered architecture, leveraging event‑driven and pipeline‑filter patterns for data flow, and applying dependency injection, complete with practical C code examples and best‑practice recommendations for resource‑constrained devices.
This tutorial explains core Linux process concepts—including the difference between programs and processes, how to view and identify processes, detailed usage of fork and vfork for creating child processes, process termination, zombie and orphan handling, and practical examples of exec, system, and popen functions with C code.
This comprehensive guide explains why debugging stripped binaries is crucial, walks through installing GDB, shows how to disassemble code, set address‑based breakpoints, inspect memory, handle signals, use advanced features like backtraces, conditional breakpoints, watchpoints, remote debugging, and even basic heap analysis for C/C++ programs.
This article explains the concept of memory alignment in Linux, how alignment rules affect struct layout and CPU access, why proper alignment improves performance and portability, and provides practical compiler directives and code examples for implementing and testing aligned data structures.
This article explains the fundamentals of malloc and free, covering their signatures, how they interact with the brk/sbrk system calls, the structure of memory control blocks, multiple allocation strategies such as explicit free lists, segregated lists, buddy systems and tcmalloc, along with code examples and their trade‑offs.
This guide outlines 32 practical C programming habits—from proper indentation and commenting to safe memory handling and error management—designed to improve code readability, maintainability, and reliability, helping developers write professional, high‑quality software.
This article walks you through why learning Nginx module development matters, explains the core architecture and lifecycle, shows how to set up the build environment, create a Hello World module with full source code, compile, install, configure, and extend it with advanced features and performance optimizations.
This article explains what Linux system calls are, why they are essential for resource management, process control and device access, describes the separation of user and kernel space, details the execution flow of a system call, and provides multiple C code examples for direct and library‑based invocation.
This article explains how the C language enables low‑level hardware control by exposing CPU registers and physical memory, using inline assembly for direct register access, and leveraging pointers to manipulate memory addresses, while also discussing the risks and responsibilities involved.
This guide outlines thirty‑two practical C/C++ coding habits—from proper file headers, indentation, and commenting to error handling, const usage, and avoiding macros pitfalls—aimed at improving code readability, maintainability, and reliability for developers of all levels.
This comprehensive guide introduces GDB, the powerful GNU Debugger, covering its overview, installation, basic commands, advanced features like backtracing, memory analysis, conditional breakpoints, remote debugging, and practical tips such as TUI mode, custom scripts, and IDE integration to help developers efficiently locate and fix bugs.
This article explains why code can run slowly on resource‑constrained devices and presents eight practical techniques—ranging from loop unrolling and memory access reduction to SIMD intrinsics and table look‑ups—to help C programmers write faster, more efficient code.
This article explores how the C language enables low‑level hardware control by detailing the roles of CPU registers and physical memory, illustrating direct register access via inline assembly, and explaining pointer usage for memory manipulation, highlighting the trust C places in programmers and the responsibilities it entails.
mmap shared memory lets multiple processes access the same physical memory, which can break process isolation, expose permission misconfigurations like PROT_EXEC, and cause cross‑process crashes or code‑injection attacks, making it far riskier than heap allocations with malloc that remain confined to a single process.
This article presents a curated collection of nine high‑utility C code snippets for embedded development, covering a circular buffer, custom assertions, bit reversal, fixed‑point arithmetic, endianness conversion, bit masks, timer handling, binary search, and a simple bitset structure, each with concise explanations and ready‑to‑use implementations.
The author reflects on a paid tutoring session that revealed university C‑language exam questions focused on obscure syntax tricks, argues that such puzzles hinder real programming skill development, and calls for a shift toward readability, problem‑solving, and practical relevance in computer science education.
This article explains the role of glibc malloc in dynamic memory allocation, describes its internal data structures and allocation/free algorithms, provides a C code example, and offers practical optimization tips and common pitfalls for safe and efficient memory management.
This guide outlines practical C coding standards covering clear and concise code, consistent naming conventions for variables, functions, constants, enums, macros, and files, proper header protection, include ordering, inline function usage, and effective commenting to improve readability and maintainability.
This article explains how Linux processes are created, managed, and replaced using the fork, wait (including waitpid), and exec system calls, covering their prototypes, return values, copy‑on‑write optimization, and practical C code examples that demonstrate their coordinated use in real‑world scenarios.
This article explains how the C functions malloc and free allocate and release memory, covering stack vs heap, the brk and mmap system calls, fragmentation, header metadata, and why both allocation strategies are needed for efficient memory management.
The article explains how operating‑system multitasking and process switching share the same underlying mechanism as function calls, demonstrates a C program that overwrites a return address to jump to an unexpected function, and shows the resulting assembly to illustrate the similarity between buffer‑overflow attacks and legitimate context switches.
This article explains the principles of Direct Memory Access (DMA) and Remote Direct Memory Access (RDMA), compares them with traditional TCP I/O, outlines RDMA’s features, protocol standards, communication pathways, queue mechanisms, and provides example code for setting up RDMA connections using RoCEv2.
This article explains why Linux processes need to communicate, describes the kernel‑mediated IPC framework, compares shared‑memory and message‑passing approaches, and provides detailed code examples for pipes, FIFOs, signals, files, semaphores, sockets, plus real‑world use cases and case studies.
This article explains what memory out-of-bounds errors are, why they are dangerous in Linux C programs, and provides step‑by‑step debugging methods using logs, GDB, Valgrind, core dumps, mprotect, static analysis, and preventive coding practices.
This guide walks through creating a 32‑bit Linux‑kernel memory allocator using a free‑list, implementing morecore and add_to_free_list functions, and then adding a basic mark‑and‑sweep garbage collector that scans heap, BSS, data segments and the stack to reclaim unused blocks.
This article explains how to use C99 designated initializers for arrays, structs, and unions, demonstrates macro‑list techniques for generating enums and accessor functions, and shows how to implement compile‑time assertions with clever use of the preprocessor, providing practical code examples for each technique.
This guide explains how GDB's dynamic printf feature lets you insert formatted print statements at any point in a running program without modifying source code or rebuilding, covering basic usage, command syntax, saving/loading breakpoints, and practical examples for efficient debugging.
This course introduces the background and characteristics of PHP, explains the role and operation of the PHP interpreter, and guides students through building a simple interpreter in C by covering lexical analysis, parsing, virtual machine design, and hands‑on debugging with GDB.
This guide explains what network‑card promiscuous (promisc) mode is, why it matters for receiving packets across different subnets, and provides step‑by‑step Linux commands and a C program example to enable, disable, and verify the mode on an interface.
This article provides a comprehensive overview of POSIX threads, covering their architecture, creation, synchronization, attributes, scheduling policies, advantages, drawbacks, and real‑world examples such as mutex protection, barrier synchronization, and a cross‑platform network server implementation.
This article introduces Linux interprocess communication (IPC), describes the characteristics and usage of unnamed and named pipes, message queues, shared memory, signals, and semaphores, and provides complete C code examples and a producer‑consumer demonstration that combine these mechanisms.
This article provides a thorough introduction to the GNU Debugger (GDB), covering its core capabilities, startup methods, compilation requirements, a wide range of debugging techniques—including breakpoints, memory inspection, disassembly, reverse execution—and detailed guidance for multithreaded debugging on Linux systems.
This document defines comprehensive C language coding standards covering clarity, simplicity, testability, safety, efficiency, and portability, offering concrete principles, rules, and suggestions to guide developers in writing maintainable, reliable, and high‑performance code.
This article explains how high‑level C/C++ programs are transformed into processor‑executable binary code on Linux, covering preprocessing, compilation, assembly, linking, the GCC toolchain, Binutils utilities, C runtime libraries, and ELF file analysis with practical command examples.
This article explains why calling malloc in C only reserves virtual address space, how the kernel maps it to physical memory on demand, and the roles of the brk pointer, memory layout, and page‑fault handling, illustrated with a 1 GB allocation example and detailed diagrams.
This article explains what happens inside a computer when you request memory with malloc, covering the role of the standard library, the compilation and linking process, memory layout, heap allocation, fragmentation, and how the operating system expands the heap.
This article explains what happens inside a computer when you request memory with malloc, covering the C standard library, compilation, memory layout, heap allocation, fragmentation, and how the operating system expands the heap using system calls.
This article explains how memory allocation works in C, covering the role of malloc, the distinction between code and user data, the compilation and linking process, heap organization, fragmentation, and how the operating system expands the heap when needed.
The article explains C’s memory allocation, detailing how functions like malloc obtain heap space, the role of system calls such as brk, the distinction between stack and heap, address layout, fragmentation challenges, and practical implications for efficient dynamic memory management.
This article compares the infinite‑loop constructs for(;;) and while(1) in C, examining compiler optimizations, performance measurements on microcontrollers, coding style guidelines, and industry standards to determine if one form offers any real advantage over the other.
c-programmingcompiler optimizationembedded systems
This article demonstrates three methods for sending logs to the systemd journal—using the libc syslog() function, capturing stdout/stderr via printf(), and employing the native systemd sd_journal API—complete with C, Python, and Bash examples, service setup, and log filtering techniques.
This article explains the concept of software timers, their implementation principles in operating systems, and provides a complete STM32 example with data structures, state management, and functions for initializing, starting, updating, stopping, and querying timers.
The article introduces Microsoft’s recent open‑source release of MS‑DOS, detailing its historical background, version evolution from 1.x to 8.x, the mix of assembly and C code in the repository, and its significance for modern developers interested in operating‑system fundamentals.
This article introduces the open‑source mem_malloc module for microcontrollers, explains its fragmentation‑free allocation algorithm, shows how to integrate and compile it on an IOT development board, and provides detailed test code and results illustrating efficient RAM usage.
This article introduces the fundamentals of bitwise operations, explains common operators, presents practical tricks such as parity checks, swapping without extra space, clearing and extracting the lowest set bit, and demonstrates real‑world applications like bit counting and permission management with clear C code examples.
Andrej Karpathy released LLM.C, a pure C/CUDA implementation that trains GPT‑2‑style models in about 1,000 lines of code, detailing manual forward/backward passes, memory allocation tricks, SIMD CPU acceleration, CUDA porting, and migration tutorials, while comparing it to PyTorch and discussing broader LLM OS implications.
This comprehensive guide walks you through Makefile fundamentals, covering basic syntax, variables, pattern rules, automatic variables, functions, conditional statements, multi-target handling, phony targets, debugging techniques, and advanced custom functions to help you automate and streamline complex build processes.
This article walks through constructing pure‑C eBPF programs using the native libbpf library, covering kernel‑libbpf version mapping, environment setup for RPM and DEB systems, detailed Makefile analysis, embedding BPF objects via hexdump, and extending the approach to USDT and Uprobe tracing without relying on libbpf‑bootstrap.
This comprehensive tutorial walks you through the essentials of C programming, covering everything from the classic Hello World program and basic syntax to data types, operators, control structures, functions, recursion, arrays, strings, and multi‑dimensional arrays, complete with clear code examples and visual diagrams.
This article explains the definition, characteristics, and structure of processes, describes process creation, termination, and state transitions, outlines various scheduling algorithms, and introduces inter‑process communication mechanisms such as pipes, sockets, shared memory, and message queues, with example C code for Linux.
An amusing yet instructive narrative shows how a C program that crashes with a segmentation fault can appear to work after inserting a printf, explaining that uninitialized local variables contain leftover stack data and that debugging tools like GDB reveal the true cause.
This guide explains the design, architecture, and step‑by‑step usage of an AT command parsing library for bare‑metal and OS‑based systems, covering job queue management, core APIs, example code, and integration with modem, Wi‑Fi, and Bluetooth modules.
This guide details a lightweight AT command parsing module supporting both bare‑metal and OS versions, explains its architecture, core data structures, key APIs, and provides step‑by‑step usage examples—including GPIO testing, signal‑quality queries, and TCP data transmission—for modems, Wi‑Fi and Bluetooth communication.
This article explains the roles of the static and volatile keywords, compares sizeof and strlen, shows how to reliably compare floating‑point numbers, discusses the impact of floating‑point operations on STM32 interrupt performance, and outlines the I2C protocol and address configuration for embedded systems.
This course introduces the background and features of PHP, explains the role and inner workings of the PHP interpreter—including lexical analysis, parsing, and the virtual machine—and guides students to implement a simple interpreter using C, enhancing their programming and problem‑solving skills.
This article introduces an AT‑command communication parsing module that supports both bare‑metal (at_chat) and OS‑based versions, explains its software architecture, core data structures, key interfaces, and provides step‑by‑step usage examples with complete C code snippets for Wi‑Fi, Bluetooth, and modem integration.
This tutorial shows how to wire a three‑color LED to an STM32F103C8T6, configure a HC‑08 Bluetooth module for UART communication, and write C code that toggles each LED based on received keywords (green, yellow, red) using the STM32 HAL library.
This tutorial walks you through Linux process creation with fork, explains copy‑on‑write mechanics, details process termination, waiting, and program replacement using exec families, and culminates in building a basic shell, complete with code examples and visual illustrations.
This article explains the concept of weak symbols and weak references in C, demonstrates their behavior with practical examples, and shows how they can be leveraged to create maintainable, cross‑platform embedded drivers while addressing compiler differences and linker nuances.
This tutorial explains relay fundamentals, classifications, electrical parameters, wiring diagrams, and provides a complete STM32‑based implementation with source code to control a relay and toggle an LED, offering practical guidance for embedded hardware projects.
This article explains that callbacks are essentially function variables, illustrating the concept with plain C code examples, comparing direct function calls to passing functions as parameters, and showing how this approach avoids massive if‑else chains while keeping the logic clear and reusable.
This article explores how counters, especially 24‑bit timestamps, are employed in Redis’s LRU eviction algorithm and other memory‑constrained scenarios, detailing implementation tricks, precision trade‑offs, and practical code examples for efficient cyclic counters and compact storage techniques.
A 1990 AT&T network outage caused by an untested C code change led to a nine‑hour service collapse, massive financial loss, and widespread disruption, illustrating how a single software bug can trigger cascading failures in large‑scale telecommunications systems.
The article explains why iterating a two‑dimensional array by rows runs dramatically faster than by columns, covering memory‑hierarchy basics, locality principles, cache behavior, cache‑line mechanics, and Linux perf measurements that reveal a 20‑fold speed gap caused by cache‑miss rates.
This article provides a thorough overview of essential C language concepts frequently asked in interviews, covering topics such as language basics, keywords, variables, pointers, arrays, memory management, functions, recursion, data structures, preprocessor directives, and practical code examples to help readers master high‑frequency C interview questions.