translating physical/virtual addresses


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers translating physical/virtual addresses
# 1  
Old 03-03-2010
translating physical/virtual addresses

Hi all,

I am new to Linux kernel/user space programming having been an assembly programmer in my previous life. I am now using 2.6.x kernel on an embedded CPU that has a few dedicated hardware blocks (including more CPU running just C-code, i.e., no operating system).

There is a single DRAM connected to this chip with one Linux CPU + multiple h/w blocks. No swapping since this is being done for an embedded device (SoC ASIC chip with a single 32-bit DDR2 interface, no hard-drive).

Question(s):

1. The Linux CPU needs to talk to hardware blocks that obviously physical DRAM addresses while Linux processes/threads use virtual addresses.

2. How do I translate these addresses back-n-forth? For example, a Linux process may want to allocate memory and then hand it off to a hardware block to write into it. Then after a while the process will read it.

3. Sometimes, the hardware block may write a physical address into the shared memory. The Linux CPU will read the shared memory and then convert the physical address to virtual memory and go read that location.

How does one achieve all of this? If this is being extremely stupid, then please let me know. Hopefully, you can give me some pointers. A website, book, code, man page, high-level thoughts, anything would be appreciated.

Thanks a lot,
Guraaf
# 2  
Old 03-03-2010
Translating real addresses to physical addresses is almost always a function of the hardware. The CPU refers to a table in RAM assigning physical to virtual ranges, it's the responsibility of the OS to manage these tables. Where this table is and how it's laid out depends on the architecture.

There's easier ways to access physical RAM from userspace than making a kernel driver, though. I think you can just map in the relevant bits of /dev/core, which will give you access to the ranges you want while letting the kernel's existing facilities manage all the translation.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Solaris 10 virtual - how do I tell physical host?

uname -a reports type Generic so I know its virtual. Assume its an ldom somewhere. How do I find out what physical host server is? (4 Replies)
Discussion started by: psychocandy
4 Replies

2. AIX

Need help on physical and virtual cpu

HI, I need a command to find, 1) Avaiable Physical CPU 2) Avaiable virtual CPU TIA (1 Reply)
Discussion started by: sumanthupar
1 Replies

3. Red Hat

Number of physical and virtual processors

Hi, i am trying to find out hpw many virtual and physical processors does any linux machine has: output of /proc/cpuinfo is as below : # cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 26 model name : Intel(R) Xeon(R) CPU... (8 Replies)
Discussion started by: omkar.jadhav
8 Replies

4. UNIX for Advanced & Expert Users

Server is virtual or physical?

Hi All, How can I know whether the server I am connecting to is a virtual or physical one? The server might be having any Unix OS (Linux/Solaris/HP-UX etc.). Is there any system files / commands which can show these concrete information? Thanks in advance for the replies. sanzee (1 Reply)
Discussion started by: sanzee007
1 Replies

5. Solaris

Solaris - physical to virtual migration on the same M5000

Hello, Firstly, apologies if the theme of this post is discussed elsewhere. At the moment we have a dual-domain M5000 running. Each domain is running with equal amounts of CPU and memory. What we'd like to do is move the 2 hosts in question (1 per domain) to a Solaris 10 zone of it's zone.... (2 Replies)
Discussion started by: nm146332
2 Replies

6. Solaris

Physical or Virtual

Hi, I am on an Solaris machine "SunOS 5.10 Generic_139556-08 i86pc i386 i86pc"..how do i check if I am on an physical or an virtaul server. Thanks. (6 Replies)
Discussion started by: jjoy
6 Replies

7. IP Networking

Virtual IP addresses

How would i create virtual interface in linux to configure more than one IP address for a physical interface? any help wll be appreciated. https://www.unix.com/images/misc/progress.gif (1 Reply)
Discussion started by: salil2012
1 Replies

8. UNIX for Advanced & Expert Users

Differentiating between Virtual and non Virtual IP addresses

Hello, I would like to know if there is a command or any configuration file to find and differentiate the Virtual IP Addresses (of the Cluster Resource Group) and the IP Address of the Cluster Node. I observe that the ifconfig -a command returns all the IP addresses configured on the ... (1 Reply)
Discussion started by: vineetd
1 Replies

9. Shell Programming and Scripting

get physical and virtual memory

What command can i use to get the physical and virtual memory of a database? (7 Replies)
Discussion started by: tads98
7 Replies

10. UNIX for Dummies Questions & Answers

creating virtual ip addresses

i am running solaris 9 i now how to create virtual ip address but how do i keep them so when the server reboots they are still there?...THANX (2 Replies)
Discussion started by: rmuhammad
2 Replies
Login or Register to Ask a Question