From owner-freebsd-hackers Mon Jun 28 21:45:31 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from mycenae.ilion.eu.org (mycenae.ilion.eu.org [203.35.206.129]) by hub.freebsd.org (Postfix) with ESMTP id 491AD14D67 for ; Mon, 28 Jun 1999 21:45:25 -0700 (PDT) (envelope-from patrykz@mycenae.ilion.eu.org) Received: from mycenae.ilion.eu.org (patrykz@localhost [127.0.0.1]) by mycenae.ilion.eu.org (8.9.2/8.9.2) with ESMTP id OAA30104; Tue, 29 Jun 1999 14:44:40 +1000 (EST) (envelope-from patrykz@mycenae.ilion.eu.org) Message-Id: <199906290444.OAA30104@mycenae.ilion.eu.org> To: Amol Mohite Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: environment strings In-reply-to: Your message of "Mon, 28 Jun 1999 23:32:59 -0400." Date: Tue, 29 Jun 1999 14:44:39 +1000 From: Patryk Zadarnowski Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > I know about envp. > > What I want to know is the exact position of these variables on the stack. > > and if anywhere I can find some data, on the exact compisoition of the > stcak, then it will be very helpful. > > references of books and websites wil be most helpful. Basically, i386 BSD kernels (you're after i386, aren't you?) point ESP to the following "struct" (which means that it will be dumped at the very top of the address space) struct kframe { int argc; /* "argc" to be passed to main() */ char *argv[argc]; /* "argv" to be passed to main() */ char *null; /* a NULL pointer terminating argv[] */ char **envp; /* value to be assigned to "environ" */ }; /usr/src/lib/csu/i386/crt0.c is probably the best reference you can get your hands on ;) Patryk. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message