From owner-freebsd-current Sun Dec 20 04:00:20 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id EAA03443 for freebsd-current-outgoing; Sun, 20 Dec 1998 04:00:20 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from newsguy.com (smtp.newsguy.com [207.211.168.71]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id EAA03433 for ; Sun, 20 Dec 1998 04:00:13 -0800 (PST) (envelope-from dcs@newsguy.com) Received: from newsguy.com (tc-1-170.urawa.gol.ne.jp [203.216.60.170]) by newsguy.com (8.9.1a/8.9.1) with ESMTP id DAA05129; Sun, 20 Dec 1998 03:59:57 -0800 (PST) Message-ID: <367CE5E0.D2ACFAE2@newsguy.com> Date: Sun, 20 Dec 1998 20:56:16 +0900 From: "Daniel C. Sobral" X-Mailer: Mozilla 4.5 [en] (Win98; I) X-Accept-Language: pt-BR,ja MIME-Version: 1.0 To: Andrzej Bialecki CC: freebsd-current@FreeBSD.ORG Subject: Re: BootFORTH - demo floppy References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Andrzej Bialecki wrote: > > The built-ins I was talking about are the original bootloader commands, > such as set, show, load, boot, reboot, pnpscan, ls etc..., which need > closer integrations with Forth engine. Namely, they should recognize the > state (either interpretive, or compiling), and be able to accept > parameters either from command line (like: "load -t userconfig_script > kernel.config" when interpreting), or from the stack (like: > > s" kernel.config" > s" userconfig_script" > s" -t" > load > > when compiling). As it is now, we cannot use the full Forth power to > program booting behaviour because of this deficiency. Well, aside from being... well... ugly, you _can_ wrap it like: 80 constant Buffersize Create Buffer Buffersize allot : cat >r over >r \ save sizes dup >r \ save original append position swap move \ append r> r@ + \ skip newly added string bl over c! \ add a space... 1+ \ ...and skip it r> r> + 1+ \ new size ; : concatenate_command_and_arguments >r \ Save number of strings buffer 0 \ Destination of copy r> 0 do \ Copy all strings cat loop 0 rot c! \ Null-terminate the buffer, because of problems with evaluate Buffer swap \ return begin-of-buffer, size ; : insert_command rot 1+ ; : wrapper insert_command concatenate_command_and_arguments evaluate ; : wrap" postpone s" postpone wrapper ; immediate And then do: > s" kernel.config" > s" userconfig_script" > s" -t" 3 > wrap" load" in compile mode (inside a definition). I'll see what I can do after I get the source, but that will have to wait a new hd. Meanwhile... 1) Could someone please add a key pause to "words"? :-) 2) Could someone please add the 30-years old traditional "ok" prompt in interpreting mode? 3) I noticed "evaluate" is working with null-ended string, ignoring completely the count on the stack. Not good. -- Daniel C. Sobral (8-DCS) dcs@newsguy.com "This never happened to the other fellow!" - The second James Bond To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message