Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Ivan Cibrario Bertolotti & Gabriele Manduchi

Rating No ratings yet

This book aims to provide readers with hands-on knowledge about real-time operating systems and their possible application in the embedded systems domain to streamline, simplify, and make software development more efficient, without requiring any significant previous experience with them.

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
# Real-Time Embedded Systems with Open-Source Operating Systems, Second Edition ## 【One-Line Pitch】 A hands-on guide for embedded developers and software engineers who want to master real-time operating systems (RTOS) using open-source platforms like Linux, covering everything from hardware fundamentals to advanced concurrency and interprocess communication—no prior RTOS experience required. ## 【Book Arc】 - **Opening (~0%–10%)**: Introduces the book's purpose—providing practical RTOS knowledge for embedded systems—and outlines the full table of contents, spanning deadlock, interprocess communication (shared variables, message passing), POSIX/Linux primitives, and a vision control case study. It also emphasizes the multidisciplinary nature of embedded development, where software engineers benefit from basic control engineering and electronics knowledge. - **Early (~10%–23%)**: Covers hardware foundations, including memory-mapped I/O, PCI/SCSI bus architectures, and bridge configuration, then transitions into operating system fundamentals—specifically how user/kernel mode switching works via interrupts and software interrupts, and how system calls enable user programs to perform I/O safely. - **Early (~23%–32%)**: Presents a detailed vision control case study using Video4Linux2 (V4L2), walking through the complete workflow: device setup, buffer allocation via mmap(), enqueuing/dequeuing buffers, using select() for synchronization, and streaming capture—with concrete code examples showing each ioctl() step. - **Middle (~32%–42%)**: Delves into performance optimization for the vision application, discussing compiler optimizations, pipeline data hazards, superscalar processor considerations, and the limits of compiler optimization—particularly around pointer-based memory access. Also introduces the process model and multiprogramming as the foundation for concurrent system design. - **Middle (~42%–48%)**: Explores real-time concurrent programming principles, including the scheduler's role in process selection, process state diagrams, and process attributes that drive scheduling decisions. Introduces multithreading with examples like media players needing concurrent UI, audio decoding, and background tasks. ## 【Key Takeaways】 - **Multidisciplinary collaboration is essential in embedded development** (Early): Successful embedded systems require input from control engineers, electronics specialists, and software engineers—and even in large teams, overlapping knowledge improves communication and reduces requirement gaps or over-engineering. - **Memory-mapped I/O and bus bridges decouple device addressing** (Early): Address mapping windows with configurable offsets let processors access I/O devices without knowing their physical bus addresses, and hierarchical bridge configuration (memory→PCI→SCSI) enables scalable device connectivity. - **Interrupts are the key to safe kernel-mode entry** (Early): Hardware interrupts switch the processor to kernel mode for device drivers, while software interrupts provide a controlled mechanism for user programs to request privileged operations—preventing malicious code from bypassing the protection barrier. - **select() is essential for multi-device I/O synchronization** (Early): Since read() blocks, programs handling multiple devices risk suspending on one device while others have data ready; select() monitors multiple descriptors and returns only when I/O can proceed without blocking. - **V4L2 streaming requires careful buffer management** (Early): The vision control case study demonstrates a complete workflow—requesting buffers, mapping driver memory to user space via mmap(), enqueuing buffers in a circular list, starting streaming, and using select() with timeouts to wait for ready frames. - **Compiler optimization has limits—especially with pointers** (Middle): While compilers excel at instruction scheduling and pipeline hazard avoidance, they cannot fully optimize pointer-based memory access patterns, leaving room for manual optimization in performance-critical embedded code. - **The process model simplifies concurrent system design** (Middle): By abstracting away whether hardware truly executes processes in parallel, multiprogramming lets developers design at the process level, trusting the scheduler to ensure all processes make progress over time. - **Multithreading addresses the need for concurrent related activities** (Middle): Modern applications like media players require simultaneous handling of UI, audio streaming, and background data retrieval—each a distinct activity sharing a common goal, motivating thread-based design. ## 【Reading Tips】 - **Skim the hardware chapters (Early ~10%–19%)** if you're already familiar with bus architectures and memory mapping—the key concept to retain is how address mapping windows work, as it recurs in later driver discussions. - **Deep-read the vision control case study (Early ~23%–32%)**: This is the book's practical heart, with complete code showing the V4L2 workflow. Follow along with the ioctl() calls and buffer management steps—they're directly reusable in real projects. - **Pay special attention to the select() and mmap() explanations** (Early): These are common pain points for embedded developers and are explained with concrete examples that clarify the address space translation between driver and user space. - **The optimization discussion (Middle ~32%–42%)** is valuable but dense—focus on the conceptual takeaways about compiler limits and pointer aliasing rather than the specific pipeline details unless you're doing low-level performance work. - **Use the exercises at each chapter's end** (visible in the table of contents) to test understanding—they're designed to reinforce the practical skills each chapter teaches. ## 【Coverage Limits】 This guide covers the book's opening through the middle sections (~48%), including hardware foundations, OS fundamentals, the vision control case study, and early concurrency concepts. The excerpts do not cover the later chapters on deadlock prevention/avoidance, semaphores, monitors, message passing details, or POSIX/Linux IPC primitives in depth—these appear only in the table of contents. ##
Page 9
...............................................................120 5.7 Summary.............................................................................12...
View in text
Excerpt 2
ll the devices in the system are directly accessible by the processor at given addresses over the memory bus. Properly setting all the bridges in the system...
View in text
Excerpt 3
in the driver’s space. Such an address, returned in field m.offset of the v4l2_buffer structure passed to ioctl(), cannot be used directly in the program sin...
View in text
Excerpt 4
m, not all possible choices will produce meaningful results. For example, if a certain process P makes use of some values computed by another process Q, exec...
View in text
Excerpt 5
itecture [49] provide different degrees of memory ordering. The SFENCE instruction is a store barrier; it guarantees that all store operations that come befo...
View in text
Excerpt 6
the monitor’s shared data, make the condition false again. To conclude the description, Figure 5.18 shows how the producers–consumers prob- lem can be solved...
View in text
Excerpt 7
nherits the memory segments de- fined by the parent process. So, in order to share memory with children processes, it suffices, before calling fork(), to cre...
View in text
Excerpt 8
processor is interrupted by the system clock, such list is checked, and the processes/threads for which the wait period has expired are awak- ened. So, the g...
View in text
Tags
AI categories
embedded systemsLinux
ISBN: 1032973714
Publisher: CRC Press
Publish Year: 2026
Language: English
File Format: PDF
File Size: 16.7 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…