Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing physical memory area

Status
Not open for further replies.

Sen7inel

IS-IT--Management
Feb 14, 2001
90
0
0
FI
Hi,

I'm not sure if this forum is appropriate, but I couldn't find anything else either.. Here goes.

When an application (say a win app) runs, it has its virtual address space, right? Now, how can a user mode application access the actual physical memory, like some "memory editors" seem to do? Also, can I/O-space be accessed by anything else than device drivers? Drivers apparently run in kernel mode, but do they have a virtual mem space? How can they then address the I/O-space?

Also, when a system call takes place from user mode code, where in mem does the code actually jump (in asm)?
 
When an application (say a win app) runs, it has its virtual address space, right?
Right.

Now, how can a user mode application access the actual physical memory, like some "memory editors" seem to do?
hex editors are written in lower level code (generally assmebly) and often only work on disk. When you see a memory editor, they have gone to great lengths to get arround protections in the OS to avoid such tampering... Use memory editors sparingly and only if you know what your doing.

Also, can I/O-space be accessed by anything else than device drivers?
I/O-space can be accessed only in "kernel mode." There are instructions in asm to enter and exit kernel mode that are spesific to the architecture. Technically the I/O space is part of every processes memory space bing located in kernel memory, but you can't get a handle to it without making a system call to the OS, or writing code to directly acesses it in asm.

Drivers apparently run in kernel mode, but do they have a virtual mem space?
I believe so...

How can they then address the I/O-space?

Also, when a system call takes place from user mode code, where in mem does the code actually jump (in asm)?
System calls are also stored in kernel memory and are part of every processes "memory picture". I don't know off hand where in memory Windows puts kernel memory, but I think it's high memory...
 
Hi sent..

Just adding some info:

device drivers can access physical memory? Yes
Can access physical devices? Yes

That´s why you have to be very careful when you are designing them, and also be prepared to see a lot of system crashes,

regards

Rick

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top