Annotation of gforth/kernel/main.fs, revision 1.37
1.22 crook 1: \ MAIN.FS Kernel main load file 20may93jaw
1.1 anton 2:
1.37 ! anton 3: \ Copyright (C) 1995,1996,1997,1998,2000,2003,2006 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
1.25 pazsan 39: require startup.fs
1.18 jwilke 40: [THEN]
1.1 anton 41:
42: \ include etags.fs
43:
1.22 crook 44: include ./../cross.fs \ cross-compiler
1.1 anton 45:
46: decimal
47:
1.35 pazsan 48: has? rom 0= [IF]
49: has? kernel-start has? kernel-size makekernel
50: [THEN]
51: \ create image-header
1.4 jwilke 52: has? header [IF]
1.29 jwilke 53: here 1802 over
1.23 jwilke 54: A, \ base address
1.22 crook 55: 0 , \ checksum
56: 0 , \ image size (without tags)
1.23 jwilke 57: has? kernel-size
58: , \ dict size
1.22 crook 59: has? stack-size , \ data stack size
60: has? fstack-size , \ FP stack size
61: has? rstack-size , \ return stack size
62: has? lstack-size , \ locals stack size
63: 0 A, \ code entry point
64: 0 A, \ throw entry point
65: has? stack-size , \ unused (possibly tib stack size)
66: 0 , \ unused
67: 0 , \ data stack base
68: 0 , \ fp stack base
69: 0 , \ return stack base
70: 0 , \ locals stack base
1.1 anton 71: [THEN]
72:
73: doc-off
1.4 jwilke 74: has? prims [IF]
1.22 crook 75: include ./aliases.fs \ primitive aliases
1.1 anton 76: [ELSE]
77: prims-include
78: undef-words
1.17 pazsan 79: include prim.fs
1.24 jwilke 80: all-words
1.1 anton 81: [THEN]
82: doc-on
83:
1.26 jwilke 84: has? header [IF]
1.29 jwilke 85: 1802 <> [IF] .s cr .( header start address expected!) cr uffz [THEN]
1.28 jwilke 86: AConstant image-header
1.26 jwilke 87: : forthstart image-header @ ;
88: [THEN]
89:
1.23 jwilke 90: \ 0 AConstant forthstart
1.1 anton 91:
1.22 crook 92: \ include ./vars.fs \ variables and other stuff
93: \ include kernel/version.fs \ is in $(build)/kernel
94: include ./kernel.fs \ kernel
1.14 jwilke 95: \ include ./errore.fs
1.13 jwilke 96: include ./doers.fs
1.4 jwilke 97: has? file [IF]
1.22 crook 98: include ./args.fs
99: include ./files.fs \ file words
100: include ./paths.fs
101: include ./require.fs
1.1 anton 102: [THEN]
1.6 pazsan 103:
104: has? compiler [IF]
1.22 crook 105: has? glocals [IF]
106: include ./cond.fs \ IF and co.
107: [ELSE]
108: include ./cond-old.fs \ IF and co. withoutlocals
109: [THEN]
110: \ these two games can be added to provide complex examples for the 4stack
111: \ and misc simulators (see arch/4stack/README and arch/misc/README).
1.34 pazsan 112: has? games [IF]
113: include arch/misc/tt.fs
114: include arch/misc/sokoban.fs
115: [THEN]
1.6 pazsan 116: [THEN]
1.15 jwilke 117: include ./quotes.fs
1.35 pazsan 118: has? ec 0= [IF]
1.13 jwilke 119: include ./toolsext.fs
1.36 pazsan 120: [THEN]
1.13 jwilke 121: include ./tools.fs \ load tools ( .s dump )
122: include ./getdoers.fs
1.1 anton 123:
124: \ Setup 13feb93py
125:
1.36 pazsan 126: include ./pass.fs \ pass pointers from cross to target
127:
1.4 jwilke 128: has? header [IF]
1.24 jwilke 129: \ set image size
130: here image-header 2 cells + !
131: \ set image entry point
132: ' boot >body image-header 8 cells + A!
1.1 anton 133: [ELSE]
1.22 crook 134: >boot
1.1 anton 135: [THEN]
1.16 jwilke 136:
1.22 crook 137: .unresolved \ how did we do?
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>