All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Dike <jdike@addtoit.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: User-mode Linux Kernel Development
	<user-mode-linux-devel@lists.sourceforge.net>
Subject: Re: [uml-devel] early setup
Date: Tue, 23 Dec 2003 12:46:09 -0500	[thread overview]
Message-ID: <20031223174609.GA19599@ccure.user-mode-linux.org> (raw)
In-Reply-To: <Pine.GSO.4.58.0312231524380.1139@waterleaf.sonytel.be>

On Tue, Dec 23, 2003 at 04:12:33PM +0100, Geert Uytterhoeven wrote:
> On the other hand, if I call gtk_init_check() really early (from a
> __uml_setup() routine), UML works fine!
> 
> Any good reason why?  I'm using SKAS mode, since TT gave me even more headaches

UML arranges its physical memory so that it's contiguous starting from the
beginning of the binary out to the end of its VM.  In the middle of that is the
heap.  The brk is rounded up to the nearest 4M or something.  Everything after 
that is usable kernel physical memory, everything before that is reserved and
unusable.

In order to prevent malloc from being used to allocate memory after the kernel
has taken over its memory, malloc et al are wrapped, and if the kernel is
running, the wrapper calls kmalloc instead.  So, if gtk is managing its own
heap, then it may be evading the wrapper, and causing the brk to impinge on
kernel memory.  The fact that everything works if gtk_init_check is called
early enough backs this up.  That will allocate memory and push out the brk
before UML decides where usable memory begins.

				Jeff


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

      reply	other threads:[~2003-12-23 17:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-23 15:12 [uml-devel] early setup Geert Uytterhoeven
2003-12-23 17:46 ` Jeff Dike [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031223174609.GA19599@ccure.user-mode-linux.org \
    --to=jdike@addtoit.com \
    --cc=geert@linux-m68k.org \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.