|
Prev: lpc2378
Next: 8051 baud rate
From: sg83 on 3 Jul 2008 15:57 Hi everyone, I am very new to Embedded Linux. I know that the MMU handles all of the address translations from Virtual to Physical. My question is that how does 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 to 0xa0000000 and second bank of 64MB DRAM mapped to 0xb0000000, where does the MMU get this map from? Thanks for the help!
From: Frank Buss on 3 Jul 2008 16:21 sg83 wrote: > For example, if I have a board with the first bank of 64MB DRAM mapped to > 0xa0000000 and second bank of 64MB DRAM mapped to 0xb0000000, where does > the MMU get this map from? Take a look at the Wikipedia entry: http://en.wikipedia.org/wiki/Memory_management_unit If you have plenty of time, you can read the documenation of chips like Pentium for the details :-) -- Frank Buss, fb(a)frank-buss.de http://www.frank-buss.de, http://www.it4-systems.de
From: Tim Wescott on 3 Jul 2008 23:53 On Thu, 03 Jul 2008 14:57:39 -0500, sg83 wrote: > Hi everyone, > > I am very new to Embedded Linux. I know that the MMU handles all of the > address translations from Virtual to Physical. My question is that how > does 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 > to 0xa0000000 and second bank of 64MB DRAM mapped to 0xb0000000, where > does the MMU get this map from? > > Thanks for the help! 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 http://www.wescottdesign.com Need to learn how to apply control theory in your embedded system? "Applied Control Theory for Embedded Systems" by Tim Wescott Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html
From: Matthew Hicks on 4 Jul 2008 02:21 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 > Hi everyone, > > I am very new to Embedded Linux. I know that the MMU handles all of > the address translations from Virtual to Physical. My question is that > how does 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 > to 0xa0000000 and second bank of 64MB DRAM mapped to 0xb0000000, where > does the MMU get this map from? > > Thanks for the help! >
From: sg83 on 4 Jul 2008 13:32
Thank you for the help everyone. 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 the actual location of the memory. I will surely look into your suggestions. |