Archive | Linux RSS feed for this section

One Second Cold Linux Boot with OpenCV

As a means to demonstrate our boot time reduction skills, last November we put together a demo which shows an Embedded Linux device cold-booting in less than a second.

The demo consists of an ARM Cortex-A9 based device connected to a camera, 7-segment display and HDMI display. The device uses the camera along with OpenCV based software to count the number of yellow balls present on the table beneath and display the count on the 7-segment display. The device also outputs the camera image and ball detection illustration on the LCD display.

The device is able to do all this within one second of software reset, here is the video:

We’ve put lots of information on how we achieved this on our Boot Time Demos page which can be found here.

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Slashdot
  • Reddit
  • Twitter
  • email
  • LinkedIn
Continue Reading →

Scripted Modification of Kernel Configs

Whilst recently making changes to an embedded Linux distribution I came across a modest but very powerful feature of the kernel’s tried and test Kconfig system. What I discovered was a script that allows for scripted modification of kernel configuration files, i.e. .config and *_defconfig files.

The script, which first appeared in the 2.6.29 kernel can be found in the kernel’s scripts/ directory and its usage is very straight forward. Here are some examples:

# Enable timing information on printk's
./scripts/config --enable CONFIG_PRINTK_TIME

# Change the path of the initramfs
./scripts/config --set-str CONFIG_INITRAMFS_SOURCE ../fs

# Increase the size of the kernel log buffer
./scripts/config --set-val CONFIG_LOG_BUF_SHIFT 14

# Enable LZO compression for SquashFS in ~/test_defconfig
./scripts/config --file ~/test_defconfig --enable CONFIG_SQUASHFS
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Slashdot
  • Reddit
  • Twitter
  • email
  • LinkedIn
Continue Reading →

Using ‘delay_use’ to speed up USB Enumeration

Whilst investigating ways to improve the cold boot time of embedded Linux I came across a little known control parameter of the USB stack known as ‘delay_use‘. It’s a parameter that describes the amount of time given to Mass Storage Devices to allow them to ‘settle down’ before being used. This article examines ‘delay_use’ and identifies how it may be used to reduce boot time and improve responsiveness.

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Slashdot
  • Reddit
  • Twitter
  • email
  • LinkedIn
Continue Reading →

Understanding “vmalloc region overlap”

I recently came across the following disconcerting message in my kernel’s boot output:

Truncating RAM at 40000000-5fffffff to -57ffffff (vmalloc region overlap).
...
Kernel command line: console=ttySC0,115200 mem=512M
...
Memory: 384MB = 384MB total

Which is the kernel’s way of saying “I understand there may be some RAM here – but I’m not going to use it all”. So what is the cause of this warning? And what do we need to do to reclaim that lost RAM?

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Slashdot
  • Reddit
  • Twitter
  • email
  • LinkedIn
Continue Reading →

A nasty string initialization bug in C

Today I encountered a bug that was quite difficult to find regarding strings. In order for strings to work they must be null-terminated, and this implies that an array of characters can contain a string with a length equal to the array size minus one, because there must be space for the null character. I found out that, when initializing array of chars with strings, the compiler does not complain if just the null character doesn’t fit.

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Slashdot
  • Reddit
  • Twitter
  • email
  • LinkedIn
Continue Reading →

Writing an MLO for a BeagleBoard XM

Before I started playing with the BeagleBoard XM I’ve had never booted a board directly from an MMC card and I didn’t have a clue what an ‘MLO’ file was. After some research on the internet it seemed apparent that it was used in place of the traditional first stage boot loader: XLoader. In fact it in most cases it is XLoader – a quick invocation of my toolchain’s string implementation seemed to correlate with this:

$ arm-none-linux-gnueabi-strings /media/boot/MLO | grep X-Loader
()*+,-./0123456789:;< =>?Texas Instruments X-Loader 1.5.0 (Mar 27 2011 - 17:37:56)
X-Loader hangs

I was curious as to why it was named MLO, how the board boots into this Image and how I can create my own MLO with some bare metal code. This post answers these questions and results in a very simple executable MLO file. It will probably satisfy those readers who like to understand and write all the code that runs on a board. It’s very easy to use a boot loader like UBoot to obtain and execute an image from an MMC card – but it adds boot time, duplication and complexity. Besides it’s fun to get close to the metal…

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Slashdot
  • Reddit
  • Twitter
  • email
  • LinkedIn
Continue Reading →

The Right Approach to Minimal Boot Times [ELCE Video]

Last year at the ELCE 2010 conference in Cambridge I performed a talk about reducing boot times of embedded Linux devices. The video of this talk has now been posted on-line:


ELCE 2010 – The Right Approach to Minimal Boot Times ELCE Video (Best viewed in Chrome)

The accompanying slides for this presentation can be found here

If you wish to see the accompanying YouTube video – please see my earlier post. [© 2011 embedded-bits.co.uk]

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Slashdot
  • Reddit
  • Twitter
  • email
  • LinkedIn
Continue Reading →

cat /proc/meminfo : MemTotal

Linux manages it’s physical memory in clever and often efficient ways – as a result it’s not uncommon to only think about how the memory in your system is being used when we run into performance issues. And this is where the frustration can begin – without fully understanding how memory is managed, it can be very difficult to answer some seemingly straight-forward questions like ‘How much free memory do I have?‘ or ‘How much memory is this process taking?‘. There are a lot of complications and as a result performance monitoring can be a challenge.

I was determined to fully understand precisely what the various memory figures report by the kernel mean and understand – on a practical level – the implications of Linux’s memory management on our performance sensitive applications. In this multi-part post we’ll attempt to debunk many of the mysteries of Linux’s memory.

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Slashdot
  • Reddit
  • Twitter
  • email
  • LinkedIn
Continue Reading →

validate_sb: bad superblock, error 8

I’ve recently left the dark ages and entered the world of UBI and UBIFS – it’s generally been a pleasant experience. However whilst getting to grips with it, I occasionally recieved the following error upon mount:

# mount -t ubifs /dev/ubi0_1  /tmp/
UBIFS error (pid 1096): validate_sb: bad superblock, error 8
mount: mounting /dev/ubi0_1 on /tmp/ failed: Invalid argument

The usual approach of googling my way out of problems didn’t give me much luck so I did some exploring. The cause of this failure, despite having been successful in flashing the UBIFS image – was that the UBI volume I was using was too small. The solution is therefore to increase the size of the volume.

Unfortunately though, my current project required me to create a UBI volume of only the minimum size to support a given UBIFS image – yet it would seem that determining the minimum size of a UBI volume for a given UBIFS image was not trivial. I had to do some more digging to find the answer…

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Slashdot
  • Reddit
  • Twitter
  • email
  • LinkedIn
Continue Reading →

1 second Linux boot to Qt!

At the end of last year, to demonstrate my company’s swiftBoot service, I put together a rather impressive demo. Using a Renesas MS7724 development board I was able to achieve a one second cold Linux boot to a Qt application. Here’s the demo…

Many people see a demo like this and assume there are ‘smoke and mirrors’ or that we’ve implemented a suspend to disk solution. This is genuinely a cold boot including UBoot (2009-01), Linux kernel (2.6.31-rc7) and Qt Embedded Open Source 4.6.2. We’ve not applied any specific intellectual property but instead spent time analysing where boot delays are coming from and simply optimising them away. The majority of the modifications we make usually fall into the category of ‘removing things that aren’t required’, ‘optimising things that are required’, or ‘taking a new approach to solving problems’ and are tailored very precisely to the needs of the ‘product’.

If you’re interested in exactly what modification I made and a little more about the approach taken – you may be interested in these slides which I presented at ELC-E 2010 – I’m also expecting a video of this presentation to appear on Free Electrons in the near future.

You may also remember my last demo based on an OMAP3530 EVM. [© 2011 embedded-bits.co.uk]

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Slashdot
  • Reddit
  • Twitter
  • email
  • LinkedIn
Continue Reading →