LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   memory mapping for linux (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/memory-mapping-for-linux-651981/)

sg83 06-27-2008 01:39 AM

memory mapping for linux
 
Hi all,

I'm not familiar with embedded linux so I have a general question regarding memory.

Currently, I'm part of a group that is using an arm-based dev board to develop an embedded system. The dev board has 128M of RAM, however the final silicon (which we don't have yet) will only have 16M of RAM (which is enough for our software). My question is: If we just want to transfer the software over to the final silicon, will I need to make any changes to the kernel to adjust for the lower memory? Or should it just transfer over nicely if the only change is the memory size?

I know it's a fairly general question, but any help is appreciated. Thanks!

Mr. C. 06-27-2008 01:50 AM

I don't know of any special requirements for this. I believe you can test by booting the kernel, and telling it that only 16meg of RAM is available. (I don't recall the boot param currently).

The kernel determines RAM at boot time. The exceptions of course are for large memory kernels (eg. >4, >64gig). It should just transfer.

sg83 06-27-2008 10:36 AM

Quote:

Originally Posted by Mr. C. (Post 3196579)
I don't know of any special requirements for this. I believe you can test by booting the kernel, and telling it that only 16meg of RAM is available. (I don't recall the boot param currently).

The kernel determines RAM at boot time. The exceptions of course are for large memory kernels (eg. >4, >64gig). It should just transfer.

Thanks for your input. I was thinking along the same lines, using the "mem=16M" option.

WildPossum 06-28-2008 11:06 PM

[Usual Disclaimer: I am somewhat knowledgeable on embedded systems and with Linux in particular. BUT always verify such claims directly to your development & target hardware.]

Generally, you just develop, test, debug your application using either your on-board embedded target, or on a Linux development machine (which is your case). Once your satisfied with your application, you then build a Linux configuration to suit your embedded target, removing any and all unnecessary options, particularly kernel (built-in modules) not required to run the application, administrative and/or on-line debug capabilities.

On your particular ARM target usually if your a student or in a learning environment the target system will have a general Linux kernel already running. It this is not the case you would build a streamlined kernel configuration containing only the necessary functionality required for your application, pass the configuration over to your Linux tool chain which will build your required kernel. (it all depends on your Linux tool chain - so your mileage may vary).

Basically, the Linux tool chain will separate out those structures requiring RO, and those requiring RW capability (that is its primary task). It passes this structured information to the cross-compiler(s) that build your configured kernel accordingly.

Once your got a working Linux kernel running on your target system, you usually either load the kernel via tftp, dhcp or nfs booting. Some target systems have UBoot as its BIOS, so you can boot both your specially configured kernel (inclusive libs) and your application, and simply run it.

If your interested in some very good Linux Embedded books I can highly recommend the following:
Embedded Linux Primer - Hallinan - ISBN 9780131679849
Linux Application Design - Smith et Al. - ISBN 9781593271404
Programming Embedded Systems - Barr & Massa - ISBN 0596009836

sg83 07-01-2008 07:00 PM

Thank you for your help.

To continue on, I have another question =).

For a processor with an MMU, how is the memory map generated? For example, how does MMU know which physical address ranges are addressable when translating from virtual->physical?

I read in some places that this information is provided by the BIOS. If my system only has Redboot, is this information specified in Redboot or somewhere in the kernel config?

Thanks once again!


All times are GMT -5. The time now is 10:53 PM.