LinuxQuestions.org
Visit the LQ Articles and Editorials section
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



Reply
 
Search this Thread
Old 06-21-2006, 02:09 AM   #1
skd.tech
LQ Newbie
 
Registered: Apr 2006
Posts: 5

Rep: Reputation: 0
Memory Mapping (same physical address = virtual address)


Hi All,
Need to disable MMU in Linux. It needs a section of memory where virutal address=physical address in the memory mapping table. Is there any method to do the same dynamically(means to map a section of physical addresses to the same virutal addresses)

Any hints or pointers would be of great help

-skd
 
Old 06-22-2006, 12:29 PM   #2
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,455

Rep: Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172
Well, you can't disable the MMU.

This is what we mainframers used to call a "V=R ('Virtual Equals Real') Region." (Also known as VEQR for those who don't like punctuation, or "page fixing.")

If Linux supports this, and I do not recall, then it will certainly remain a very difficult thing. There could be, for example, issues relating to where in the memory-space this buffer had to be: recall that the virtual address-space is segmented into "kernel" and "user" portions...

Is it not possible to design your program to permit the buffer to be (virtually) "anywhere," and to obtain the necessary addressing by means of offsets to that pointer? A simple #define macro could make the translation invisible to source-code readers.

Last edited by sundialsvcs; 06-22-2006 at 12:32 PM.
 
Old 06-23-2006, 05:47 AM   #3
skd.tech
LQ Newbie
 
Registered: Apr 2006
Posts: 5

Original Poster
Rep: Reputation: 0
MMU Disable

Hi, Thanks for the response.
My reqmnt is specific to the processor. I am doing some thing related to the system freq and i need to switch of the MMU for my implementation. I am doing the same with a kernel driver (assembly code is used for the actual cpu specific task)

Could you please provide any mech to do a 1:1 mapping dynamically inside my driver?

Thanks
Sanil
 
Old 06-23-2006, 09:16 AM   #4
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,455

Rep: Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172
I know that you can't turn the MMU off. Perhaps you should explain more fully just what it is you are trying to do, and from what context (kernel, user, or both).

Some of the kernel memory space might already be mapped 1:1, such as memory-mapped I/O areas.
 
Old 06-26-2006, 06:10 AM   #5
skd.tech
LQ Newbie
 
Registered: Apr 2006
Posts: 5

Original Poster
Rep: Reputation: 0
MMU Disable

Quote:
Originally Posted by sundialsvcs
I know that you can't turn the MMU off. Perhaps you should explain more fully just what it is you are trying to do, and from what context (kernel, user, or both).

Some of the kernel memory space might already be mapped 1:1, such as memory-mapped I/O areas.

Actually in our kernel there is no space mapped 1:1. I need to do the same either from the kernel boot code or dynamically from my driver. Could you give any hints for the same?
 
Old 06-26-2006, 07:42 AM   #6
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,455

Rep: Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172
Please explain, in detail, what you are trying to accomplish ... not "what your present intended path to get there" is, but "where do you intend to go with this?"

You're interfacing with .. what?

Your code needs to run .. when?

How exactly is this requirement so gosh-darned different from any other device driver whose code already exists in abundance?
 
Old 06-27-2006, 08:41 PM   #7
wini_g
Member
 
Registered: Jun 2003
Distribution: SuSE 11.0
Posts: 171

Rep: Reputation: 30
What about ucLinux : http://www.uclinux.org/ ?
 
Old 07-25-2006, 12:13 AM   #8
rick.2g
Member
 
Registered: Sep 2005
Posts: 41

Rep: Reputation: 15
looks like wini_g got it - uclinux has some options to run without mmu - but it's a complete rewrite of the mm layer - not trivial. You're far better off working off the uclinux base than trying to "switch the mmu off" in this case.
The thing with this is that uclinux is primarily intended for embedded devices. Is that what you're trying to do? What arch are you on?
 
  


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
API for mapping Physical Address to Virtual Address Lakshman_smt Linux - Software 2 10-15-2006 10:08 PM
Getting Physical address in User Mode? marudhu Programming 4 02-23-2004 03:36 PM
NIC physical address hennaheto Linux - Networking 2 01-30-2004 09:40 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
Physical Address yangh66 Linux - Networking 2 06-19-2001 09:01 AM


All times are GMT -5. The time now is 05:27 AM.

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