General :: Virtual Memory Concept In Embedded System
Dec 20, 2010
We have designed a board with Cirrus Logic(arm) processor, A Flash memory and some other peripherals have been connected to that. While building kernel we have selected MMU support. We have written few custom drivers for keypad,LED,LCD. But I would like to know how virtual memory mechanism can be helpful here even though there is no any hard disk has been connected. Where will be the virtual memory reside.
I've several questions to ask: Why do some files have black arrows pointed outward in my file system? Why are some files in compressed form, e.g. initrd.img?? How are such files used by the system??
I currently work within an RTOS environment without an MMU and thus have access to the entire memory map of whatever application I'm working on. As is common in the embedded world, different parts of the memory map relate to different peripherals or different types of memory. For our next generation hardware, my company is looking at moving to an MMU-enabled processor and using Linux in some shape or form. Most of us in the dept are familiar with Linux, but we are not Linux gurus by any means. So how to explicitly indicate to Linux that we need certain portions of an application to be stored in NVRam and other portions of the application to NOT be based in NVRam has us confused. None of us have a clear understanding of how user memory is delved out by Linux and how we can influence Linux to use specific portions of the memory map at specific times.
For example in this new application, we expect to have 2 memory chips, both that are DDR3 interfaces. One is a standard DDR3 chip. The other is a non-volatile MRAM with a DDR3 interface so it can be accessed by a DDR3 controller and coexist with conventional DDR3 memory. But because the portion of the memory map that the MRAM will represent will be the only portion of non-volatile memory, we are unclear how we explicitly access MRAM addresses in an MMU-controlled environment. My hail-mary guess was that we would want to somehow tell Linux that we want the MRAM's memory space to be mounted as a RAM Drive and then we access that memory as though it is a file on a HD, except it is much higher speed since it will be at DDR3/MRAM speeds. Is there a better, more straight forward way to do this? Coming from an RTOS world, Linux is going to pose some serious challenges for us, but I think it will be the right move once we are all up to speed and are thinking Linux-centric.
I am using malloc and frees a lot in my program. It shows its allocated but when i remove it doesnt show as the memory is removed(I am using the top command to view VIRT memory usage). If this continously grows what would happen to my program (Will it go out of memory?)
I have a Red Hat 5.3 virtual machine that has 3GB memory. I just upgraded the memory to 4GB, however when I run free -m it still only recognizes 3GB. Is there something else I need to do?
we found that if we use 'top' to show the memory usage of a server (SuSe Linux 10), we can get virtual memory usage as well as 'Resident memory' usage. For virtual mem or a particular process, it is around 1.1GB, which is large but for resident memory, it only consumes 300MB. Are there anyone who knows what the differences are? I would also like to know whether the difference (1.1GB - 300MB) = 800MB are actually available for use by other applications in the system.
i've put together a slackware box that acts as a "virtual web" to answer pings from devices that ping various pages (such as www.yahoo.com) to test their connectivity. this is for bench testing the devices to verify such complaints as "cannot connect to the internet" or "fails connectivity test". so far, so good, except for a few devices that seem to be also try to load a particular page wirh an embedded browser. this i need help with. currently, all that's needed to return a ping is to look at the DNS requests the device makes and add the requested web address (www.yahoo.com for instance) to the hosts file. what i need is a redirect to a particular html file based on the address requested (i.e. yahoopage.html for www.yahoo.com, lgepage.html for www.lge.com, etc) any deas on how to accomplish this?
I am running a series of tests for an implementation of a remote pager that sends page faults to other computers in a network. Long story short, I was wondering if there is an easy way to force a process to use virtual memory as oppose to physical RAM so that I can better measure the performance of my implementation against how the system would perform while swapping to the hard drive.
A process is trying one access to memory, for example through an array (ex.: vect[0]=123. What happens?
Here below what I guess but I'm not sure and accept any comment (please, distinguish between "the system" and "the CPU" in case).
Let's suppose swapping to disk disbled.
We have two scenarios: without and with cache.
If no cache is present in the system: 1. The CPU must discover the phys addr of vect[0] virtual addr. To do that, has to read from 3 (or 2 depending on the system?) pages tables, stored in memory as well. 2. The CPU writes to the final address.
These mean 4 memory accesses.
If cache is present: 1. Like above but, if the pages tables are in cache, we have 3 accesses to that. 2. If the req. page is not in cache, it's reads from ram and transferred to it. Afterwards, cache is written. In the best case we have 4 cache accesses.
I have a 32 bit Ubuntu installed and my Laptop has 4GB RAM, but only 3GB is considered by Linux. My question is: what is the reason for the upper limit on physical memory ?
Code: dmesg | grep Memory [0.000000] Memory: 3052428k/3112960k available (4673k kernel code, 56364k reserved, 2121k data, 656k init, 2200904k highmem) I am familiar with the virtual memory concept where linux splits upper 1GB for kernel and lower 3GB for user processes. In total, linux 32bit can address 4GB virtual addresses. Does this meant that 1GB of physical memory is already mapped to 1GB of kernel space and Linux only shows the remaining 3GB physical memory left for the user in the above command.
I did some searching on the internet and found some articles related to this, but it only confused me further since some articles suggest 4GB is the upper limit with mentioning whether it's virtual or physical memory, some bring in the concept of PAE, etc. I'm relative new to Linux's memory management, so it'd be really helpful if someone could answer this.
As i undertsand - out of 1GB of the virtual Address space for Kernel from 3GB to 4GB of the process address space, Kernel image (code, data, bss, stack, heap) resides staring @0x0 address. Vmalloc area starts either at the end of Physical ram size or at 896M. This 896M cap is mandated to ensure that minimum of 128MB is reserved as vmalloc_reserve for vmalloc,kmap etc.
Is the understanding correct? Now trying to map Physical Zones into this 1GB address space
Initial 16MB is mapped to ZONE_DMA 16MB - 896MB is mapped to ZONE_NORMAL 896MB - 1024MB is mapped to ZONE_HIGHMEM
Does this mean that Kernel image is residing in ZONE_DMA area? Any call to vmalloc() in kernel code will return address beyond 896M? insmod of any LKM will internally invoke vmalloc() to obtain contiguous area - where will this code physically located along with rest of kernel code in ZONE_DMA or in ZONE_HIGHMEM?
Is there a system admin tool for RHEL on montioring and logging system memory used and released that can dump to a log file?I'm having an issue with memory not being released when an application is closed. I need to have a tool monitor and log so I can troubleshoot to verify that it's an application not the OS.
I am suppose to explain the dependencies that exist and each of the following lines of makefile. Lists orders to be executed as a result of running the make utility on it.
I have a query regarding top & virtual memory. When we run top it show VIRT (Virtual Mem), RES (Resident Mem) & SHR (Shared Memory). The total virtual memory of my machine is 4 GBs (2 GB RAM + 2 GB Swap), but still I am able to see a process showing 4000m virtual memory column. what it means, as its show VIRT Mem more than actual available VIRT memory
I am using Red Hat Linux 4 .There are some few questions in my mind related to umask. I want to know that is the default file and directory permissions ?
- When we use umask (022) command in terminal. and create a new file then the permissions applied for new file is for that session and when the system will reboot linux will take automatically its default permission from etc/bashrc or /etc/profile ? - Can we make our own umask or the professional way is to follow 022 only ? - What is the benefit of umask in Linux?
It seems that watching an embedded video crashes my system every once in a while. Is there any way to figure out what is causing the crashes or fix it?
Some extra info - The cpu usage jumps to 45-50 percent when a embedded video is playing.
I have a server running samba process and there are about 70 samba users connected at a time. The system has 4Gb of memory and it seems each samba process is utilizing only 3352Kb of memory. When I run the command pmap -d (pid of samba)
But when I run the top command, it results as below: Tasks: 163 total, 1 running, 162 sleeping, 0 stopped, 0 zombie Cpu(s): 0.9% us, 4.9% sy, 0.0% ni, 93.3% id, 0.8% wa, 0.2% hi, 0.0% si Mem: 3895444k total, 3163192k used, 732252k free, 352344k buffers Swap: 2097144k total, 208k used, 2096936k free, 2487636k cached
Why could the system be utilizing such high memory? By the way, the server is not running other processes. The samba version running in it is 3.0.33-0.17.
In system monitor, there are numerous processes. Some such as metacity and nautilus are using 12-21 mb memory. Since my server is a 512 mb computer, which services or processes can I safely remove or end ?
What command would I use with Top to sort what is displayed when typing top to see the virual memory in a vm? So I am currently running ubunut 10.10 in a vm and I want to run top and display the virtual memory, what sort command would I include with top?
I have applied a patch in linux kernel version-2.6.31(fedora core 12)source code.Now I want to check whether the performance of the memory management part has been enhanced. So how to test the efficiency of this new modified code?
I'm looking for doing AOE (Ata over ethernet) inexpensively with single board computers, like Routerboard stuff, but is there anything with sata plugs. Hopefully I can get each board for hopefully around $50, but a little more would be ok. Non-x86 is fine, Debian is as good as Ubuntu.
I understand that in linux virtual memory would be the same as swap and I also understand that linux only uses swap when your computer has used all your pc memory. I hope both assumption are right.Can I make a process like firefox use ONLY virtual memory/swap? No access to RAM.
I'm trying to set up an older computer for a friend that does not have one I've been using Ubuntu for a little over a year on a couple of systems, and this is the first time I have come across an issue I could not find an answer to. During the boot sequence, and right before the GUI, I'm getting a "Low Graphics Mode" warning and it tells me that the "Virtual screen too big for memory; 5120k needed, 4096 K available" then it gives me some options, and the only one that seems to lead me anywhere is the "Load Ububntu in low res mode this once" Ironically, once the Ubuntu GUI is booted up, the screen resolution is fine (1280x1024 actually - but it is an unknown monitor) This happens every time I re-boot the system and is more of an annoyance then anything else, but since its to be a gift I'd like to get rid of this error message.