<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Darshan Rathod</title>
    <description>The latest articles on Forem by Darshan Rathod (@darshan_rathod).</description>
    <link>https://forem.com/darshan_rathod</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2912909%2Fa47bf116-ac25-44e3-b245-7bc917d8f9b6.JPG</url>
      <title>Forem: Darshan Rathod</title>
      <link>https://forem.com/darshan_rathod</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/darshan_rathod"/>
    <language>en</language>
    <item>
      <title>Explaining the Linux Device Tree for Embedded Engineers From DTS Source to a Running Kernel</title>
      <dc:creator>Darshan Rathod</dc:creator>
      <pubDate>Thu, 19 Feb 2026 10:49:12 +0000</pubDate>
      <link>https://forem.com/darshan_rathod/explaining-the-linux-device-tree-for-embedded-engineersfrom-dts-source-to-a-running-kernel-39p6</link>
      <guid>https://forem.com/darshan_rathod/explaining-the-linux-device-tree-for-embedded-engineersfrom-dts-source-to-a-running-kernel-39p6</guid>
      <description>&lt;p&gt;If you work with ARM or embedded Linux, you’ve almost certainly touched a &lt;code&gt;.dts&lt;/code&gt; file, toggled a &lt;code&gt;status = "okay"&lt;/code&gt; somewhere, rebuilt, and moved on—without fully internalizing what’s really happening. For many embedded engineers, the device tree feels like a &lt;strong&gt;magical incantation&lt;/strong&gt; between “the board” and “the kernel.”&lt;/p&gt;

&lt;p&gt;This post walks through the full story, end‑to‑end: what the device tree is, how DTS becomes DTB, what the bootloader and kernel do with it, and a concrete I2C sensor example you can map to your own board.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Why the device tree exists&lt;/strong&gt;&lt;br&gt;
On PCs, hardware discovery is dynamic: ACPI, PCI, and the BIOS/UEFI tell the OS what’s present. On microcontrollers and many SoCs, the opposite is true: peripherals live at fixed addresses with hard‑wired interrupts, and the board designer decides which ones are actually used.&lt;/p&gt;

&lt;p&gt;Hardcoding all of that into kernel C files does not scale when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You have multiple boards built around the same SoC.&lt;/li&gt;
&lt;li&gt;You spin board revisions and move peripherals to different pins.&lt;/li&gt;
&lt;li&gt;You want to reuse a vanilla kernel image across variants.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The device tree is Linux’s answer on many embedded platforms: &lt;strong&gt;a data‑driven hardware description that says “what exists” and “where it lives,” separated from the kernel code.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;High‑level idea:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One kernel image, many DTBs.&lt;/li&gt;
&lt;li&gt;Bootloader passes the appropriate DTB for the actual board.&lt;/li&gt;
&lt;li&gt;Kernel parses it and instantiates devices + drivers dynamically.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Mental model: it’s just a tree of nodes and properties&lt;/strong&gt;&lt;br&gt;
A device tree is literally a tree:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Each node represents a device or bus (CPUs, memory, SoC, UART, I2C, GPIO controller, etc.).&lt;/li&gt;
&lt;li&gt;Each node has properties—simple key/value pairs that encode addresses, interrupts, strings, or small arrays.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At the source level, you work with DTS/DTI files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/dts-v1/;

 / {
     model = "My Tiny ARM Board";
     compatible = "myvendor,myboard", "myvendor,my-soc";
 };

 cpus {
     #address-cells = &amp;lt;1&amp;gt;;
     #size-cells = &amp;lt;0&amp;gt;;

     cpu0: cpu@0 {
         compatible = "arm,cortex-a7";
         reg = &amp;lt;0&amp;gt;;
     };
 };

 memory@80000000 {
     device_type = "memory";
     reg = &amp;lt;0x80000000 0x10000000&amp;gt;; /* 256 MB */
 };

 soc {
     #address-cells = &amp;lt;1&amp;gt;;
     #size-cells = &amp;lt;1&amp;gt;;
     compatible = "simple-bus";
     ranges;

     uart0: serial@4000 {
         compatible = "vendor,soc-uart";
         reg = &amp;lt;0x00004000 0x1000&amp;gt;;
         interrupts = &amp;lt;5&amp;gt;;
         status = "okay";
     };

     i2c1: i2c@5000 {
         compatible = "vendor,soc-i2c";
         reg = &amp;lt;0x00005000 0x1000&amp;gt;;
         interrupts = &amp;lt;6&amp;gt;;
         status = "disabled";
     };
 };
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few must‑understand properties:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;compatible:&lt;/strong&gt; the string the kernel uses to match this node to a driver. Drivers declare a table of strings they support.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;reg:&lt;/strong&gt; base address and size of the device’s register region, in parent bus address space.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;interrupts:&lt;/strong&gt; which interrupt the device uses; encoding depends on the interrupt controller binding.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;status: "okay"&lt;/code&gt; means “use this device”; &lt;code&gt;"disabled"&lt;/code&gt; means “ignore it.”&lt;/p&gt;

&lt;p&gt;Once you see a DTS as &lt;strong&gt;“a typed, structured config file for hardware,”&lt;/strong&gt; it stops feeling mystical and becomes a tool you control.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. File structure: .dtsi vs .dts&lt;/strong&gt;&lt;br&gt;
Real BSPs rarely have a single giant .dts. Instead, they layer the description:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SoC .dtsi&lt;/strong&gt;—shared between boards using the same SoC. It describes the common peripherals (timers, UARTs, SPI/I2C controllers, pinctrl, etc.), often with &lt;code&gt;status = "disabled"&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Board .dts&lt;/strong&gt; — includes the SoC &lt;code&gt;.dtsi&lt;/code&gt; and turns on only what your board actually wires out, plus external devices (sensors, PMICs, connectors).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Conceptually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/* my-soc.dtsi – used by many boards */
soc {
    i2c1: i2c@5000 {
        compatible = "vendor,soc-i2c";
        reg = &amp;lt;0x00005000 0x1000&amp;gt;;
        interrupts = &amp;lt;6&amp;gt;;
        #address-cells = &amp;lt;1&amp;gt;;
        #size-cells = &amp;lt;0&amp;gt;;
        status = "disabled";
    };
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/* my-board.dts */
#include "my-soc.dtsi"

 / {
     model = "My Tiny ARM Board RevA";
     compatible = "myvendor,myboard-reva", "myvendor,my-soc";
 };

 &amp;amp;i2c1 {
     status = "okay";
     /* external devices will be added here */
 };
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The board file doesn’t duplicate the SoC details—it only overrides and extends them. That’s exactly why you can have multiple board DTs pointing at the same SoC .dtsi.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. From DTS to DTB: compiling the description&lt;/strong&gt;&lt;br&gt;
DTS is not what the kernel reads directly; it reads a compact binary form called a DTB (Device Tree Blob).&lt;/p&gt;

&lt;p&gt;The conversion is handled by the Device Tree Compiler (dtc):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install the tool on your dev machine:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install device-tree-compiler
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Compile a single DTS manually:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dtc -I dts -O dtb -o my-board.dtb my-board.dts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Inside the kernel tree, you usually run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- dtbs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes Kbuild walk directories like &lt;code&gt;arch/arm/boot/dts/&lt;/code&gt;, resolve all &lt;code&gt;#include&lt;/code&gt; chains, expand labels, and emit .dtb files.&lt;br&gt;
​&lt;br&gt;
&lt;strong&gt;5. Boot flow: how the DTB reaches the kernel&lt;/strong&gt;&lt;br&gt;
On a typical ARM board with U‑Boot, the journey looks like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Boot ROM loads and runs the first stage bootloader.&lt;/li&gt;
&lt;li&gt;Bootloader initializes DRAM and basic clocks.&lt;/li&gt;
&lt;li&gt;Bootloader loads &lt;code&gt;Image/zImage&lt;/code&gt; (the kernel) and &lt;code&gt;my-board.dtb&lt;/code&gt; into RAM.&lt;/li&gt;
&lt;li&gt;Bootloader sets a CPU register or passes a pointer via the boot protocol to tell the kernel where the DTB lives, then jumps to the kernel entry.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;From that point onward, it’s all kernel:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Early boot code parses the DTB into an internal “OF” tree (struct device_node hierarchy).&lt;/li&gt;
&lt;li&gt;The kernel walks this tree, creating platform devices and bus devices based on node compatible strings and bus types.&lt;/li&gt;
&lt;li&gt;Subsystems like I2C, SPI, GPIO, and pinctrl register their drivers and match nodes whose compatible entries appear in their of_match_table.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The important consequence: &lt;strong&gt;if your DTB is wrong, the kernel will politely ignore hardware or attach the wrong driver—even if your code is perfect.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Concrete example: I2C temperature sensor&lt;/strong&gt;&lt;br&gt;
Let’s map this to something real you might have on a board: a temperature sensor connected to an SoC’s I2C1 bus.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6.1. SoC .dtsi&lt;/strong&gt;&lt;br&gt;
As seen earlier, the SoC describes the controller but does not commit to any external devices:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;i2c1: i2c@5000 {
    compatible = "vendor,soc-i2c";
    reg = &amp;lt;0x00005000 0x1000&amp;gt;;
    interrupts = &amp;lt;6&amp;gt;;
    #address-cells = &amp;lt;1&amp;gt;;
    #size-cells = &amp;lt;0&amp;gt;;
    status = "disabled";
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tells the kernel:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;There is an I2C controller at base address 0x5000.&lt;/li&gt;
&lt;li&gt;It uses interrupt 6.&lt;/li&gt;
&lt;li&gt;It can host children (devices with reg = I2C addresses).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;6.2. Board .dts: enabling bus + sensor&lt;/strong&gt;&lt;br&gt;
Now your board .dts wires in the external sensor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;amp; i2c1 {
    status = "okay";

    temp@48 {
        compatible = "vendor,temp-sensor123";
        reg = &amp;lt;0x48&amp;gt;;          /* I2C address */
        interrupt-parent = &amp;lt;&amp;amp;gpio1&amp;gt;;
        interrupts = &amp;lt;12 0&amp;gt;;   /* GPIO1_12, active-low for example */
    };
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Boot‑time story:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Kernel sees /soc/i2c@5000 with compatible = "vendor,soc-i2c", so it instantiates an I2C controller and binds it to the corresponding driver.&lt;/li&gt;
&lt;li&gt;The I2C subsystem scans child nodes under that controller and finds &lt;a href="mailto:temp@48"&gt;temp@48&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;It then looks for a driver whose of_device_id table contains "vendor,temp-sensor123". That I2C sensor driver’s probe() is called with a handle to this DT node.&lt;/li&gt;
&lt;li&gt;Inside probe(), the driver typically reads reg (address), interrupts, and any extra properties (e.g. vdd-supply, reset-gpios) to configure the device.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No hard‑coded addresses inside the driver. All board‑specific wiring lives in DTS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Bindings: formal contract between DTS and drivers&lt;/strong&gt;&lt;br&gt;
If DTS is the configuration, bindings are the schema. They define what properties are valid and required for a given device type.&lt;/p&gt;

&lt;p&gt;You’ll find them in the kernel tree under &lt;code&gt;Documentation/devicetree/bindings/&lt;/code&gt;. Modern bindings are written in YAML and can be validated using dt-schema.&lt;br&gt;
​&lt;br&gt;
Before you create or modify a node:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Locate the binding file for your device, e.g.&lt;code&gt;i2c/vendor,temp-sensor123.yaml&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Check: required properties, allowed values, phandle relationships (interrupt-parent, clocks, resets, gpios, etc.).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Treat bindings like a datasheet for your DTS. If your properties don’t satisfy the binding, the driver either won’t probe, or it will behave unpredictably.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. Inspecting and debugging the live device tree&lt;/strong&gt;&lt;br&gt;
One of the nicest aspects of DT is that you can inspect what the kernel actually sees—no guesswork.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8.1. Browse the live tree&lt;/strong&gt;&lt;br&gt;
On DT‑based systems, the kernel exposes the live device tree under &lt;code&gt;/sys/firmware/devicetree/base&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls /sys/firmware/devicetree/base
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;find&lt;/code&gt; nodes (&lt;code&gt;find . -name 'i2c*'&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cat&lt;/code&gt; properties (&lt;code&gt;cat soc/i2c@5000/temp@48/compatible&lt;/code&gt;).
​
&lt;strong&gt;8.2. Decompile the running DTB&lt;/strong&gt;
Sometimes the DTB in use is not the one you think you built. To verify:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Many platforms expose the flattened DT as a single blob:
sudo dtc -I dtb -O dts -o running.dts /sys/firmware/fdt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or if your distribution uses DTBs under &lt;code&gt;/boot/dtb/&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo dtc -I dtb -O dts -o board-from-boot.dts /boot/dtb/my-board.dtb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This lets you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Compare “expected DTS” vs “actual running DTS.”&lt;/li&gt;
&lt;li&gt;See overlays applied by the bootloader or OS (common on Jetson, Raspberry Pi, Android, etc.).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;A very practical debug loop:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Inspect &lt;code&gt;/sys/firmware/devicetree/base&lt;/code&gt; to see whether your node exists and is &lt;code&gt;"okay"&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Confirm compatible and reg are what the driver expects (from bindings/docs).&lt;/li&gt;
&lt;li&gt;Check &lt;code&gt;dmesg&lt;/code&gt;for probe failures or “no compatible device found” messages.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;9. Conclusion:&lt;/strong&gt;&lt;br&gt;
The device tree is not magic—it’s the simple, structured layer that tells Linux &lt;strong&gt;what your hardware really looks like.&lt;/strong&gt; Once you’re comfortable moving from DTS to DTB and tracing a node all the way to a driver’s &lt;code&gt;probe()&lt;/code&gt; board, bring‑up stops being guesswork and becomes a repeatable skill you can apply to every new design.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>kernel</category>
    </item>
    <item>
      <title>Zephyr RTOS: The Modern Embedded Engineer’s Guide</title>
      <dc:creator>Darshan Rathod</dc:creator>
      <pubDate>Wed, 06 Aug 2025 06:21:44 +0000</pubDate>
      <link>https://forem.com/darshan_rathod/zephyr-rtos-the-modern-embedded-engineers-guide-2ih6</link>
      <guid>https://forem.com/darshan_rathod/zephyr-rtos-the-modern-embedded-engineers-guide-2ih6</guid>
      <description>&lt;p&gt;&lt;strong&gt;Why Care About RTOS in Embedded Development?&lt;/strong&gt;&lt;br&gt;
If you’re like me—working on everything from sensor nodes and wearables to future-ready IoT products—you already know how crucial real-time operating systems are. They turn bare-metal hardware into manageable, upgradeable products. But with so many RTOS choices, where do you start? Today, I’ll share why Zephyr RTOS is one of the most exciting projects in the embedded world and how it shapes up against the classic FreeRTOS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Sets Zephyr RTOS Apart?&lt;/strong&gt;&lt;br&gt;
Zephyr RTOS is more than just another open-source RTOS. With robust backing from the Linux Foundation, it’s evolved to meet the reality of today’s connected devices: modular, scalable, and security-focused, without bogging you down in legacy hurdles.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where Is Zephyr Used?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Wearable tech (think smart watches, fitness bands)&lt;/li&gt;
&lt;li&gt;IoT nodes and home automation&lt;/li&gt;
&lt;li&gt;Industrial gateways&lt;/li&gt;
&lt;li&gt;Basically, any device that needs to grow, update, or be trusted with sensitive data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Deep-Dive: Zephyr’s Core Features Every Developer Should Know&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;1. Modularity and Scalability&lt;/strong&gt;&lt;br&gt;
You only include what you need. Zephyr uses Kconfig (yes, like the Linux kernel) and device trees so you can easily add or strip out features at build time. That means a small memory footprint for simple projects or expansion room for complex ones.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Multi-architecture Support&lt;/strong&gt;&lt;br&gt;
Support isn’t an afterthought! Zephyr runs on ARM, x86, RISC-V, and even more exotic architectures, so your codebase can follow your hardware ambitions without huge rewrites.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Real-Time Scheduling&lt;/strong&gt;&lt;br&gt;
Under the hood, Zephyr delivers deterministic scheduling and priority-based preemptive threads. Translation: mission-critical tasks won’t get skipped or delayed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Rich Protocol Stacks &amp;amp; Driver Ecosystem&lt;/strong&gt;&lt;br&gt;
Bluetooth LE out of the box? Check. TCP/IP, LoRa, 802.15.4, and more? All there—plus a unified device driver model, so you spend less time integrating and more time building.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Security First&lt;/strong&gt;&lt;br&gt;
Zephyr takes secure coding seriously: routine code audits, best-in-class cryptography options, memory protection, and that coveted OpenSSF Gold Badge.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Unified, Modern Build System&lt;/strong&gt;&lt;br&gt;
Gone are the days of assembler-specific Makefiles. Zephyr uses CMake under the hood with the ‘west’ meta-tool, making it easy to reproduce builds and manage dependencies for professional-grade projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Advanced Power Management&lt;/strong&gt;&lt;br&gt;
Need battery savings on a wearable or IoT node? Zephyr handles deep sleep, peripheral power gating, and dynamic clocking to help maximize uptime between charges.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Zephyr vs. FreeRTOS: How Do They Stack Up?&lt;/strong&gt;&lt;br&gt;
Let’s be honest—FreeRTOS remains wildly popular for a reason. Here’s a side-by-side look to help you choose the right tool for your job:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fye8e3vj2n0fgctq8soe2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fye8e3vj2n0fgctq8soe2.png" alt="FreeRTOS vs. ZephyrRTOS" width="800" height="546"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When Should You Use FreeRTOS?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your project is simple, single-purpose, or MVP grade.&lt;/li&gt;
&lt;li&gt;You want minimal complexity, with just enough RTOS features to get the job done.&lt;/li&gt;
&lt;li&gt;Fast prototyping on ultra-cheap hardware matters most.&lt;/li&gt;
&lt;li&gt;AWS IoT integration is a must-have, and reduced setup time trumps future expansion.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;When Should You Use Zephyr RTOS?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You need scalability for evolving requirements or multiple product lines.&lt;/li&gt;
&lt;li&gt;Security, system stability, or compliance is non-negotiable (think medical, industrial, or automotive devices).&lt;/li&gt;
&lt;li&gt;Your project will benefit from built-in protocols/stacks and modern power management.&lt;/li&gt;
&lt;li&gt;Multiple architectures/hardware must be supported—without massive code refactors.&lt;/li&gt;
&lt;li&gt;You can invest upfront for longer-term maintainability and ecosystem advantages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;br&gt;
If your project demands advanced features, future-proofing, full-stack integration, and trusted community support, Zephyr RTOS is the highway to professional embedded development. But don’t ditch FreeRTOS for small projects—its minimal approach is still a winner when resources or time-to-market are tight.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Want to know more?&lt;/strong&gt;&lt;br&gt;
Here is the link for your reference: &lt;br&gt;
&lt;a href="https://docs.zephyrproject.org/latest/develop/getting_started/index.html" rel="noopener noreferrer"&gt;https://docs.zephyrproject.org/latest/develop/getting_started/index.html&lt;/a&gt; &lt;/p&gt;

</description>
      <category>zephyrrtos</category>
      <category>freertos</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Board Bring-Up: A Developer's Guide to Flashing Android 15 on the NXP i.MX 8M Plus EVKB</title>
      <dc:creator>Darshan Rathod</dc:creator>
      <pubDate>Mon, 07 Jul 2025 12:11:47 +0000</pubDate>
      <link>https://forem.com/darshan_rathod/board-bring-up-a-developers-guide-to-flashing-android-15-on-the-nxp-imx-8m-plus-evkb-5793</link>
      <guid>https://forem.com/darshan_rathod/board-bring-up-a-developers-guide-to-flashing-android-15-on-the-nxp-imx-8m-plus-evkb-5793</guid>
      <description>&lt;p&gt;The NXP i.MX 8M Plus system-on-chip (SoC) stands as a powerhouse for the embedded world, integrating a dual or quad-core Arm® Cortex®-A53 processor with a Neural Processing Unit (NPU) operating at up to 2.3 TOPS. This makes its evaluation kit (EVKB) an ideal platform for developing cutting-edge applications in machine learning, industrial automation, and advanced multimedia.&lt;/p&gt;

&lt;p&gt;This guide provides a comprehensive, step-by-step walkthrough for bringing up the i.MX 8M Plus EVKB by flashing the latest Android 15 image using the SD card method on a Linux host system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites: What You'll Need
&lt;/h2&gt;

&lt;p&gt;Before diving in, ensure your workspace is equipped with the necessary hardware and software.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjwfa3v5infc2d6e81pk5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjwfa3v5infc2d6e81pk5.png" alt="Hardware_requirement" width="669" height="484"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Software:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The official NXP Android 15 Board Support Package (BSP). For this guide, we are using &lt;/p&gt;

&lt;p&gt;&lt;code&gt;imx-android-15.0.0_1.2.0.tar.gz&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Preparing the Host Environment and SD Card
&lt;/h2&gt;

&lt;p&gt;Proper preparation is key to a smooth flashing process. This involves extracting the necessary tools from the BSP and correctly identifying your storage medium.&lt;/p&gt;

&lt;p&gt;Extract the BSP Archive: On your Linux host PC, decompress the downloaded NXP Android image archive. This will create a directory containing the bootloader, system images, and essential flashing scripts.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tar -xvf imx-android-15.0.0_1.2.0.tar.gz 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Identify the SD Card:&lt;/strong&gt; Insert the microSD card into your host machine. To prevent catastrophic data loss, you must correctly identify its device name. Use the &lt;strong&gt;lsblk&lt;/strong&gt; command to list block devices before and after insertion. Your SD card will appear as a new device, such as &lt;strong&gt;/dev/sdX.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Critical Warning:&lt;/strong&gt; Double-check the device name. Writing to the wrong device, like /dev/sda, could erase your host operating system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Unmount the SD Card:&lt;/strong&gt; Linux systems often auto-mount removable media. Before you can write to the raw device, you must unmount any of its partitions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Replace /dev/sdX1 with your card's partition(s) sudo umount /dev/sdX1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 2: Flashing Android Using the NXP Provisioning Script
&lt;/h2&gt;

&lt;p&gt;While manual flashing with tools like dd is possible, Android's multi-partition layout (boot, system, vendor, userdata, etc.) makes it complex. The most reliable method is to use the dedicated script provided within the NXP BSP, which handles partitioning and image placement automatically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Navigate to the Script Location:&lt;/strong&gt; The provisioning script, imx-sdcard-partition.sh, is typically located within the extracted BSP directory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Execute the Script:&lt;/strong&gt; Run the script with sudo privileges, specifying the SoC family (imx8mp) and the SD card device name. &lt;strong&gt;For a 32 GB card, using the -c 28 flag ensures the partition table is correctly sized.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ./imx_android_setup.sh -f imx8mp /dev/sdX -c 28 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The script will now perform the following actions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a GUID Partition Table (GPT) on the SD card.&lt;/li&gt;
&lt;li&gt;Format the necessary partitions with appropriate filesystems.&lt;/li&gt;
&lt;li&gt;Copy all the required image files from your working directory to their corresponding partitions on the card.&lt;/li&gt;
&lt;li&gt;This process will take several minutes to complete.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 3: Configuring the EVKB and Booting Up
&lt;/h2&gt;

&lt;p&gt;With a freshly flashed SD card, the final step is to configure the EVKB hardware to boot from it.&lt;/p&gt;

&lt;p&gt;Set the Boot Mode Switches: Locate the boot mode DIP switch on your EVKB (often labeled SW7 or SW4). You must configure these switches to select the "SD boot" or "EXT" boot source. The exact configuration can be found in the official user manual or Quick Start Guide for your specific board revision.&lt;br&gt;
For i.MX 8 PLUS EVKB set switches to (0011)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Insert the SD Card and Power On:&lt;/strong&gt; Safely eject the microSD card from your host PC and insert it into the SD card slot on the EVKB. Connect the power supply.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Verify the Boot Process:&lt;/strong&gt; The board will power on and begin the boot sequence. You can monitor the process in two ways:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HDMI Display:&lt;/strong&gt; Connect a monitor to see the Android boot animation followed by the lock screen.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Serial Console:&lt;/strong&gt; Connect the USB-C debug port to your host PC and use a terminal emulator (like minicom or screen) to view the detailed boot logs from the kernel.&lt;/p&gt;

&lt;h2&gt;
  
  
  Future Scope:
&lt;/h2&gt;

&lt;p&gt;From here, you can begin your application development, explore the capabilities of the NPU, or delve deeper into customizing the Android BSP to fit your project's specific needs. This foundational skill unlocks the full potential of this powerful embedded platform.&lt;/p&gt;

</description>
      <category>nxp</category>
      <category>linux</category>
      <category>boardbringup</category>
    </item>
    <item>
      <title>Linux Kernel Source Tree Explained : Everything You Need to Know</title>
      <dc:creator>Darshan Rathod</dc:creator>
      <pubDate>Mon, 14 Apr 2025 09:02:59 +0000</pubDate>
      <link>https://forem.com/darshan_rathod/anatomy-of-the-linux-kernel-source-tree-3hnb</link>
      <guid>https://forem.com/darshan_rathod/anatomy-of-the-linux-kernel-source-tree-3hnb</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;The Linux kernel is the core component of the Linux operating system, responsible for managing system resources, hardware interaction, and core system services. Understanding the layout of the Linux kernel source tree is essential for developers who want to explore kernel internals, develop modules, or contribute to kernel development.&lt;/p&gt;

&lt;p&gt;In this blog post, we will explore the structure of the Linux kernel source code, providing an overview of the key directories and their functions. This will serve as a foundational guide for anyone beginning their journey into Linux kernel development.&lt;/p&gt;

&lt;h2&gt;
  
  
  Overview of the Source Tree
&lt;/h2&gt;

&lt;p&gt;When you download and extract the Linux kernel source code (typically from kernel.org), you will find a set of directories and files in the root directory. Each component of the kernel is organized logically to facilitate ease of development and maintenance.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;arch/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This directory contains architecture-specific code. Each supported architecture has its own subdirectory (e.g., x86/, arm/, riscv/). These directories include boot code, memory layout definitions, and syscall implementations tailored for each hardware architecture.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;block/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This directory includes the block layer code, which manages block devices such as hard drives and solid-state drives. It contains I/O schedulers and general block device infrastructure.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;drivers/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is one of the largest directories in the kernel source tree. It contains drivers for various hardware devices, such as USB, audio, graphics, and network interfaces. The subdirectories within drivers/ are organized by hardware type (e.g., usb/, net/, gpu/, char/).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fs/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The fs/ directory contains implementations of file systems, including EXT4, XFS, Btrfs, and others. It also includes the Virtual File System (VFS) layer, which provides an abstraction layer for file system operations.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;include/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This directory holds header files used throughout the kernel. It includes subdirectories such as:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;linux/: General kernel headers.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;asm-generic/: Generic architecture headers.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;uapi/: User-space API headers.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;init/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Contains the kernel initialization code. This includes the routines that are executed during the boot process, including the start_kernel() function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ipc/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This directory manages inter-process communication mechanisms such as semaphores, message queues, and shared memory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kernel/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This directory includes core kernel components such as the scheduler, timekeeping, system calls, and process management.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;lib/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Contains utility functions and common libraries used across the kernel, including string handling, compression, and checksums.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mm/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The memory management subsystem resides here. It includes code for handling paging, virtual memory, slab/slub allocators, and memory mapping.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;net/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Houses the networking stack, including support for protocols like TCP, UDP, and sockets. It also includes infrastructure for firewall and routing functionality.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;scripts/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Contains build scripts and utilities used during kernel compilation. These scripts help automate the configuration and generation of source files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;security/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Includes the Linux security modules framework, along with implementations like &lt;strong&gt;SELinux, AppArmor,&lt;/strong&gt; and other access control mechanisms.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sound/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This directory contains sound subsystem drivers and core audio frameworks, including &lt;strong&gt;ALSA (Advanced Linux Sound Architecture).&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tools/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Provides user-space tools for interacting with and analyzing kernel behavior, including perf, bpf, and selftests.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;usr/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This directory is used to generate the initial RAM filesystem &lt;strong&gt;(initramfs)&lt;/strong&gt; that is embedded into the kernel image.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Documentation/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Contains textual documentation, design guidelines, subsystem overviews, and best practices. It is an excellent resource for both new and experienced kernel developers.&lt;/p&gt;

&lt;p&gt;MAINTAINERS&lt;/p&gt;

&lt;p&gt;A text file listing the maintainers for each subsystem and component in the kernel. This is useful for contributing code and seeking guidance.&lt;/p&gt;

&lt;p&gt;Makefile and Kconfig&lt;/p&gt;

&lt;p&gt;These files form the kernel's build and configuration system. &lt;strong&gt;Makefile&lt;/strong&gt; defines build rules, while &lt;strong&gt;Kconfigfiles&lt;/strong&gt; define configuration options that can be selected using tools like &lt;code&gt;make menuconfig&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Navigating the Source Code&lt;/p&gt;

&lt;p&gt;To explore the kernel source code effectively, developers can use tools such as:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cscope or ctags:&lt;/code&gt; For code navigation.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git grep:&lt;/code&gt; For fast source code searching.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;elixir.bootlin.com:&lt;/code&gt; A web-based Linux source browser.&lt;/p&gt;

&lt;p&gt;These tools help in understanding code dependencies, function calls, and system behavior.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Understanding the structure of the Linux kernel source tree is a vital first step for anyone interested in kernel development. By familiarizing yourself with the purpose and content of each directory, you can navigate the kernel codebase more efficiently and confidently begin experimenting with or contributing to one of the most important open-source projects in the world.&lt;/p&gt;

&lt;p&gt;In future posts, we will explore topics such as compiling the Linux kernel, writing kernel modules, and debugging techniques.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Linux Kernel Explained: Everything You Need to Know</title>
      <dc:creator>Darshan Rathod</dc:creator>
      <pubDate>Wed, 19 Mar 2025 16:37:10 +0000</pubDate>
      <link>https://forem.com/darshan_rathod/linux-kernel-explained-everything-you-need-to-know-5hai</link>
      <guid>https://forem.com/darshan_rathod/linux-kernel-explained-everything-you-need-to-know-5hai</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;The Linux kernel is the foundational component of the Linux operating system, serving as an intermediary between user applications and the underlying hardware. As a monolithic and open-source kernel, it plays a critical role in system resource management, inter-process communication, and overall system stability. This article provides an in-depth exploration of the Linux kernel, detailing its architecture, operational mechanisms, and the reasons behind its widespread adoption across diverse technological landscapes.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the Linux kernel?
&lt;/h2&gt;

&lt;p&gt;The Linux kernel is a sophisticated, modular, and extensible core that governs hardware-software interactions. Initially developed by Linus Torvalds in 1991, the kernel has undergone extensive refinement through collaborative contributions from a vast global community. It serves as the backbone of Linux-based operating systems, executing essential functions such as process scheduling, memory allocation, device management, and enforcing security policies.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architectural Overview
&lt;/h2&gt;

&lt;p&gt;The Linux kernel is designed with a monolithic architecture, incorporating dynamically loadable modules to enhance flexibility. The following core components constitute its architecture:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Process Scheduler:&lt;/strong&gt; Manages the execution of multiple processes, ensuring efficient CPU time allocation through scheduling algorithms such as Completely Fair Scheduler (CFS) and real-time scheduling policies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Memory Management Unit (MMU):&lt;/strong&gt; Oversees physical and virtual memory allocation, employing mechanisms such as paging, demand paging, and swapping to optimize memory utilization.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Virtual File System (VFS):&lt;/strong&gt; Provides an abstraction layer that enables the kernel to support multiple file systems (e.g., ext4, XFS, Btrfs) while maintaining a uniform interface for file operations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Device drivers:&lt;/strong&gt; Act as an interface between hardware components and the operating system, allowing seamless communication between software applications and peripherals such as storage devices, input devices, and network adapters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Networking Stack:&lt;/strong&gt; Implements a suite of network protocols, including TCP/IP, UDP, and SCTP, facilitating reliable data transmission and interconnectivity across devices.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Security Module:&lt;/strong&gt; Enforces access control policies, permissions, and security frameworks such as SELinux (Security-Enhanced Linux) to prevent unauthorized access and mitigate vulnerabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  Operational Mechanisms
&lt;/h2&gt;

&lt;p&gt;The Linux kernel operates through well-defined mechanisms that enable efficient resource management and system performance. Key functionalities include:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Process Management:&lt;/strong&gt; Employs techniques such as process forking, inter-process communication (IPC), and context switching to manage concurrent execution of tasks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Memory Management:&lt;/strong&gt; Utilizes sophisticated memory allocation strategies, including slab allocation, kernel paging, and memory-mapped files, to optimize system performance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Interrupt Handling and Scheduling:&lt;/strong&gt; Implements interrupt request (IRQ) handling to manage asynchronous events and real-time responsiveness.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kernel Space vs. User Space:&lt;/strong&gt; Ensures process isolation by executing core functionalities in kernel space while user applications operate in user space, minimizing security risks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Concurrency and Synchronization:&lt;/strong&gt; Implements synchronization primitives such as mutexes, spinlocks, and semaphores to ensure data consistency in multi-threaded environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why is the Linux kernel ubiquitous?
&lt;/h2&gt;

&lt;p&gt;The Linux kernel’s pervasiveness across diverse domains can be attributed to the following factors:&lt;/p&gt;

&lt;p&gt;Open-Source and Customizability Its open-source nature allows developers to modify, optimize, and tailor the kernel for specific use cases, from embedded systems to enterprise solutions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8gxo91wntu7pqwuk1zkm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8gxo91wntu7pqwuk1zkm.png" alt="Pillars of Linux success" width="800" height="720"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stability and Reliability:&lt;/strong&gt; The kernel is known for its robustness, making it an ideal choice for critical applications such as cloud computing, high-performance computing (HPC), and industrial automation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Security and Access Control:&lt;/strong&gt; Regular updates and security patches, coupled with advanced security modules, ensure a highly secure computing environment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Performance Optimization:&lt;/strong&gt; The kernel's resource management algorithms enhance system performance even in constrained hardware environments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scalability and Portability:&lt;/strong&gt; It supports multiple architectures, including x86, ARM, RISC-V, and PowerPC, enabling deployment on devices ranging from microcontrollers to supercomputers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Extensive Ecosystem and Community Support:&lt;/strong&gt; A thriving developer ecosystem continuously enhances the kernel's capabilities, ensuring long-term sustainability and innovation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The Linux kernel stands as a cornerstone of modern computing, offering unparalleled stability, security, and performance. Its modular architecture, extensive hardware support, and adaptability make it an essential component in a wide range of applications, from mobile devices and IoT systems to enterprise servers and cloud infrastructure.&lt;br&gt;
As technology continues to evolve, the Linux kernel remains at the forefront of innovation, powering mission-critical systems worldwide.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>linux</category>
      <category>kernel</category>
    </item>
    <item>
      <title>Linux File System Explained: Everything You Need to Know</title>
      <dc:creator>Darshan Rathod</dc:creator>
      <pubDate>Mon, 10 Mar 2025 10:55:54 +0000</pubDate>
      <link>https://forem.com/darshan_rathod/linux-file-system-explained-everything-you-need-to-know-487e</link>
      <guid>https://forem.com/darshan_rathod/linux-file-system-explained-everything-you-need-to-know-487e</guid>
      <description>&lt;p&gt;Linux is a robust and versatile operating system that manages data through a well-organized file system. Gaining a solid understanding of the Linux file system is essential for users at all levels, as it enhances navigation, streamlines system administration, and aids in troubleshooting. This guide delves into the Linux file system, covering its structure, core directories, and fundamental file management practices.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What is the Linux File System?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The Linux file system follows a hierarchical directory structure where everything—directories, devices, and even hardware components—is treated as a file. Unlike Windows, which organizes storage using drive letters like C: and D:, Linux operates under a unified structure with a single root directory (/) that encompasses all files and directories.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Linux File System Hierarchy&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The Linux file system follows the Filesystem Hierarchy Standard (FHS), which defines a consistent structure for directories and files. Below is an overview of essential directories with examples:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. / (Root Directory)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The top-level directory from which all other directories branch out.&lt;/p&gt;

&lt;p&gt;Only the root user has full access to modify critical system files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls /
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lists all top-level directories.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. /bin (Binary Executables)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Contains essential system binaries (commands) like ls, cp, mv, rm, and cat.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls /bin

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lists all essential system binaries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. /boot (Boot Loader Files)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Stores files needed for booting the system, including the Linux kernel (vmlinuz), bootloader configuration, and initial RAM disk (initrd).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls /boot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Displays all boot-related files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. /dev (Device Files)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Contains files representing hardware devices (e.g., /dev/sda for the first hard disk, /dev/tty for terminals).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls /dev | grep sda
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lists available storage devices.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. /etc (Configuration Files)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Stores system-wide configuration files and scripts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat /etc/passwd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Displays system user account details.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. /home (User Home Directories)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Contains personal directories for users (e.g., /home/user1, /home/user2).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls /home
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lists all user directories.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. /lib &amp;amp; /lib64 (Shared Libraries)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Stores essential shared libraries required by system programs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls /lib | grep libc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lists shared C library files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. /media &amp;amp; /mnt (Mount Points)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;/media: Used for mounting external devices like USB drives and CDs.&lt;/p&gt;

&lt;p&gt;/mnt: Temporary mount point for manual mounting of filesystems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mount /dev/sdb1 /mnt
ls /mnt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This mounts an external drive and lists its contents.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9. /opt (Optional Software)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Contains software installed by third-party vendors.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls /opt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lists installed optional software.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10. /proc (Process Information)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Virtual filesystem that provides information about running processes and system resources.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat /proc/cpuinfo

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Displays CPU details.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;11. /root (Root User’s Home Directory)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Home directory for the root user.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls /root
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lists files in the root user's home directory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;12. /run (Runtime Data)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Stores volatile runtime information like process IDs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls /run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lists runtime data files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;13. /sbin (System Binaries)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Contains essential system administration commands.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls /sbin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lists administrative commands.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;14. /srv (Service Data)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Stores data related to services like web servers (/srv/www).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls /srv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lists stored service data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;15. /sys (System Information)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Virtual filesystem providing real-time access to kernel and hardware information.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls /sys
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Displays system-related files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;16. /tmp (Temporary Files)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Used for storing temporary files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls /tmp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lists temporary files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;17. /usr (User Binaries and Libraries)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Contains user applications, libraries, documentation, and source code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls /usr/bin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lists user command binaries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;18. /var (Variable Data)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Stores variable files like logs and caches.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls /var/log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lists system logs.&lt;/p&gt;

&lt;h2&gt;
  
  
  File Management in Linux
&lt;/h2&gt;

&lt;p&gt;Understanding file management is essential for effective use of the Linux file system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;File Types in Linux&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Regular Files (-************************): Text, binary, and executable files.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Directories (d************************): Containers that hold files.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Symbolic Links (l************************): Pointers to other files.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Special Files:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Character devices (c): /dev/tty&lt;/p&gt;

&lt;p&gt;Block devices (b): /dev/sda&lt;/p&gt;

&lt;p&gt;Named pipes (p), sockets (s)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important File Operations with Examples&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Viewing Files:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat filename
less filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Copying Files:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cp source.txt destination.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Moving/Renaming Files:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mv oldname.txt newname.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Deleting Files:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rm filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Changing File Permissions:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod 755 script.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Changing File Ownership:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chown user:group filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Creating a Symbolic Link:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ln -s /path/to/file linkname
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Finding Files:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;find / -name "file.txt"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Checking Disk Usage:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;df -h
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Linux file system is well-organized and follows a standardized hierarchy that makes file management efficient. By understanding the structure, directories, and file handling commands, users can navigate and manage their Linux systems effectively. Whether you are a beginner or an intermediate user, mastering the Linux file system is a crucial step in your Linux journey.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>Darshan Rathod</dc:creator>
      <pubDate>Thu, 06 Mar 2025 08:48:00 +0000</pubDate>
      <link>https://forem.com/darshan_rathod/-2b90</link>
      <guid>https://forem.com/darshan_rathod/-2b90</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/darshan_rathod" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2912909%2Fa47bf116-ac25-44e3-b245-7bc917d8f9b6.JPG" alt="darshan_rathod"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/darshan_rathod/object-detection-with-esp32-ai-thinker-and-edge-impulse-50h2" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Object Detection with ESP32-AI Thinker and Edge Impulse&lt;/h2&gt;
      &lt;h3&gt;Darshan Rathod ・ Mar 6&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#esp32&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#edgeimpulse&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>esp32</category>
      <category>edgeimpulse</category>
    </item>
    <item>
      <title>Object Detection with ESP32-AI Thinker and Edge Impulse</title>
      <dc:creator>Darshan Rathod</dc:creator>
      <pubDate>Thu, 06 Mar 2025 06:53:09 +0000</pubDate>
      <link>https://forem.com/darshan_rathod/object-detection-with-esp32-ai-thinker-and-edge-impulse-50h2</link>
      <guid>https://forem.com/darshan_rathod/object-detection-with-esp32-ai-thinker-and-edge-impulse-50h2</guid>
      <description>&lt;p&gt;In this blog, we will explore how to leverage the ESP32-AI Thinker module with Edge Impulse to create an intelligent object detection system. We will walk through the entire process—from capturing images using an ESP32 web server, training a model using Edge Impulse, deploying the model as an Arduino library, and running real-time object detection on the ESP32 module.&lt;/p&gt;

&lt;p&gt;This guide is perfect for developers, IoT enthusiasts, and makers who want to bring AI-powered vision capabilities to embedded systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Prerequisites&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Hardware Requirements:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;ESP32-AI Thinker module (ESP32-CAM)&lt;/li&gt;
&lt;li&gt;USB-TTL module (for flashing firmware)&lt;/li&gt;
&lt;li&gt;Jumper wires (for connections)&lt;/li&gt;
&lt;li&gt;Computer (for programming and training)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Software Requirements:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Arduino IDE (with ESP32 board support installed)&lt;/li&gt;
&lt;li&gt;Edge Impulse Studio (free account required)&lt;/li&gt;
&lt;li&gt;Eloquent Web Server Example for ESP32 (to capture images)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 1: Setting Up an ESP32 Web Server for Data Collection
&lt;/h2&gt;

&lt;p&gt;To train a machine learning model effectively, we need a high-quality dataset with multiple images of the target object under various lighting conditions and angles.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Use a Web Server?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of manually transferring images, we will create a local web server on the ESP32 module. This will allow us to capture images directly from a browser and store them on a local machine for dataset creation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Implementation:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set up an ESP32 Web Server using an eloquent example from the ESP32-CAM library.&lt;/li&gt;
&lt;li&gt;Connect to the ESP32’s WiFi hotspot and access the camera feed via a browser.&lt;/li&gt;
&lt;li&gt;Capture multiple images by clicking a button on the web interface.&lt;/li&gt;
&lt;li&gt;Download the images and store them on your PC for further processing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ensure you capture images with different backgrounds, lighting conditions, and orientations to improve model accuracy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Upload the Dataset to Edge Impulse for Model Training
&lt;/h2&gt;

&lt;p&gt;Once we have collected a diverse dataset, we will upload it to Edge Impulse for processing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Steps:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Sign up/Login to Edge Impulse Studio.&lt;/li&gt;
&lt;li&gt;Create a new project and select ESP32-AI Thinker as the target device.&lt;/li&gt;
&lt;li&gt;Upload the dataset (captured images) to Edge Impulse.&lt;/li&gt;
&lt;li&gt;Label the images appropriately (e.g., "Object Detected", "No Object").&lt;/li&gt;
&lt;li&gt;Train the model and benchmark its performance.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Edge Impulse will optimize the dataset, extract features, and train a model for real-time object detection.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Deploy the Trained Model to ESP32 (Arduino Library)
&lt;/h2&gt;

&lt;p&gt;Once the model is trained and validated, we need to deploy it to the ESP32 module. Edge Impulse provides a precompiled Arduino library that can be directly used in your ESP32 sketch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deployment Process:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to the Deployment section in Edge Impulse.&lt;/li&gt;
&lt;li&gt;Select Arduino Library as the export format.&lt;/li&gt;
&lt;li&gt;Download the .zip file containing the trained model.&lt;/li&gt;
&lt;li&gt;Extract and add the library to Arduino IDE.&lt;/li&gt;
&lt;li&gt;Include the Edge Impulse library in your ESP32 sketch.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 4: Flash the Model onto ESP32 and Test Object Detection
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Time to See AI in Action!&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Arduino IDE and select the ESP32-CAM board.&lt;/li&gt;
&lt;li&gt;Modify the ESP32 sketch to initialize the camera and run inference using the Edge Impulse model.&lt;/li&gt;
&lt;li&gt;Compile and upload the firmware to the ESP32 module.&lt;/li&gt;
&lt;li&gt;Open the Serial Monitor and check the real-time object detection output.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The ESP32 will now process live images, detect objects, and display accuracy levels in the serial monitor.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion &amp;amp; Future Enhancements
&lt;/h2&gt;

&lt;p&gt;By following this workflow, we have successfully implemented &lt;strong&gt;AI-powered object detection&lt;/strong&gt; on the ESP32-AI Thinker module using &lt;strong&gt;Edge Impulse&lt;/strong&gt;. This method enables embedded systems to leverage &lt;strong&gt;computer vision&lt;/strong&gt; for applications such as:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Smart home automation&lt;br&gt;
✅ Security &amp;amp; surveillance&lt;br&gt;
✅ Robotics &amp;amp; AI-powered assistants&lt;br&gt;
✅ Industrial quality control&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>esp32</category>
      <category>edgeimpulse</category>
    </item>
  </channel>
</rss>
