LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices

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

Rep: Reputation: 0
Kernel virtual memory map TO Board memory map -----> Mapping


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?
 
  


Reply


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 Virtual memory mapping to Board memory map !rajkums! Linux - Kernel 4 10-19-2008 12:27 PM
pointing to a memory map location in C knobby67 Programming 2 08-01-2007 06:25 PM
PCI Memory Map rajtendulkar Linux - Hardware 0 03-20-2006 10:00 PM
> File Mapping And Pthreads, How to map file in memory? level3 Programming 1 01-16-2006 09:13 PM
RH 8.0 Mapping Virtual Memory to get access to VMIC Reflective Memory PCI card. Merlin53 Linux - Hardware 0 05-05-2003 12:50 PM


All times are GMT -5. The time now is 12:04 AM.

Main Menu
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