C programming question

Sergey Kuznetsov skuznets-WRMZ5ucGVl4BXFe83j6qeQ at public.gmane.org
Fri Dec 19 23:08:04 UTC 2003


On December 19, 2003 05:28 pm, John Wildberger wrote:
> On December 19, 2003 05:14 pm, Sergey Kuznetsov wrote:
> > > My main aim is to understand the workings of the kernel a little bit
> > > better. For this reason I would like to verify what is stored in the
> > > first few hundred memory locations. e.g in x202 the signature HdrS is
> > > supposed to be stored.
> >
> > 1.   First of all, what kind of operation system you are talking about?
> > Linux, *BSD, Windoh$ ?
>
> Linux Mdk9.1
>
> > 2. What memory you want to reach: kernel space or userland space or even
> > physical memory?
>
> Physical memory
>
> > 3. Do you have root access to that machine?
>
> Yes, and I don't mind screwing it up.  :-(
>
   In this case you can't reach the physical memory. Intel processors ( and 
other CPU as well ) protects the access to the real physical memory.
Only kernel have access to it. 
You can do it only thru the kernel space as a driver module, or thru the 
/proc/kcore, but this is file in format of core file, you should know how to 
handle and read it.

you can do the next stuff:

gdb /boot/<current started vmlinux file> /proc/kcore

and then you can see what in the memory (type 'help' in command prompt of gdb 
).

If you want to know how the kernel works, can read Linux Device Drivers by 
Alessandro Rubini ( http://www.xml.com/ldd/chapter/book/bookindexpdf.html ) 
and site named kernel newbies dot org ( http://www.kernelnewbies.org/ )/

> > 4. What kind of memory structures you have a desire to reach?
>
> Not sure of this question, but would like to read first few hundred bytes
> of my RAM.
>
    What the reason to do such stuff? If you want to know how the Linux works 
- see the /usr/src/linux sub-directory. =)


-- 
All the Best!
-----------------
Sergey Kuznetsov
Senior Software Developer
Blueprint Initiative
Samuel Lunenfeld Research Institute
at Mount Sinai Hospital
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list