LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices



Closed Thread
 
Search this Thread
Old 10-18-2008, 09:40 AM   #1
!rajkums!
LQ Newbie
 
Registered: Oct 2008
Posts: 5

Rep: Reputation: 0
Linux Virtual memory mapping to Board memory map


I am trying to understand how i should change/configure the kernel to run in a custom board from the RAM, running an arm processor.

Linux Kernel is mapped in the virtual memory area starting
PAGE_OFFSET to HIGHMEMORY-1. Then comes the VMALLOC_START to VMALLOC_END area and other areas. The actual physical ram has to be mapped starting from PAGE_OFFSET and ending at HIGHMEMORY. so, i should
define the macros VIRT_TO_PHYS(x) and PHYS_TO_VIRT(x) according to that.

So, if my ram starts at 0xA0000000(physical address) i should define the macros as below

VIRT_TO_PHYS(x) (X - PAGE_OFFSET + 0xA0000000)
PHYS_TO_VIRT(x) (X + PAGE_OFFSET - 0xA0000000).

This takes care of the user space mapping and the kernel space mapping.
In the sense, kernel can use these macros to fill the entries in the page table, when it maps the user space and kernel space.
But there will be CPU reigsters in the physical area of 0x10000000 to 0x10041FFF. Obviously to map this area, above macros cannot be used by the kernel.
So, how to map these areas correctly in the page table maintained by the linux kernel. Am i missing something here in my understanding here, in the sense this macro is used only for memory mapping and all other things like CPU REGISTER AREA and IO area will be mapped in a different way, in the page table.

Can anybody explain as to how kernel can be made to map the SDRAM at OxA0000000 and CPU REGISTER area from Ox10000000-0x10041FFF, in the page table, so that it can access both SDRAM and CPUREGISTER area , when MMU is enabled?
 
Old 10-19-2008, 04:01 AM   #2
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 3,919

Rep: Reputation: 779Reputation: 779Reputation: 779Reputation: 779Reputation: 779Reputation: 779Reputation: 779
This appears to be a cross-post of http://www.linuxquestions.org/questi...apping-677347/
 
Old 10-19-2008, 09:56 AM   #3
!rajkums!
LQ Newbie
 
Registered: Oct 2008
Posts: 5

Original Poster
Rep: Reputation: 0
Yep. Since the topic comes under both embedded and kernel, i have posted in both the places.
 
Old 10-19-2008, 01:25 PM   #4
Total-MAdMaN
Member
 
Registered: May 2008
Distribution: Gentoo
Posts: 306

Rep: Reputation: 34
Quote:
Originally Posted by !rajkums! View Post
Yep. Since the topic comes under both embedded and kernel, i have posted in both the places.
Please don't do that. It's against the rules of the forum, and splits the efforts to help with the problem.
 
Old 10-19-2008, 01:27 PM   #5
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 66
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux shared memory segment access problem and x86 Virtual Memory layout. regmee Linux - Kernel 1 08-23-2008 01:11 AM
Difference between resident memory,shared memory and virtual memory in system monitor mathimca05 Linux - Newbie 1 11-11-2007 05:05 AM
> File Mapping And Pthreads, How to map file in memory? level3 Programming 1 01-16-2006 10:13 PM
Help!?! RH 8 Memory Mapping -High Memory-Virtural Memory issues.. Merlin53 Linux - Hardware 2 06-18-2003 05:48 PM
RH 8.0 Mapping Virtual Memory to get access to VMIC Reflective Memory PCI card. Merlin53 Linux - Hardware 0 05-05-2003 01:50 PM


All times are GMT -5. The time now is 11:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration