[Lguest] /proc/kcore in guest

Sujit Sanjeev sujit771 at gmail.com
Fri Apr 11 16:09:46 EST 2008


Hi,

On further investigation I noticed that the size of /proc/kcore in the
guest, is initially the size of memory
specified while booting the guest (256MB in this case).

After executing a program which I have written to read the contents of
/proc/kcore using the open() system call,
the size of the file increases to 1GB! and I am able to read upto 1GB of
data!
(which is the size of the actual RAM on my machine)

Could someone please explain this? Does the read here also give the contents
of the host memory?

Thank you so much in advance,
Sujit

On Thu, Apr 10, 2008 at 9:51 PM, Sujit Sanjeev <sujit771 at gmail.com> wrote:

> Hi,
>
> On a machine with 1GB RAM, I booted an lguest guest with 256MB memory as
> follows:
> ./lguest --block='blockfile' --initrd=/boot/initrd.img-2.6.23-rc9 256m
> /boot/vmlinuz-2.6.23-rc9 root=/dev/lgba rw single
>
> The size of /proc/kcore file in the host obtained using 'ls -la' is
> 1073422336,
> while the same command executed within the guest shows the size as
> 1069228032.
>
> Since the size of /proc/kcore represents the size of the physical memory
> (RAM), and I boot the guest with just 256MB
> of memory, shouldn't the size of the kcore file under guest be 256MB
> instead of around 1GB?
>
> Will the contents of /proc/kcore in the guest also reflect the contents of
> the host memory?
>
> Please let me know.
>
> Thanks!
> Sujit
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/lguest/attachments/20080410/f052cde2/attachment.htm>


More information about the Lguest mailing list