|
|
YOUR FEEDBACK
SOA World Conference
Virtualization Conference $200 Savings Expire May 16, 2008... – Register Today! Did you read today's front page stories & breaking news?
SYS-CON.TV |
TOP LINKS YOU MUST CLICK ON Linux
Experimenting with MontaVista Linux
Lessons learned by solving a problem
May. 11, 2007 12:00 PM
Digg This!
This article presents my working experience with the MontaVista Linux distribution (MontaVista Professional Edition 4.0 base on the 2.6.10 Linux kernel) running on a PowerPC processor board. It will present the physical memory mapping in Linux and its limitations using examples of a real problem and the suggested implemented solution that involved changes to kernel configuration.
Standard Linux (from www.kernel.org) supports two kinds of real-time schedulers (SCHED_RR, SCHED_FIFO) and the preemptive kernel. The hard real-time additions to the Linux kernel offered by MontaVista makes Linux ready to be a platform for developing hard real-time embedded applications. However, at this point, our goal is not the real-time capabilities of Linux but to address some general issues. Our primary task was to bring up a system on a PC board in record time. However, the applications to be ported required more memory than an existing Linux platform could support. In general, the problem wasn't in the availability of the physical RAM but in the fact that the kernel could only see part of it. The board was equipped with more physical memory than the original kernel was able to access. Facing this problem, we had to modify the Linux kernel to get access to the whole available RAM. The work started with a cross-development environment setting and some kernel modifications described below. However, before we begin, let's look at the Linux addressing.
Linux Address Space
The user can customize the value of PAGE_OFFSET at the kernel compilation time (the Base Address name is used when referring to it, as well). It's very important to know that the physical RAM memory installed in the system is mapped to the addresses reserved to the kernel space (starting at PAGE_OFFSET). Therefore, if Linux is installed on the system with a huge amount of RAM, there may not be enough addressing space to do the mapping. So, some other mechanisms may be required to make the whole RAM visible.
Problem Description To address this issue, recent Intel x86 microprocessors include a feature called "Physical Address Extension" or PAE that adds an extra four bits to the standard 32-bit physical address. Linux kernel version 2.4 took advantage of PAE to support up to 64GB of RAM. However, the linear address is still composed of 32 bits, so there's no permanent mapping of the whole amount of RAM. Our board was equipped with the PowerPC processor and there was no need for a huge extension of RAM. In our case, only an extra 256MB of RAM visible to the system was sufficient. In the next paragraphs, I will describe our solution to get the extra 256MB accessible to the system. The step-by-step process of kernel configuration will be presented in detail as well.
Solution Figure 2 illustrates the address partition after the base address change. The modifications to the kernel were straightforward and done in no time as you'll see below.
Kernel Configuration
Figure 3 illustrates the development environment, which consists of:
And that's all. What's left is to build the kernel and srec file by running the "make" command from the Linux base directory. After the new kernel is built and burnt (over the serial connection) into the board, resetting the board will conclude the development process. Now, comes verifying if the kernel can see the whole memory. Before executing any more sophisticated tests the first way to verify the system is to run the "top" command. And in fact, the top display shows that the kernel can see all of the available RAM.
Conclusion
References ENTERPRISE OPEN SOURCE MAGAZINE LATEST STORIES . . .
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
|
SYS-CON FEATURED WHITEPAPERS MOST READ THIS WEEK |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||