Intermec ck1 Reference Guide

Page of 390
Appendix A — 
µClinux System 
300 
CK1 SDK Programmer’s Reference Manual 
Memory Management in General Purpose Linux 
The different processes all require part of available memory from the 
system. Most often a computer offers some continuous space of physical 
RAM and a separate memory management unit (MMU) that distributes 
this memory over the different tasks. The MMU maps virtual pages to 
physical page frames, which allows processes to have their own virtual 
address spaces. Virtual memory allows this address space to be larger than 
the available physical memory and protects this space from other processes. 
The physical memory, RAM in Linux, is divided into two parts. The first 
block is permanently assigned to the kernel image. This block contains the 
kernel code and the static data structures. The remaining part is called 
dynamic memory. This part is used not only by the processes, but also by 
the kernel. In the processes, the block is used to request generic memory 
areas. The kernel uses this block for dynamic kernel structures like buffers 
and file descriptors. One of the major issues concerning the whole system 
is how efficiently the dynamic memory area is managed by the operating 
system. 
The main idea behind the virtual memory is to have a secondary memory 
big enough to store the complete program. Also there has to be a way that 
changes made to a program in main physical memory are also reflected in 
the original one. The available physical memory is divided into fixed-
length partitions called page frames. In the same way, the virtual memory 
is partitioned into equal size pages, each piece being the same size as the 
page frames. When the program points to an address that is not located in 
the physical memory, the contents of the main memory is stored in to the 
secondary memory. The memory area is the located and loaded to the 
main memory. The address maps are changed. This technique is called 
paging and done by the operating system so that it is invisible to you. A 
memory map is the one that relates the virtual memory addresses to 
physical ones.  
File Systems 
The Linux environment is a file oriented operating system. Almost every 
service and device can be accessed trough a file, which means that devices 
like printers, serial ports, and disks can be used as a regular file. Linux also 
provides access rights settings for files and folders, which can be set 
separately for read, write, and execute. This functionality allows protection 
for system files and can limit the access for certain devices. The files under 
the Linux system are all placed hierarchically in directories where the root 
directory contains all of the system files under the subdirectories. The 
Linux source tree denotes directory names containing information about 
the files beneath it. Usually Linux contains at least directories for 
executable programs (./bin), directory for physical devices (./dev), a 
directory for configuration files (./etc), and a specific directory for libraries 
(./lib).