In the main memory (RAM), how the data & address are stored?
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
You'll have to give us some more context for this question. A program (or the operating system) will store data at an address in RAM---and it will also have a mechanism for storing what the address is (so it can find the data). How all this happens depends on the program and what the data is.
All programs are using virtual memory, to Read or Write the data in to RAM, the Kernel uses the Page Table concept and retrive the Physical Address and request CPU to Read or Write the data in to that Physical Address.
Now CPU access the data from the RAM by using the Physical Address.
My question is, using Physical Address how CPU retrives the data from the RAM ?
Last edited by rajeshcurl; 05-21-2009 at 07:28 AM.
That appears to be part of the documentation of a specific strange substitute for assembly language. Very little there is relevant to the topic of this thread.
My question is, using Physical Address how CPU retrives the data from the RAM ?
That's a big shift from what you seemed to be asking earlier, so I wonder what you're really trying to ask. But taking that literally:
The physical address is passed from the CPU to the memory controller. The memory controller translates it again in order to select the right bank of memory and generate row and column numbers and other stuff that I don't 100% understand myself.
In current AMD x86_64 designs, that memory controller is inside the same CPU package with the CPU itself. In Intel designs, the memory controller is in a separate part on the motherboard.
It simply discusses how memory can be accessed in 80x86 without delving into MMU internals (it's part of assembly teaching book "Art of Assembly", which is available online).
Last edited by Alien_Hominid; 05-21-2009 at 05:33 PM.
All of the addresses issued by a program are virtual addresses. This means that they are subject to "address translation" by the hardware... although the program in question cannot be aware of what is actually going on. This technique allows the operating system kernel to use any physical address to satisfy the storage-requirements of any virtual-address that might be issued by any program.
The actual implementation of this hardware feature divides the virtual address references into equal-sized chunks, called "pages," and therefore also the physical-address space into "page frames" of the same size. The mapping that takes place, in other words, does not occur on a byte-by-byte level, but rather in terms of chunks that are (say...) 4K in size.
This feature also allows the operating-system to say that a particular virtual address, at the moment, maps to "nowhere at all" in physical memory-space. When this happens, the running program is interrupted with a "page fault" and the operating-system must figure out how to resolve the problem. Running programs are not specifically aware that they have been interrupted in this way.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.