9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: cinap_lenrek@gmx.de
To: 9fans@9fans.net
Subject: Re: [9fans] exec() question
Date: Sat, 16 Mar 2013 01:11:11 +0100	[thread overview]
Message-ID: <795419ca3771d16899c7b30e7c59ec84@rei2.9hal> (raw)
In-Reply-To: <6afdffa1957d1d4afe8c1a50369e4090@ladd.quanstro.net>

it also works in practice. the only catch was that fault386 does:

	if(!user){
		if(vmapsync(addr))
			return;
->		if(addr >= USTKTOP)
			panic("kernel fault: bad address pc=0x%.8lux addr=0x%.8lux", ureg->pc, addr);
		if(up == nil)
			panic("kernel fault: no user process pc=0x%.8lux addr=0x%.8lux", ureg->pc, addr);
	}

so when moving the TSTK above the USTK, you need to change the addr >= USTKTOP
to addr >= TSTKTOP.

the arm kernels use USTKTOP as the end of userspace and size...

i think your approach with dynamically finding the address hole for the temporary
stack is the most flexibe and requires the least change. i think one can
ignore the additional computational overhead and get rid of the TSTK all
together.

--
cinap



  reply	other threads:[~2013-03-16  0:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-15 17:03 erik quanstrom
2013-03-15 20:35 ` cinap_lenrek
2013-03-15 20:41   ` cinap_lenrek
2013-03-15 21:48     ` erik quanstrom
2013-03-15 21:51       ` erik quanstrom
2013-03-15 22:48       ` cinap_lenrek
2013-03-15 23:57         ` erik quanstrom
2013-03-16  0:11           ` cinap_lenrek [this message]
2013-03-17  1:56             ` erik quanstrom

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=795419ca3771d16899c7b30e7c59ec84@rei2.9hal \
    --to=cinap_lenrek@gmx.de \
    --cc=9fans@9fans.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).