uCLinux (U-see-Linux) - An Intro
August 20, 2011 by shahina
ShareThis
The Linux/Micro-controller project is a port of Linux to systems without Memory Management Unit. uClinux was originally created by D. Jeff Dionne and Kenneth Albanowski in 1998. uClinux is first ported to Motorola MC68328: Dragon Ball Integrated Microprocessor on 2.0.33 kernel. The first target system to successfully boot is the Palm Pilot using a TRG Super Pilot Board with a custom boot-loader created specifically for Linux/Palm Pilot port.

The original uClinux was a derivative of Linux 2.0 kernel intended for micro controllers without MMU and inherits the Linux legacy reliability and portability. Linux/Microcontroller Project has grown both in brand recognition and coverage of processor architectures. Today's uClinux as an operating system includes Linux kernel releases for 2.0 2.4 and 2.6 as well as a collection of user applications, libraries and tool chains. It supports TCP/IP networking. uClinux is a Open-source software and the extensions are licensed under the GPL like the Linux kernel.
Some of the processors on which the port has been made are :
- Altra NIOS
- ADI Blackfin
- ARM
- Freescale M68K including DragonBall, ColdFire and others
- Inteli960
- Xilinx MicroBlaze
- MIPS
Some Commercial Applications of uClinux




uClinux Vs Linux
uClinux is developed for embedded systems with no Memory Management Unit (MMU). Unlike Linux, where memory management is achieved through the use of virtual memory (VM), uClinux was created for systems that do not support VM. As because there is no MMU, memory protection is not possible. It is possible for any application or the kernel to corrupt any part of the system. Some CPU architectures allow certain I/O areas, instructions and memory regions to be protected from user programs but that is not guaranteed. Even worse than the corruption that crashes a system is the corruption that goes unnoticed. It is extremely difficult to track such random inter-process corruption. Without VM, swap is effectively impossible, although this limitation is rarely an issue on the kinds of systems that run uClinux. They often do not have hard drives or enough memory to make swap worthwhile.
uClinux make use of uClibc, a lightweight C library for embedded applications instead of glibc which is used in Linux. uClibc was originally developed for uClinux but later it was made as independent project. Ex: For ARM uClibc occupies 400KB size where as glibc occupies 1700KB and the application Busybox linked with uClibc occupies 311KB while with glibc occupies 843KB.
uClinux does not support all the standard executable formats such as ELF because they make use of VM features which is not available in uclinux. Instead it support only binary file format i.e. flat format, An executable format that stores only executable code, data and the relocation information needed to load the executable into any location in memory. Flat format provides some options which are not available in the normal elf executables in Linux. There are two flavours of flat format:
- Fully relocated Binary (FRB) - have relocations for its code
- Position-Independent code (PIC) - requires only few relocations for its data.
uClinux supports XIP(Execute in place) which suits for embedded systems. In XIP, the application can be executed directly from Flash or ROM which requires a minimum amount of memory as application requires memory only for its data. This allows the text or code to be shared between multiple instances of application. To make use of XIP, the platform requires compiler support and PIC flat format. XIP is supported by only romfs as the application needs to be contiguously stored.
Memory allocation methods like malloc() and mmap()are different and are transparent to the user in uClinux compared to the Linux Kernel. There are certain limitations using these functionalities. Incorrect use of the functionalities can lead to fragmentation which cannot be removed hence precautions needed which using it.
uClinux make use of vfork () instead of fork(). Though there are some similarities between these two, still there are some differences which we need to look after. When replacing fork () with vfork (), care must be taken when application does not fork and it exec() immediately. Also there is a possibility of data corruption as child shares parent’s memory and data.
In uClinux, there is no difference between process address space and kernel address space which is advantage for the applications as they can access the low-level functions directly but this can be disadvantage too as there is a possibility of memory corruption.
uClinux supports the file systems like NFS, ext2, Romfs and jffs etc. Unlike Linux which supports tempfs, uClinux doesn’t support tempfs as it runs on VM.
Advantages:
- Open- source Software.
- It is Light-weighted and suitable for deeply embedded applications systems which have less resources like less processing power and less memory.
- It is cheaper as there is no Memory Management Unit
- Unrestricted access to hardware for user applications
- Supports XIP
- Faster context switching as no MMU less and shared address space, flushing will not happen during context switch
- Most of the applications for Linux can be easily ported to uClinux
Disadvantages:
- No memory protection for kernel and applications as no MMU.
- No paging support.
- Processes cannot be expanded at runtime as there may be other processes above and below it.

Comments
Good One..
August 25, 2011 by Benjie (not verified), 25 weeks 6 days ago
Comment: 371
A good article on UCLinux...
Please write one more article on how to handle illegal memory access violations in UCLinux since MMU is not available.
Good one
August 24, 2011 by Vasudha Bhat (not verified), 26 weeks 1 day ago
Comment: 366
OS without MMU., interesting topic. thank u for showing some light on this. Nice job done:), very good and informative article about U-See-Linux, It also covers the differences between Uclinux and linux, applications, usage, etc etc...Very good article to read.
Good article to get awareness
August 23, 2011 by Mohammad Rafi (not verified), 26 weeks 1 day ago
Comment: 360
Good article to get awareness abt UcLinux.. Wishing more articles
Shahina.. you done comendable
August 23, 2011 by Viren Prajapati (not verified), 26 weeks 1 day ago
Comment: 359
Shahina.. you done comendable job by Submitting this article on ucLinux "one of Linux patrimony".It's given with comprehensive technological aspect and it's well written.And once again you carry it off well as Expected.As I am perennial hungry to get knowledge on Linux.. I am very much glad by reading. Please keep on writting such articles n share your knowledge with us "at least with me 'lol'"..And it's another good adoption of yours. Best luck.. Looking forward to other articles of yours.
Nice one dear... very much
August 23, 2011 by Anand Pai V (not verified), 26 weeks 1 day ago
Comment: 355
Nice one dear... very much informative... Do write more... All the best!!!
uclinux
August 23, 2011 by Sathish Kannan.B (not verified), 26 weeks 1 day ago
Comment: 358
super article..
please submit many more article like this
Post new comment