From owner-freebsd-stable Tue Aug 20 8:29:36 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3949137B400 for ; Tue, 20 Aug 2002 08:29:33 -0700 (PDT) Received: from wall.polstra.com (wall-gw.polstra.com [206.213.73.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4845443E7B for ; Tue, 20 Aug 2002 08:29:32 -0700 (PDT) (envelope-from jdp@polstra.com) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.11.3/8.11.3) with ESMTP id g7KFTQf99711; Tue, 20 Aug 2002 08:29:26 -0700 (PDT) (envelope-from jdp@vashon.polstra.com) Received: (from jdp@localhost) by vashon.polstra.com (8.12.4/8.12.4/Submit) id g7KFTQKB083038; Tue, 20 Aug 2002 08:29:26 -0700 (PDT) (envelope-from jdp) Date: Tue, 20 Aug 2002 08:29:26 -0700 (PDT) Message-Id: <200208201529.g7KFTQKB083038@vashon.polstra.com> To: stable@freebsd.org From: John Polstra Cc: donxc@verizonmail.com Subject: Re: freebsd ficl extra-words In-Reply-To: <20020820094136.31418.qmail@verizonmail.com> References: <20020820094136.31418.qmail@verizonmail.com> Organization: Polstra & Co., Seattle, WA Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In article <20020820094136.31418.qmail@verizonmail.com>, Donald Creel wrote: > I am trying to use some of the FreeBSD "extra words" in loader, > in particular fopen, fload, fread. I do not understand how to get > the file descriptor fd to pass to fload, fread, fclose. I am also > having trouble getting addr to pass to fopen. I have tried passing > some random numbers for fd, len, and addr but only get error message > "stack underflow". Any help will be appreciated. It sounds like you might need to read a forth tutorial. They're easy to find on the web. All values are passed via the stack, and it's important to understand what each word expects to find on the stack and what it will leave there. Also, there are some examples in /usr/share/examples/bootforth. In particular see "boot.4th" in that directory, which shows how to load a file and interpret its contents: s" /boot/frames.4th" fopen dup fload fclose John Polstra (definitely _not_ a forth expert) -- John Polstra John D. Polstra & Co., Inc. Seattle, Washington USA "Disappointment is a good sign of basic intelligence." -- Chögyam Trungpa To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message