News Archive (1999-2012) | 2013-current at LinuxGizmos | Current Tech News Portal |    About   

Coding differences between Linux and uClinux

Aug 13, 2004 — by LinuxDevices Staff — from the LinuxDevices Archive — 196 views

Linux Journal has published an article outlining some differences between Linux and uClinux programming. Although now a configuration-time option in the mainstream Linux kernel, uClinux is quite different from Linux. This article explains how, and could serve as a great quick-start guide for new uClinuxers.

Some of differences discussed include:

  • Memory management differences — uClinux was primarily developed for systems without MMUs (memory management units), and so does not use virtual memory. uClinux processes can not increase their available memory during runtime, and memory is not managed — any process can access any part of the memory, potentially crashing other processes or the OS. uClinux also cannot use swap memory — though uClinux usually lack hard drives anyway.
  • Kernel differences — uClinux does not support memory paging, or tmpfs. The standard Linux ELF format is replaced with the “flat format.” Device drivers often require changes when used with uClinux. The kernel's mmap is also quite different, and uClinux programmers must avoid certain file copying inefficiencies.
  • Memory Allocation (kernel and application) — uClinux offers an alternative memory allocator for small systems, and can also use the default Linux allocator.
  • Applications and processes — uClinux lacks a fork() system call, so developers must learn to use vfork(), and porting applications that use fork() can be quite difficult. On the upside, uClinux supports XIP (execute in place) on platforms where the toolchain supports it. XIP radically reduces memory usage by running applications directly from ROM rather than first copying them to memory.
  • Shared libraries — Shared libraries are quite different under uClinux, although the article does not delve into the specifics.

The article concludes with the suggestion that programmers interested in uClinux start out with a hardware emulator such as copilot, and then find some inexpensive hardware such as a Palm Pilot (or, perhaps, an Apple iPod?) on which to experiment.

Read full story


 
This article was originally published on LinuxDevices.com and has been donated to the open source community by QuinStreet Inc. Please visit LinuxToday.com for up-to-date news and articles about Linux and open source.



Comments are closed.