Annotation of gforth/kernel/main.fs, revision 1.18
1.1 anton 1: \ MAIN.FS Kernal main load file 20may93jaw
2:
1.10 anton 3: \ Copyright (C) 1995,1996,1997,1998 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
19: \ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20:
21: \ : include bl word count included ;
22: \ we want write include...
23:
24: \ : : ( -- colon-sys ) Header [ ' : @ ] ALiteral cfa, 0 ] ;
25: \ : ; ( colon-sys -- ) ?struc postpone exit reveal postpone [ ; immediate
26: \ : :noname ( -- xt colon-sys ) here [ ' : @ ] ALiteral cfa, 0 ] ;
27:
28: Create mach-file here over 1+ allot place
29:
1.18 ! jwilke 30: 0 [IF]
! 31: \ debugging: produce a relocation and a symbol table
! 32: s" rel-table" r/w create-file throw
! 33: Constant fd-relocation-table
! 34:
! 35: \ debuggging: produce a symbol table
! 36: s" sym-table" r/w create-file throw
! 37: Constant fd-symbol-table
! 38: [THEN]
! 39:
! 40:
! 41: bl word vocabulary find nip 0= [IF]
! 42: \ if search order stuff is missing assume we compile on a gforth
! 43: \ system and include it
! 44: \ We want the files taken from out current gforth installation
! 45: \ so we don't include relatively to this file
! 46:
! 47: require search.fs
! 48: require errors.fs
! 49: require extend.fs
! 50:
! 51: [THEN]
1.1 anton 52:
53: \ include etags.fs
54:
1.14 jwilke 55: include ./../cross.fs \ include cross-compiler
1.1 anton 56:
57: decimal
58:
1.11 pazsan 59: has? kernel-size makekernel ( size )
1.1 anton 60: \ create image-header
1.4 jwilke 61: has? header [IF]
1.1 anton 62: 0 A, \ base address
63: 0 , \ checksum
64: 0 , \ image size (without tags)
1.11 pazsan 65: >address , \ dict size
66: has? stack-size , \ data stack size
67: has? fstack-size , \ FP stack size
68: has? rstack-size , \ return stack size
69: has? lstack-size , \ locals stack size
1.1 anton 70: 0 A, \ code entry point
71: 0 A, \ throw entry point
1.11 pazsan 72: has? stack-size , \ unused (possibly tib stack size)
1.1 anton 73: 0 , \ unused
74: 0 , \ data stack base
75: 0 , \ fp stack base
76: 0 , \ return stack base
77: 0 , \ locals stack base
78: [THEN]
79:
80: UNLOCK ghost - drop \ ghost must exist because - would be treated as number
81: LOCK
82:
83: doc-off
1.4 jwilke 84: has? prims [IF]
1.14 jwilke 85: include ./aliases.fs \ include primitive aliases
1.1 anton 86: [ELSE]
87: prims-include
88: undef-words
1.17 pazsan 89: include prim.fs
1.1 anton 90: all-words UNLOCK LOCK
91: [THEN]
92: doc-on
93:
94: 0 AConstant forthstart
95:
1.14 jwilke 96: \ include ./vars.fs \ variables and other stuff
97: \ include kernel/version.fs \ is in $(build)/kernel
1.13 jwilke 98: include ./kernel.fs \ load kernel
1.15 jwilke 99: \ include ./special.fs \ special must be last!
1.14 jwilke 100: \ include ./errore.fs
1.13 jwilke 101: include ./doers.fs
1.4 jwilke 102: has? file [IF]
1.13 jwilke 103: include ./args.fs
104: include ./files.fs \ load file words
105: include ./paths.fs
106: include ./require.fs
1.1 anton 107: [THEN]
1.6 pazsan 108:
109: has? compiler [IF]
1.4 jwilke 110: has? glocals [IF]
1.13 jwilke 111: include ./cond.fs \ load IF and co
1.1 anton 112: [ELSE]
1.13 jwilke 113: include ./cond-old.fs \ load IF and co w/o locals
1.1 anton 114: [THEN]
1.2 pazsan 115: \ include arch/misc/tt.fs
116: \ include arch/misc/sokoban.fs
1.6 pazsan 117: [THEN]
1.15 jwilke 118: include ./quotes.fs
1.13 jwilke 119: include ./toolsext.fs
120: include ./tools.fs \ load tools ( .s dump )
121: include ./getdoers.fs
1.1 anton 122:
123: \ Setup 13feb93py
124:
1.4 jwilke 125: has? header [IF]
1.11 pazsan 126: \ UNLOCK
127: here >address 2 cells ! \ image size
128: ' boot >body 8 cells A! \ Entry point
129: \ LOCK
1.1 anton 130: [ELSE]
131: >boot
132: [THEN]
133:
1.16 jwilke 134: include ./pass.fs
135:
1.1 anton 136: .unresolved
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>