Annotation of gforth/kernel/main.fs, revision 1.24

1.22      crook       1: \ MAIN.FS      Kernel main load file                   20may93jaw
1.1       anton       2: 
1.20      anton       3: \ Copyright (C) 1995,1996,1997,1998,2000 Free Software Foundation, Inc.
1.1       anton       4: 
                      5: \ This file is part of Gforth.
                      6: 
                      7: \ Gforth is free software; you can redistribute it and/or
                      8: \ modify it under the terms of the GNU General Public License
                      9: \ as published by the Free Software Foundation; either version 2
                     10: \ of the License, or (at your option) any later version.
                     11: 
                     12: \ This program is distributed in the hope that it will be useful,
                     13: \ but WITHOUT ANY WARRANTY; without even the implied warranty of
                     14: \ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     15: \ GNU General Public License for more details.
                     16: 
                     17: \ You should have received a copy of the GNU General Public License
                     18: \ along with this program; if not, write to the Free Software
1.21      anton      19: \ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
1.1       anton      20: 
                     21: Create mach-file here over 1+ allot place
                     22: 
1.18      jwilke     23: 0 [IF]
                     24: \ debugging: produce a relocation and a symbol table
                     25: s" rel-table" r/w create-file throw
                     26: Constant fd-relocation-table
                     27: 
                     28: \ debuggging: produce a symbol table
                     29: s" sym-table" r/w create-file throw
                     30: Constant fd-symbol-table
                     31: [THEN]
                     32: 
                     33: 
                     34: bl word vocabulary find nip 0= [IF]
1.22      crook      35:     \ if search order stuff is missing assume we are compiling on a gforth
                     36:     \ system and include it.
                     37:     \ We want the files taken from our current gforth installation
                     38:     \ so we don't include relatively to this file
                     39:     require search.fs
                     40:     require environ.fs
                     41:     require envos.fs
                     42:     require errors.fs
                     43:     require extend.fs              \ core-extended
                     44:     require hash.fs
1.18      jwilke     45: [THEN]
1.1       anton      46: 
                     47: \ include etags.fs
                     48: 
1.22      crook      49: include ./../cross.fs              \ cross-compiler
1.1       anton      50: 
                     51: decimal
                     52: 
1.23      jwilke     53: has? kernel-size makekernel
1.1       anton      54: \ create image-header
1.4       jwilke     55: has? header [IF]
1.23      jwilke     56: here dup 
                     57:     A,                  \ base address
1.22      crook      58:     0 ,                 \ checksum
                     59:     0 ,                 \ image size (without tags)
1.23      jwilke     60: has? kernel-size
                     61:     ,                   \ dict size
1.22      crook      62:     has? stack-size ,   \ data stack size
                     63:     has? fstack-size ,  \ FP stack size
                     64:     has? rstack-size ,  \ return stack size
                     65:     has? lstack-size ,  \ locals stack size
                     66:     0 A,                \ code entry point
                     67:     0 A,                \ throw entry point
                     68:     has? stack-size ,   \ unused (possibly tib stack size)
                     69:     0 ,                 \ unused
                     70:     0 ,                 \ data stack base
                     71:     0 ,                 \ fp stack base
                     72:     0 ,                 \ return stack base
                     73:     0 ,                 \ locals stack base
1.23      jwilke     74: AConstant image-header
                     75: : forthstart image-header @ ;
1.1       anton      76: [THEN]
                     77: 
                     78: doc-off
1.4       jwilke     79: has? prims [IF]
1.22      crook      80:     include ./aliases.fs             \ primitive aliases
1.1       anton      81: [ELSE]
                     82:     prims-include
                     83:     undef-words
1.17      pazsan     84:     include prim.fs
1.24    ! jwilke     85:     all-words  
1.1       anton      86: [THEN]
                     87: doc-on
                     88: 
1.23      jwilke     89: \ 0 AConstant forthstart
1.1       anton      90: 
1.22      crook      91: \ include ./vars.fs                  \ variables and other stuff
                     92: \ include kernel/version.fs          \ is in $(build)/kernel
                     93: include ./kernel.fs                  \ kernel
1.14      jwilke     94: \ include ./errore.fs
1.13      jwilke     95: include ./doers.fs
1.4       jwilke     96: has? file [IF]
1.22      crook      97:     include ./args.fs
                     98:     include ./files.fs               \ file words
                     99:     include ./paths.fs
                    100:     include ./require.fs
1.1       anton     101: [THEN]
1.6       pazsan    102: 
                    103: has? compiler [IF]
1.22      crook     104:     has? glocals [IF]
                    105:         include ./cond.fs            \ IF and co.
                    106:     [ELSE]
                    107:         include ./cond-old.fs        \ IF and co. withoutlocals
                    108:     [THEN]
                    109:     \ these two games can be added to provide complex examples for the 4stack
                    110:     \ and misc simulators (see arch/4stack/README and arch/misc/README).
                    111:     \ include arch/misc/tt.fs
                    112:     \ include arch/misc/sokoban.fs
1.6       pazsan    113: [THEN]
1.15      jwilke    114: include ./quotes.fs
1.13      jwilke    115: include ./toolsext.fs
                    116: include ./tools.fs               \ load tools ( .s dump )
                    117: include ./getdoers.fs
1.1       anton     118: 
                    119: \ Setup                                                13feb93py
                    120: 
1.4       jwilke    121: has? header [IF]
1.24    ! jwilke    122:     \ set image size
        !           123:     here image-header 2 cells + !         
        !           124:     \ set image entry point
        !           125:     ' boot >body  image-header 8 cells + A!         
1.1       anton     126: [ELSE]
1.22      crook     127:     >boot
1.1       anton     128: [THEN]
                    129: 
1.22      crook     130: include ./pass.fs                    \ pass pointers from cross to target
1.16      jwilke    131: 
1.22      crook     132: .unresolved                          \ how did we do?

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>