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

1.22      crook       1: \ MAIN.FS      Kernel main load file                   20may93jaw
1.1       anton       2: 
1.44      anton       3: \ Copyright (C) 1995,1996,1997,1998,2000,2003,2006,2007,2008,2011 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
1.38      anton       9: \ as published by the Free Software Foundation, either version 3
1.1       anton      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
1.38      anton      18: \ along with this program. If not, see http://www.gnu.org/licenses/.
1.1       anton      19: 
                     20: Create mach-file here over 1+ allot place
                     21: 
1.18      jwilke     22: 0 [IF]
                     23: \ debugging: produce a relocation and a symbol table
                     24: s" rel-table" r/w create-file throw
                     25: Constant fd-relocation-table
                     26: 
                     27: \ debuggging: produce a symbol table
                     28: s" sym-table" r/w create-file throw
                     29: Constant fd-symbol-table
                     30: [THEN]
                     31: 
                     32: 
1.43      anton      33: parse-name vocabulary find-name 0= [IF]
1.22      crook      34:     \ if search order stuff is missing assume we are compiling on a gforth
                     35:     \ system and include it.
                     36:     \ We want the files taken from our current gforth installation
                     37:     \ so we don't include relatively to this file
1.40      anton      38:     require ./../startup.fs
1.18      jwilke     39: [THEN]
1.1       anton      40: 
                     41: \ include etags.fs
                     42: 
1.22      crook      43: include ./../cross.fs              \ cross-compiler
1.1       anton      44: 
                     45: decimal
                     46: 
1.35      pazsan     47: has? rom 0= [IF]
                     48:     has? kernel-start has? kernel-size makekernel
                     49: [THEN]
                     50:     \ create image-header
1.4       jwilke     51: has? header [IF]
1.29      jwilke     52: here 1802 over 
1.23      jwilke     53:     A,                  \ base address
1.22      crook      54:     0 ,                 \ checksum
                     55:     0 ,                 \ image size (without tags)
1.23      jwilke     56: has? kernel-size
                     57:     ,                   \ dict size
1.22      crook      58:     has? stack-size ,   \ data stack size
                     59:     has? fstack-size ,  \ FP stack size
                     60:     has? rstack-size ,  \ return stack size
                     61:     has? lstack-size ,  \ locals stack size
                     62:     0 A,                \ code entry point
                     63:     0 A,                \ throw entry point
                     64:     has? stack-size ,   \ unused (possibly tib stack size)
                     65:     0 ,                 \ unused
1.1       anton      66: [THEN]
                     67: 
                     68: doc-off
1.4       jwilke     69: has? prims [IF]
1.22      crook      70:     include ./aliases.fs             \ primitive aliases
1.1       anton      71: [ELSE]
                     72:     prims-include
                     73:     undef-words
1.17      pazsan     74:     include prim.fs
1.24      jwilke     75:     all-words  
1.1       anton      76: [THEN]
                     77: doc-on
                     78: 
1.26      jwilke     79: has? header [IF]
1.29      jwilke     80: 1802 <> [IF] .s cr .( header start address expected!) cr uffz [THEN]
1.28      jwilke     81: AConstant image-header
1.26      jwilke     82: : forthstart image-header @ ;
                     83: [THEN]
                     84: 
1.23      jwilke     85: \ 0 AConstant forthstart
1.1       anton      86: 
1.22      crook      87: \ include ./vars.fs                  \ variables and other stuff
                     88: \ include kernel/version.fs          \ is in $(build)/kernel
                     89: include ./kernel.fs                  \ kernel
1.14      jwilke     90: \ include ./errore.fs
1.13      jwilke     91: include ./doers.fs
1.4       jwilke     92: has? file [IF]
1.22      crook      93:     include ./args.fs
                     94:     include ./files.fs               \ file words
                     95:     include ./paths.fs
                     96:     include ./require.fs
1.1       anton      97: [THEN]
1.6       pazsan     98: 
                     99: has? compiler [IF]
1.22      crook     100:     has? glocals [IF]
                    101:         include ./cond.fs            \ IF and co.
                    102:     [ELSE]
                    103:         include ./cond-old.fs        \ IF and co. withoutlocals
                    104:     [THEN]
                    105:     \ these two games can be added to provide complex examples for the 4stack
                    106:     \ and misc simulators (see arch/4stack/README and arch/misc/README).
1.34      pazsan    107:     has? games [IF]
                    108:        include arch/misc/tt.fs
1.45      dvdkhlng  109:         \ disabled, as cross-compilation support seems broken currently:
1.46      dvdkhlng  110:         include arch/misc/sokoban.fs
1.34      pazsan    111:     [THEN]
1.6       pazsan    112: [THEN]
1.15      jwilke    113: include ./quotes.fs
1.35      pazsan    114: has? ec 0= [IF]
1.13      jwilke    115: include ./toolsext.fs
1.36      pazsan    116: [THEN]
1.13      jwilke    117: include ./tools.fs               \ load tools ( .s dump )
                    118: include ./getdoers.fs
1.1       anton     119: 
                    120: \ Setup                                                13feb93py
                    121: 
1.36      pazsan    122: include ./pass.fs                    \ pass pointers from cross to target
                    123: 
1.4       jwilke    124: has? header [IF]
1.24      jwilke    125:     \ set image size
                    126:     here image-header 2 cells + !         
                    127:     \ set image entry point
                    128:     ' boot >body  image-header 8 cells + A!         
1.1       anton     129: [ELSE]
1.22      crook     130:     >boot
1.1       anton     131: [THEN]
1.16      jwilke    132: 
1.22      crook     133: .unresolved                          \ how did we do?

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