Login / Signup

Embedded Linux - Linux Operating System for Microcontrollers

Embedded Linux

Embedded Linux - Linux Operating System for Microcontrollers - Linux and uclinux

Linux has become very popular because it was launched as a free open source project developed by a group of very passionate programmers. It can run on different systems, from PDAs to basic computers. Now it is described as a fully portable and versatile OS.
Embedded Linux refers mostly to Linux Kernel which is the basic of every operating system. For embedded applications it is customized for every microprocessor. ARM is one of the processor that is very used with Linux as an application processor system. Some big pluses for it are the support for multiprocessor systems and concurrently execute applications.
Embedded Linux is used by a lot of companies for hardware specific application platforms; e.g. Freescale use it for i.MX platforms.
uClinux (Microcontroller Linux) is a variant of Linux system without a Memory Management Unit (MMU). It was first created starting from Linux 2.0 kernel. Today uClinux is available for 2.0, 2.4 and 2.6 Linux kernel releases. When no MMU support is present, the user and kernel space is the same thing; also no virtual memory subsystem is required because all codes
run at Privilege Level 0. A basic operating system has different privilege levels: kernel space runs on Supervisor Mode and user applications on User Mode. Only kernel space has direct access to resources, memory and I/O.


Linux on Hardware
Fig1. Linux on Hardware


How to make the difference between Linux for PC machine and Linux for embedded application?
First of all you must know that an embedded system usually doesn’t have a monitor and keyboard/mouse for User Interface interaction. Embedded applications use analog/digital input/output connections with real world, buttons and switch for input data, UART/LAN/USB/etc protocols for data transfer.


Input/Output on PC Machine vs Embedded System
Fig.2 Input/Output on PC Machine vs Embedded System (Example)



The Bootloader
One of the most important components of any embedded application is the Bootloader. Its main functions are: hardware board initialization, loading and starting the Kernel from ROM memory. ROM memory is used because it is a non-volatile memory (does not require power to maintain the content).


Fig.3 Bootloader is located on first addresses.
Fig.3 Bootloader is located on first addresses.


How to write a Linux Driver
Every Linux driver, also called module, need to have two basic functions: init_module() and cleanup_module().
Example of a basic Hello eLinux:

#define MODULE
int init_module(void)      
	printk("Hello eLinux \n");     
	return 0; 
void cleanup_module(void)  
	printk("Goodbye eLinux\n"); 

For the integration on the Linux Kernel we need to make one more operation:
- insmod (insert driver)
To remove the driver the following command must be executed:
- rmmod (remove driver)
For checking if the driver was correctly integrated:
- lsmod list all current drivers)
Evaluation Board
A great development board with ARM processor is provided by Cirrus Company. The EP9312 is an ARM920T-based system-on-chip which runs at 200MHz. Some peripherals for interfacing with real world are also provided: Ethernet, USB Hosts, Display, ADC.
Documentation link

EP9312: ARM9, System-on-Chip Processor with Integrated IDE
Fig.4 EP9312: ARM9, System-on-Chip Processor with Integrated IDE

Read the Italian version: Embedded Linux - Sistema Operativo Linux per Microcontrollori - Linux e uClinux

Boards Running Linux

Interesting related article about the "hardware of embedded Linux"

Boards Running Linux

Cirrus ARM9

Cirrus ARM9 is an amazing microcomputer.... I saw Asterisk and Open Office running on it!

Who's online

There are currently 0 users and 27 guests online.

Recent comments