Rename Inner core to Cross-compiled core

And refreshed description.
This commit is contained in:
Virgil Dupras 2020-05-11 22:23:26 -04:00
parent 6beb082e29
commit 9ad7ee7a4b
5 changed files with 31 additions and 45 deletions

View File

@ -6,7 +6,7 @@ MASTER INDEX
150 Extra words 150 Extra words
200 Z80 assembler 260 Cross compilation 200 Z80 assembler 260 Cross compilation
280 Z80 boot code 350 ACIA driver 280 Z80 boot code 350 ACIA driver
370 SD Card driver 390 Inner core 370 SD Card driver 390 Cross-compiled core
420 Core words 480 AT28 Driver 420 Core words 480 AT28 Driver
490 TRS-80 Recipe 520 Fonts 490 TRS-80 Recipe 520 Fonts
550 TI-84+ Recipe 550 TI-84+ Recipe

20
blk/390
View File

@ -1,16 +1,14 @@
Inner core Cross-compiled core
This unit represents core definitions that happen right after This units contains core Collapse OS that are cross-compiled.
native definitions. Before core.fs. During building, these come right after the boot binary (B280).
Unlike core.fs and its followers, this unit isn't self- Because this unit is designed to be cross-compiled, things are
sustained. Like native defs it uses the machinery of a full a little weird. It is compiling in the context of a full
Forth interpreter, notably for flow structures. Forth interpreter with all bells and whistles (and z80
assembler), but it has to obey strict rules:
Because of that, it has to obey specific rules:
1. It cannot compile a word from higher layers. Using
immediates is fine though.
1. It cannot compile a word from higher layers. Immediates are
fine.
(cont.) (cont.)

28
blk/391
View File

@ -1,16 +1,16 @@
2. If it references a word from this unit or from native 2. Immediate words that have been cross compiled *cannot* be
definitions, these need to be properly offsetted because used. Only immediates from the host system can be used.
their offset at compile time are not the same as their 3. If an immediate word compiles words, it can only be words
runtime offsets. that are part of the stable ABI.
3. Anything they refer to in the boot binary has to be properly
stabilized.
4. Make sure that the words you compile are not overridden by
the full interpreter.
5. When using words as immediates, make sure that they're not
defined in icore or, if they are, make sure that they are
*not* offsetted
All of this is because when cross compiling, all atom ref-
erences are offsetted to the target system and are thus
unusable directly. For the same reason, any reference to a word
in the host system will obviously be wrong in the target
system. More details in B260.
This unit is loaded in two "low" and "high" parts. The low part
is the biggest chunk and has the most definitions. The high
(cont.) part is the "sensitive" chunk and contains "LITN", ":" and ";"
definitions which, once defined, kind of make any more defs
impossible. (cont.)

12
blk/392
View File

@ -1,15 +1,3 @@
Those rules are mostly met by the "xcomp" unit, which is
expected to have been loaded prior to icore and redefines ":"
and other defining words. So, in other words, when compiling
icore, ":" doesn't means what you think it means, go look in
B260.
This is loaded in two "low" and "high" parts. The low part is
the biggest chunk and has the most definitions. The high part
is the "sensitive" chunk and contains "LITN", ":" and ";"
definitions which, once defined, kind of make any more defs
impossible.
The gap between these 2 parts is the ideal place to put device The gap between these 2 parts is the ideal place to put device
driver code. Load the low part with "393 LOAD", the high part driver code. Load the low part with "393 LOAD", the high part
with "415 LOAD" with "415 LOAD"

14
blk/420
View File

@ -1,12 +1,12 @@
Core words Core words
These words follow Inner core words, but unlike them, these are These words follow cross-compiled words, but unlike them, these
self-bootstrapping and don't depend on the Cross Compiler. They are self-bootstrapping and don't depend on the Cross Compiler.
will typically be included in source form right after a stage1 They will typically be included in source form right after a
binary which will interpret it on boot and bootstrap itself to stage1 binary which will interpret it on boot and bootstrap
a full intepreter, which can then be relinked with the itself to a full intepreter, which can then be relinked with
Relinker. There is no loader for these libraries because you the Relinker. There is no loader for these libraries because
will typically XPACK (B267) them. you will typically XPACK (B267) them.
422 core 438 print 422 core 438 print
442 fmt 447 readln 442 fmt 447 readln