applications performing dynamicmemory allocation is to replace
calls with requests from apreallocated buffer pool.Finally, since virtual memory is not usedin uClinux, swapping pages in and out ofmemory is not implemented, as noguarantee can be given that the pageswould be loaded to the same location inRAM. In embedded systems it is, in anycase, most likely unacceptable tosuspend an application in order to usemore RAM than is physically available.The role of the MMU to act as a level ofprotection for software should never beminimized. One of the largest difficultiesfaced by the developer of an MMU-lesssystem is the result of invalid programpointers triggering an address error andpotentially corrupting or downing asystem. Obviously, this is undesirableand as such requires code to beprogrammed and diligently tested toensure robustness.Each step of development must becarefully mapped out, an overview ofthis cycle provides insight.First, as one might guess, support withinthe code for an MMU needs to be turnedoff. To account for this change uClinuxprovides new code for the memorymanagement subsystem of the kernel.Essentially, uClinux provides basicmemory management functions withinthe kernel software itself. For thosefamiliar with uClinux or a Unix likesystem, this is the role of the directory
derived from and replacing
.New strategies also must be developedfor operations like releasing memoryafter a process ends or allocatingmemory to a new process.Changes to the kernel are necessary torun userspace programs. Someprogram loaders, such as those for ELFand COFF, require modifications. Newloaders are required for these formats(i.e.:
. Futhermore,since child processes run in the sameaddress space as their parents, thebehaviour of both may requiremodification.
Within uClinux, the lack of memorymanagement hardware on a targetprocessor has meant that somechanges needed to be made to thesystem interface. Perhaps the greatestdifference is the absence of the
system calls.A call to
clones a process tocreate a child. Under Linux,
isimplemented using copy_on_writepages. Without an MMU, uClinux cannotcompletely and reliably clone a process,nor does it have access to copy-on-write.In the case of uClinux, it implements aversion of BSD’s
in order tocompensate for the lack of
When a parent process calls
to create a child, both processes shareall their memory space including thestack.
then suspends theparent's execution until the child processeither calls
Notethat multitasking is not otherwiseaffected. It does, however, mean thatolder-style network daemons that makeextensive use of
must bemodified. Since child processes run inthe same address space as theirparents, the behavior of both processesmay require modification in particularsituations.Many modern programs rely on childprocesses to perform basic tasks,allowing the system to maintain aninteractive "feel" even if the processingload is quite heavy. Such programs mayrequire substantial reworking to performthe same task under uClinux. If a keyapplication depends heavily on such