MMU question

Hi everyone,

I am very new to Embedded Linux. I know that the MMU handles all of th address translations from Virtual to Physical. My question is that how doe the MMU know which physical addresses actually have RAM?

Is this information provided by the CPU? Kernel? Bootloader?

For example, if I have a board with the first bank of 64MB DRAM mapped t

0xa0000000 and second bank of 64MB DRAM mapped to 0xb0000000, where doe the MMU get this map from?

Thanks for the help!

Reply to
sg83
Loading thread data ...

Take a look at the Wikipedia entry:

formatting link

If you have plenty of time, you can read the documenation of chips like Pentium for the details :-)

--
Frank Buss, fb@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
Reply to
Frank Buss

The MMU doesn't 'know' what's RAM and what's not. The MMU just knows how virtual memory should be mapped to what physical memory. This mapping is specified by the CPU running in some protected mode (like ring 0 on a x86) that lets it talk to the MMU.

You seem to be confused about what the CPU is in relation to the kernel and bootloader. The CPU is the hardware which executes the bootloader code as well as the kernel code. So asking if the information is provided by the CPU _or_ the kernel is a near-meaningless question.

--
Tim Wescott
Control systems and communications consulting
 Click to see the full signature
Reply to
Tim Wescott

Actually in linux, the MMU makes the conversion from logical to virtual/linear to physical adresses. But, even on systems that use segmentation, Linux pretty-much ignores it, so logical = virtual. Linux uses whats called demand paging. While you at wikipedia look-up paging and demand paging. The book "Understanding the Linux Kernel" is also a good reference.

---Matthew Hicks

Reply to
Matthew Hicks

Thank you for the help everyone.

The main reason I ask this question is because I have a kernel running o a dev. board right now. However, I want to port my code over to the fina product which is going to have less memory and the memory is going to b located at a different physical address.

I've ensured that the lower memory amount is enough to run my kernel an apps, but I wanted to prepare for any issues I might have due to the actua location of the memory.

I will surely look into your suggestions.

Reply to
sg83

What question? If you want to post a followup via groups.google.com or similar, ensure you quote enough for the article to make sense. Google is only an interface to Usenet; it's not Usenet itself. Don't assume your readers can, or ever will, see any previous articles.

More details at:

--
 [mail]: Chuck F (cbfalconer at maineline dot net) 
 [page]: 
 Click to see the full signature
Reply to
CBFalconer

the

Thanks for the help.

The main reason I ask this question is because I have a kernel running on a dev. board right now. However, I want to port my code over to the final product which is going to have less memory and the memory is going to be located at a different physical address.

I've ensured that the lower memory amount is enough to run my kernel and apps, but I wanted to prepare for any issues I might have due to th actual location of the memory.

Reply to
sg83

It doesn't.

Depending on how the system is designed, an attempt to access a virtual address that maps to a physical address not corresponding to any memory may lead to a bus fault.

Reply to
Eric Smith

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.