<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:foaf="https://xmlns.com/foaf/0.1/" xmlns:og="https://ogp.me/ns#" xmlns:rdfs="https://www.w3.org/2000/01/rdf-schema#" xmlns:schema="https://schema.org/" xmlns:sioc="https://rdfs.org/sioc/ns#" xmlns:sioct="https://rdfs.org/sioc/types#" xmlns:skos="https://www.w3.org/2004/02/skos/core#" xmlns:xsd="https://www.w3.org/2001/XMLSchema#" version="2.0" xml:base="https://www.linuxjournal.com/tag/firmware">
  <channel>
    <title>Firmware</title>
    <link>https://www.linuxjournal.com/tag/firmware</link>
    <description/>
    <language>en</language>
    
    <item>
  <title>FOSS Project Spotlight: LinuxBoot</title>
  <link>https://www.linuxjournal.com/content/foss-project-spotlight-linuxboot</link>
  <description>  &lt;div data-history-node-id="1339668" class="layout layout--onecol"&gt;
    &lt;div class="layout__region layout__region--content"&gt;
      
            &lt;div class="field field--name-field-node-image field--type-image field--label-hidden field--item"&gt;  &lt;img src="https://www.linuxjournal.com/sites/default/files/nodeimage/story/12281f2.png" width="550" height="317" alt="LinuxBoot chart" typeof="foaf:Image" class="img-responsive" /&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-author field--type-ds field--label-hidden field--item"&gt;by &lt;a title="View user profile." href="https://www.linuxjournal.com/users/david-hendricks-0" lang="" about="https://www.linuxjournal.com/users/david-hendricks-0" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;David Hendricks&lt;/a&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"&gt;&lt;p&gt;&lt;em&gt;Linux as firmware.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;
The more things change, the more they stay the same. That may sound
cliché, but it's still as true for the firmware that boots your operating
system as it was in 2001 when &lt;em&gt;Linux Journal&lt;/em&gt; first published Eric
Biederman's "&lt;a href="https://www.linuxjournal.com/article/4888"&gt;About
LinuxBIOS&lt;/a&gt;". LinuxBoot is the latest incarnation of an idea that has
persisted for around two decades now: use Linux as your bootstrap.
&lt;/p&gt;

&lt;p&gt;
On most systems, firmware exists to put the hardware in a state where an
operating system can take over. In some cases, the firmware and OS are
closely intertwined and may even be the same binary; however, Linux-based
systems generally have a firmware component that initializes hardware
before loading the Linux kernel itself. This may include initialization
of DRAM, storage and networking interfaces, as well as performing
security-related functions prior to starting Linux. To provide some
perspective, this pre-Linux setup could be done in 100 or so instructions
in 1999; now it's more than a billion.
&lt;/p&gt;

&lt;p&gt;
Oftentimes it's suggested that Linux itself should be placed at the
boot vector. That was the first attempt at LinuxBIOS on x86, and it looked
something like this:

&lt;/p&gt;&lt;pre&gt;
&lt;code&gt;
#define LINUX_ADDR 0xfff00000; /* offset in memory-mapped NOR flash */
void linuxbios(void) {
       void(*linux)(void) = (void *)LINUX_ADDR;

       linux();  /* place this jump at reset vector (0xfffffff0) */
}
&lt;/code&gt;
&lt;/pre&gt;


&lt;p&gt;
This didn't get very far though. Linux was not at the point where it
could fully bootstrap itself—for example, it lacked functionality to
initialize DRAM. So LinuxBIOS, later renamed coreboot, implemented the
minimum hardware initialization functionality needed to start a kernel.
&lt;/p&gt;

&lt;p&gt;
Today Linux is much more mature and can initialize much more—although not
everything—on its own. A large part of this has to do with the need to
integrate system and power management features, such as sleep states and
CPU/device hotplug support, into the kernel for optimal performance and
power-saving. Virtualization also has led to improvements in Linux's
ability to boot itself.
&lt;/p&gt;

&lt;h3&gt;
Firmware Boot and Runtime Components&lt;/h3&gt;

&lt;p&gt;
Modern firmware generally consists of two main parts: hardware
initialization (early stages) and OS loading (late stages). These parts
may be divided further depending on the implementation, but the overall
flow is similar across boot firmware. The late stages have gained many
capabilities over the years and often have an environment with drivers,
utilities, a shell, a graphical menu (sometimes with 3D animations)
and much more. Runtime components may remain resident and active after
firmware exits. Firmware, which used to fit in an 8 KiB ROM, now contains
an OS used to boot another OS and doesn't always stop running after
the OS boots.
&lt;/p&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-link field--type-ds field--label-hidden field--item"&gt;  &lt;a href="https://www.linuxjournal.com/content/foss-project-spotlight-linuxboot" hreflang="und"&gt;Go to Full Article&lt;/a&gt;
&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;

</description>
  <pubDate>Thu, 15 Feb 2018 15:12:50 +0000</pubDate>
    <dc:creator>David Hendricks</dc:creator>
    <guid isPermaLink="false">1339668 at https://www.linuxjournal.com</guid>
    </item>
<item>
  <title>Updating the Firmware of Linux-Based Devices</title>
  <link>https://www.linuxjournal.com/content/updating-firmware-linux-based-devices</link>
  <description>  &lt;div data-history-node-id="1084511" class="layout layout--onecol"&gt;
    &lt;div class="layout__region layout__region--content"&gt;
      
            &lt;div class="field field--name-field-node-image field--type-image field--label-hidden field--item"&gt;  &lt;img src="https://www.linuxjournal.com/sites/default/files/nodeimage/story/figure-1.png" width="447" height="480" alt="chart" typeof="foaf:Image" class="img-responsive" /&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-author field--type-ds field--label-hidden field--item"&gt;by &lt;a title="View user profile." href="https://www.linuxjournal.com/users/viktar-palstsiuk-0" lang="" about="https://www.linuxjournal.com/users/viktar-palstsiuk-0" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;Viktar Palstsiuk&lt;/a&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"&gt;&lt;p&gt;
This tutorial provides a general description of updating
Linux-based firmware and illustrates it with some specific implementations.
First, consider the sections of the memory system (Figure 1) and parts of
memory that should be updated while transferring software to a new
version.
&lt;/p&gt;&lt;p&gt;
Typically, a Linux-based system has the following structure of
volatile memory. The first section is filled with a Linux kernel
loader, which in turn can be executed in several stages. For example,
a small-size bootloader is copied to the CPU internal memory, performs
initialization of external memory and copies the second-level loader to
the external RAM. The second-level loader (for example, U-Boot) copies
the Linux kernel to RAM and hands over control to it. Finally, the
system launches custom applications stored in the last section of the
Flash memory. So obviously, it's necessary to update the memory
sections with user applications and the OS kernel.
&lt;/p&gt;

&lt;img src="https://www.linuxjournal.com/files/linuxjournal.com/ufiles/imagecache/large-550px-centered/u1002061/figure-1.png" alt="" title="" class="imagecache-large-550px-centered" /&gt;&lt;p&gt;
Figure 1. Sections of the Flash Memory of a Linux-Based Device
&lt;/p&gt;
&lt;p&gt;Events for starting the update process include:
&lt;/p&gt;&lt;ul&gt;&lt;li&gt;System launch (in this case, the update application is built in to the
bootloader or runs at the OS initialization).
&lt;/li&gt;&lt;li&gt;
Connection of external media (USB or SD card) during the operation.
&lt;/li&gt;&lt;li&gt;
Detection of a newer version of the software on the update server.
&lt;/li&gt;&lt;li&gt;
User operations.
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
You can copy update files though plug media or receive them over the
network (in case the system is fitted with an Ethernet port or a Wi-Fi
module). Usually, this procedure uses the TFTP protocol widely supported
by various loaders. If you perform the update process using a program
in the OS, you can copy the necessary files from the server using the
wget application or the libcurl library.
&lt;/p&gt;&lt;p&gt;
An important part of the update process is checking the version of the
received files and their integrity. You can do this using such algorithms
as MD5, CRC32 and so forth. I also advise checking the compatibility of the new
firmware with the device (PCB revision).
&lt;/p&gt;&lt;p&gt;
&lt;em&gt;Option 1:&lt;/em&gt; if you have ROM capacity sufficient for storing the
old and new firmware (Figure 2), the system implements the option with the
possibility of going back to the previous version of the software in case
of upgrade process failure. Memory is overwritten using flash_eraseall
(for erasing the memory) and nandwrite (for writing images to the NAND
memory), which are included in the mtd-utils package.
&lt;/p&gt;&lt;p&gt;
When update files are received and checked, you can start the process
of writing them to the system ROM. You can implement various software
update options, depending on ROM capacity.
&lt;/p&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-link field--type-ds field--label-hidden field--item"&gt;  &lt;a href="https://www.linuxjournal.com/content/updating-firmware-linux-based-devices" hreflang="und"&gt;Go to Full Article&lt;/a&gt;
&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;

</description>
  <pubDate>Wed, 24 Apr 2013 14:29:16 +0000</pubDate>
    <dc:creator>Viktar Palstsiuk</dc:creator>
    <guid isPermaLink="false">1084511 at https://www.linuxjournal.com</guid>
    </item>

  </channel>
</rss>
