how can i access memory contents using ubuntu 11.04

Asked by bhaskar

I am newbie to ubuntu and i am using Ubuntu 11.04 Natty Narwal along with my windows 7 with dual boot. I want to know the memory usage in my dell laptop. What i am asking is that to check the contents of memory locations with those hexadecimal addresses. Suppose my memory locations are ranging from 0x0000000 to 0xfffffff, from that i want to know the locations range where windows, linux, bios, bootloader, device drivers are stored. If possible please tell me how to access the assembly/machine language code stored in these memory locations without causing damage to the OS.
In addition to this i want to know the information regarding which microprocessor (like 8085,8086 etc.) is used in my laptop.
I am requesting to answer this question whoever have experience with embedded linux and also welcome to some other professional in computer systems.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Chris (fabricator4) said :
#1

Linux is a layered system which means that direct control or interrogation is not a simple matter. See this kernel map from wikipedia:
http://en.wikipedia.org/wiki/File:Linux_kernel_map.png

You can get information on memory usage and running processes by by typing the following in terminal:

top

Press 'Q' to exit top. You can get information on the hardware include the processors by typing the following in terminal:

sudo lshw

It sounds like you might have Ubuntu installed using Wubi rather that dual boot. With Wubi install you install Ubuntu into Windows and remove it with the Windows add/remove programs. With a true dual boot system the OS has it's own partition to boot off.

Chrsi

Revision history for this message
bhaskar (hinduvsp) said :
#2

Hi Chris,
             Thanks for your information and i know the top and lshw commands, but i want in depth knowledge of ubuntu to know more about hardware and pheripherals information. But i don't know how to ask this question beyond your reply.
             I am not using wubi and i am totally using ubuntu on separate hard disc partition. Even i don't know the function of wubi and i heard about it.

Revision history for this message
Chris (fabricator4) said :
#3

Hi, try the pmap command for more information on what memory is allocated, however it's still not going to give you physical memory addresses - only the memory used by modules that are used by a process and private memory, and the offsets.

The layered architecture of the Linux kernel insulates the programmer and therefore the user from the actual physical memory management so it's not very easy to pin the memory used by a module to a particular physical memory address. For more information on this Gorman's book on Linux virtual memory management gives a very good insight: http://www.kernel.org/doc/gorman/pdf

Similarly, the layered approach provides a standardized interface for all other peripherals in the system, a HAL (Hardware Abstraction Layer), so that rather than dealing directly with the hardware a programmer needs to only deal with this HAL If a programmer wants to write a driver module for the Linux kernel, he must write it for use within this abstraction layer so that program modules can use it.

There are some very good reasons for the way this done:

Portability: To a large extent if you want to port the OS to a different platform, only the hardware layer needs to be re-written. It's not quite as simple as this of course, but there would be no need to re-write the entire OS.

Security: Since a module cannot access physical RAM directly there's almost no chance that a badly written (or malicious) application can affect another module or it's data, including the kernel.

Optimisation: individual modules can be optimised for a particular hardware or situation. There are some performance trade-offs with the layered approach of course, however given that computers have evolved beyond the single user, single task, and even single CPU paradigm it's still the best approach for a mature OS.

So, what you're asking for isn't really possible within the scope of what a normal user or even a programmer is expected or allowed to do.

Chris

Can you help with this problem?

Provide an answer of your own, or ask bhaskar for more information if necessary.

To post a message you must log in.