diff options
| author | Jordan K. Hubbard <jkh@FreeBSD.org> | 1998-11-07 06:18:00 +0000 |
|---|---|---|
| committer | Jordan K. Hubbard <jkh@FreeBSD.org> | 1998-11-07 06:18:00 +0000 |
| commit | ed82a24960c517b57900e77ebad824edfd845424 (patch) | |
| tree | 5761b0ee1daa2d35f800f1e40010f63928da9187 /sys/boot/common/interp_forth.c | |
| parent | d6a0c2b58dd7093de196ffdb56b456ec626b9f9b (diff) | |
Notes
Diffstat (limited to 'sys/boot/common/interp_forth.c')
| -rw-r--r-- | sys/boot/common/interp_forth.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/boot/common/interp_forth.c b/sys/boot/common/interp_forth.c index a2dbbeafbdca..9da74a52f77f 100644 --- a/sys/boot/common/interp_forth.c +++ b/sys/boot/common/interp_forth.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: interp_forth.c,v 1.5 1998/11/06 03:50:44 msmith Exp $ + * $Id: interp_forth.c,v 1.6 1998/11/07 03:44:10 jkh Exp $ */ #include <stand.h> @@ -106,15 +106,20 @@ void bf_init(void) { struct bootblk_command **cmdp; - + int fd; + ficlInitSystem(4000); /* Default dictionary ~4000 cells */ bf_vm = ficlNewVM(); /* make all commands appear as Forth words */ SET_FOREACH(cmdp, Xcommand_set) ficlBuild((*cmdp)->c_name, bf_command, FW_DEFAULT); - /* run the init word from softcore */ - ficlExec(bf_vm, "init"); + + /* try to load and run init file if present */ + if ((fd = open("/boot/boot.4th", O_RDONLY)) != -1) { + (void)ficlExecFD(bf_vm, fd); + close(fd); + } } /* |
