Understanding “vmalloc region overlap”

August 16th, 2011 by Andrew Murray

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?

Read the rest of this entry »

  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Slashdot
  • Reddit
  • Technorati
  • StumbleUpon
  • Twitter

A nasty string initialization bug in C

August 7th, 2011 by Francesco Balducci

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.

Read the rest of this entry »

  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Slashdot
  • Reddit
  • Technorati
  • StumbleUpon
  • Twitter

embedded-bits.co.uk embraces Twitter!

August 7th, 2011 by Andrew Murray
Embedded-bits.co.uk embraces Twitter

Embedded-bits.co.uk embraces Twitter

Embedded-bits.co.uk has joined Twitter! I thought it would be a great way to get to know my readers and to share with you the blog posts I write.

When it comes to developing for embedded devices – it can be quite difficult to find good documentation or informative articles on the things we really need to know. I’m hoping that we can use Twitter to share links to the useful nuggets of information that we come across during our travels across the internet.




I will look forward to seeing you on Twitter! [© 2011 embedded-bits.co.uk]

  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Slashdot
  • Reddit
  • Technorati
  • StumbleUpon
  • Twitter

Turning on an ARM MMU and Living to tell the tale: The code

July 27th, 2011 by Andrew Murray

Turning on the MMU

In my last post we looked at the basic theory of an MMU and what it can do for us. In this post we are going to produce and understand the absolute minimum amount of code required (just 20 lines of assembler) to turn on an ARM MMU and come out the other side in one piece.

Read the rest of this entry »

  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Slashdot
  • Reddit
  • Technorati
  • StumbleUpon
  • Twitter

Turning on an ARM MMU and Living to tell the Tale: Some Theory

July 24th, 2011 by Andrew Murray
MMU Enabled

MMU Enabled

In my last post I wrote some bare metal code which ran on a BeagleBoard xM as an MLO – I’d like to extend this by running this code with the MMU switched on. I want to write the absolute minimum amount of code required to turn on an ARM MMU and to come out the other side in one piece. This post describes the basic principles of operation of an MMU – we’ll come on to writing code in my next post.

One of the most fundamental tasks of an MMU is to translate virtual addresses into physical addresses. How virtual addresses map onto physical addresses is entirely a matter of software design – the ARM MMU design provides great flexibility for helping you in this area. Just to illustrate this and to demonstrate the capability of these MMUs, I’ve come up with some perfectly valid schemes (though some of which at first may seem nonsensical):

Read the rest of this entry »

  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Slashdot
  • Reddit
  • Technorati
  • StumbleUpon
  • Twitter

Contributors Wanted!

July 23rd, 2011 by Andrew Murray
Your Country Needs You

Your Country Needs You

To improve the broadness and frequency of articles on this site – I’m looking for contributors willing to write blog posts for embedded-bits.co.uk. I believe this will make the site a much more attractive place on the internet and a more useful resource for those in interested in our field.

If you are a systems integrator or work in the field of making hardware and stubborn software do something useful – or generally feel you have something to offer (it doesn’t have to be Linux) then I would love to hear from you. As long as you can demonstrate you can write high-quality, original and interesting articles that others will want to read and are willing to do it for nothing but fun – then drop me an email at amurray@theiet.org – feel free to ask any questions in the comments sections. [© 2011 embedded-bits.co.uk]

  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Slashdot
  • Reddit
  • Technorati
  • StumbleUpon
  • Twitter

Writing an MLO for a BeagleBoard XM

July 10th, 2011 by Andrew Murray

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…

Read the rest of this entry »

  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Slashdot
  • Reddit
  • Technorati
  • StumbleUpon
  • Twitter

Software Environment for a BeagleBoard XM with JTAG

July 10th, 2011 by Andrew Murray

Code Composer Studio

In my last blog post I described my rationale for buying a BeagleBoard XM and a compatible JTAG emulator – the XDS100v2. This post follows on from that and describes the steps required for setting up TI’s Code Composer Studio such that you can use the XDS100v2 with the BeagleBoard XM to find out what the board is doing.

Read the rest of this entry »

  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Slashdot
  • Reddit
  • Technorati
  • StumbleUpon
  • Twitter

Hardware Environment for a BeagleBoard XM with JTAG

July 10th, 2011 by Andrew Murray

BeagleBoard XM

I recently decided to embark on writing my own C++ real-time operating system for embedded systems – I’ve so far made some progress using software emulation with QEMU but I feel it’s time to move on to real hardware. I’ve chosen to use the very popular BeagleBoard XM – mostly because it represents incredible value for money given but also due to it’s extensive user community.

This blog post provides an overview of the components required to get started with a BeagleBoard XM and JTAG emulator. I will also include my experience/rationale in selecting and buying the various components required (Board, JTAG Emulator, etc).

Read the rest of this entry »

  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Slashdot
  • Reddit
  • Technorati
  • StumbleUpon
  • Twitter

The Right Approach to Minimal Boot Times [ELCE Video]

March 20th, 2011 by Andrew Murray

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)

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

  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Slashdot
  • Reddit
  • Technorati
  • StumbleUpon
  • Twitter