mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-02 06:30:55 +11:00
Compare commits
4 Commits
b046aba7f9
...
f38de1c151
Author | SHA1 | Date | |
---|---|---|---|
|
f38de1c151 | ||
|
0044011f06 | ||
|
0cf26547ff | ||
|
581f04a4bc |
6
blk/001
6
blk/001
@ -3,12 +3,12 @@ MASTER INDEX
|
||||
3 Usage 30 Dictionary
|
||||
70 Implementation notes 100 Block editor
|
||||
120 Linker 140 Addressed devices
|
||||
150 AT28 Driver
|
||||
150 Extra words
|
||||
200 Z80 assembler 260 Cross compilation
|
||||
280 Z80 boot code 350 ACIA driver
|
||||
370 SD Card driver 390 Inner core
|
||||
420 Core words
|
||||
|
||||
420 Core words 480 AT28 Driver
|
||||
490 TRS80 Drivers
|
||||
|
||||
|
||||
|
||||
|
3
blk/030
3
blk/030
@ -1,6 +1,7 @@
|
||||
Dictionary
|
||||
|
||||
Be sure to read usage guide (B3) first.
|
||||
List of words defined in Inner core (B390), Core words (B420)
|
||||
and Extra words (B150).
|
||||
|
||||
31 Glossary 34 Symbols
|
||||
37 Entry management 40 Defining words
|
||||
|
4
blk/037
4
blk/037
@ -1,7 +1,7 @@
|
||||
Entry management
|
||||
|
||||
(find) a -- a f Read at a and find it in dict. If found,
|
||||
f=1 and a = wordref. If not found, f=0 and
|
||||
'? x -- a f Find x it in dict. If found, f=1 and
|
||||
a = wordref. If not found, f=0 and
|
||||
a = string addr.
|
||||
' x -- a Push addr of word x to a. If not found,
|
||||
aborts.
|
||||
|
2
blk/064
2
blk/064
@ -1,6 +1,8 @@
|
||||
Disk
|
||||
|
||||
BLK> -- a Address of the current block variable.
|
||||
COPY s d -- Copy contents of s block to d block.
|
||||
FLUSH -- Write current block to disk if dirty.
|
||||
LIST n -- Prints the contents of the block n on screen
|
||||
in the form of 16 lines of 64 columns.
|
||||
LOAD n -- Interprets Forth code from block n
|
||||
|
16
blk/150
16
blk/150
@ -1,6 +1,14 @@
|
||||
AT28 Driver
|
||||
Extra words
|
||||
|
||||
Write to an AT28 EEPROM while making sure that proper timing
|
||||
is followed and verify data integrity.
|
||||
The Core words (B420) section contains the absolute minimum
|
||||
needed to get a usable Forth interpreter with input buffer and
|
||||
disk blocks access running. The goal here is to minimize the
|
||||
binary size of a minimum Collapse OS install.
|
||||
|
||||
Load with "151 LOAD"
|
||||
Extra words are words you will most likely want because they
|
||||
are generally useful. They are so useful that they are part
|
||||
of the Dictionary (B30).
|
||||
|
||||
Some programs need them, so they will automatically LOAD them.
|
||||
To that end, the loader is conditional: it aborts if extra
|
||||
words are already present. Load with "152 LOAD".
|
||||
|
3
blk/152
Normal file
3
blk/152
Normal file
@ -0,0 +1,3 @@
|
||||
'? CASE NOT [IF]
|
||||
153 157 LOADR
|
||||
[THEN] DROP ( from '? )
|
@ -8,3 +8,4 @@
|
||||
; IMMEDIATE
|
||||
: ENDOF [COMPILE] ELSE ; IMMEDIATE
|
||||
|
||||
|
6
blk/155
Normal file
6
blk/155
Normal file
@ -0,0 +1,6 @@
|
||||
: FILL ( a n b -- )
|
||||
SWAP 2 PICK + ( a b a+n ) ROT ( b a+n a ) DO ( b )
|
||||
DUP I C!
|
||||
LOOP
|
||||
;
|
||||
|
4
blk/156
Normal file
4
blk/156
Normal file
@ -0,0 +1,4 @@
|
||||
: EMPTY
|
||||
LIT< _sys (find) NOT IF ABORT THEN
|
||||
DUP HERE ! CURRENT ! ;
|
||||
|
5
blk/157
Normal file
5
blk/157
Normal file
@ -0,0 +1,5 @@
|
||||
: WIPE BLK( 1024 0 FILL BLK!! ;
|
||||
|
||||
( src dst -- )
|
||||
: COPY SWAP BLK@ BLK> ! BLK! ;
|
||||
|
4
blk/422
4
blk/422
@ -8,9 +8,9 @@
|
||||
: LITS 34 , SCPY ;
|
||||
: LIT< WORD LITS ; IMMEDIATE
|
||||
: LITA 36 , , ;
|
||||
: '? WORD (find) ;
|
||||
: '
|
||||
WORD (find) (?br) [ 4 , ] EXIT
|
||||
'? (?br) [ 4 , ] EXIT
|
||||
LIT< (wnf) (find) DROP EXECUTE
|
||||
;
|
||||
: ['] ' LITA ; IMMEDIATE
|
||||
|
||||
|
5
blk/434
5
blk/434
@ -6,10 +6,5 @@
|
||||
LOOP
|
||||
2DROP
|
||||
;
|
||||
: FILL ( a n b -- )
|
||||
SWAP 2 PICK + ( a b a+n ) ROT ( b a+n a ) DO ( b )
|
||||
DUP I C!
|
||||
LOOP
|
||||
;
|
||||
: DELW 1- 0 SWAP C! ;
|
||||
: PREV 3 - DUP @ - ;
|
||||
|
3
blk/435
3
blk/435
@ -11,6 +11,3 @@
|
||||
WORD( HERE ! ( w )
|
||||
PREV CURRENT !
|
||||
;
|
||||
: EMPTY
|
||||
LIT< _sys (find) NOT IF ABORT THEN
|
||||
DUP HERE ! CURRENT ! ;
|
||||
|
4
blk/466
4
blk/466
@ -2,10 +2,10 @@
|
||||
BLK> @ BLK!* @ EXECUTE
|
||||
0 BLKDTY !
|
||||
;
|
||||
|
||||
: FLUSH BLKDTY @ IF BLK! THEN ;
|
||||
: BLK@ ( n -- )
|
||||
FLUSH
|
||||
DUP BLK> @ = IF DROP EXIT THEN
|
||||
BLKDTY @ IF BLK! THEN
|
||||
DUP BLK> ! BLK@* @ EXECUTE
|
||||
;
|
||||
|
||||
|
2
blk/470
2
blk/470
@ -1,4 +1,2 @@
|
||||
( b1 b2 -- )
|
||||
: LOADR 1+ SWAP DO I DUP . CRLF LOAD LOOP ;
|
||||
|
||||
: WIPE BLK( 1024 0 FILL BLK!! ;
|
||||
|
6
blk/480
Normal file
6
blk/480
Normal file
@ -0,0 +1,6 @@
|
||||
AT28 Driver
|
||||
|
||||
Write to an AT28 EEPROM while making sure that proper timing
|
||||
is followed and verify data integrity.
|
||||
|
||||
Load with "481 LOAD"
|
@ -4,5 +4,5 @@ Drivers for the TRS-80 keyboard, video and floppy. At the
|
||||
moment, they are thin layer over the drivers provided by
|
||||
TRSDOS' SVC.
|
||||
|
||||
Load the Z80 words with "162 LOAD" and the high level part
|
||||
with "164 LOAD".
|
||||
Load the Z80 words with "492 LOAD" and the high level part
|
||||
with "494 LOAD".
|
2
emul/.gitignore
vendored
2
emul/.gitignore
vendored
@ -3,5 +3,5 @@
|
||||
/stage2
|
||||
/forth
|
||||
/*-bin.h
|
||||
/stage1.bin
|
||||
/stage0.bin
|
||||
/blkfs
|
||||
|
@ -14,7 +14,10 @@ $(BLKPACK):
|
||||
$(BIN2C): $(BLKPACK)
|
||||
$(BLKUNPACK): $(BLKPACK)
|
||||
|
||||
stage0-bin.h: $(BIN2C)
|
||||
stage0.bin: stage2 xcomp.fs
|
||||
cat xcomp.fs | ./stage2 > stage0.bin
|
||||
|
||||
stage0-bin.h: stage0.bin $(BIN2C)
|
||||
$(BIN2C) KERNEL < stage0.bin > $@
|
||||
|
||||
stage1: stage.c $(OBJS) stage0-bin.h
|
||||
@ -23,13 +26,11 @@ stage1: stage.c $(OBJS) stage0-bin.h
|
||||
stage1dbg: stage.c $(OBJS) stage0-bin.h
|
||||
$(CC) -DDEBUG stage.c $(OBJS) -o $@
|
||||
|
||||
stage1.bin: stage1.fs stage1
|
||||
./stage1 < stage1.fs > $@
|
||||
# not dependent on forth.bin to avoid circular deps.
|
||||
forth-bin.h: $(BIN2C)
|
||||
$(BIN2C) KERNEL < forth.bin > $@
|
||||
|
||||
stage1-bin.h: stage1.bin $(BIN2C)
|
||||
$(BIN2C) KERNEL < stage1.bin > $@
|
||||
|
||||
stage2: stage.c $(OBJS) stage1-bin.h blkfs-bin.h
|
||||
stage2: stage.c $(OBJS) forth-bin.h blkfs-bin.h
|
||||
$(CC) -DSTAGE2 stage.c $(OBJS) -o $@
|
||||
|
||||
blkfs: $(BLKPACK)
|
||||
@ -38,7 +39,7 @@ blkfs: $(BLKPACK)
|
||||
blkfs-bin.h: blkfs $(BIN2C)
|
||||
$(BIN2C) BLKFS < blkfs > $@
|
||||
|
||||
forth: forth.c $(OBJS) stage1-bin.h blkfs-bin.h
|
||||
forth: forth.c $(OBJS) forth-bin.h blkfs-bin.h
|
||||
$(CC) forth.c $(OBJS) -o $@
|
||||
|
||||
libz80/libz80.o: libz80/z80.c
|
||||
@ -50,8 +51,8 @@ emul.o: emul.c
|
||||
|
||||
|
||||
.PHONY: updatebootstrap
|
||||
updatebootstrap: stage2
|
||||
cat xcomp.fs | ./stage2 > stage0.bin
|
||||
updatebootstrap: stage1 stage1.fs
|
||||
./stage1 < stage1.fs > forth.bin
|
||||
|
||||
.PHONY: pack
|
||||
pack:
|
||||
|
BIN
emul/forth.bin
Normal file
BIN
emul/forth.bin
Normal file
Binary file not shown.
@ -3,7 +3,7 @@
|
||||
#include <unistd.h>
|
||||
#include <termios.h>
|
||||
#include "emul.h"
|
||||
#include "stage1-bin.h"
|
||||
#include "forth-bin.h"
|
||||
#include "blkfs-bin.h"
|
||||
|
||||
// in sync with glue.asm
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <unistd.h>
|
||||
#include "emul.h"
|
||||
#ifdef STAGE2
|
||||
#include "stage1-bin.h"
|
||||
#include "forth-bin.h"
|
||||
#include "blkfs-bin.h"
|
||||
#else
|
||||
#include "stage0-bin.h"
|
||||
|
BIN
emul/stage0.bin
BIN
emul/stage0.bin
Binary file not shown.
@ -46,7 +46,7 @@ Addressed devices are at B140. To know what you have to paste, open the loader
|
||||
block (B142) and see what blocks it loads. For each of the blocks, copy/paste
|
||||
the code in your interpreter.
|
||||
|
||||
Do the same thing with the AT28 driver (B150)
|
||||
Do the same thing with the AT28 driver (B480)
|
||||
|
||||
If you're doing the real thing and not using the emulator, pasting so much code
|
||||
at once might freeze up the RC2014, so it is recommended that you use
|
||||
|
@ -12,7 +12,7 @@ CURRENT @ XCURRENT !
|
||||
H@ 256 /MOD 2 PC! 2 PC!
|
||||
0x3000 BIN( !
|
||||
282 LOAD ( boot.z80 )
|
||||
162 LOAD ( trs80.z80 )
|
||||
492 LOAD ( trs80.z80 )
|
||||
393 LOAD ( icore )
|
||||
(entry) _
|
||||
( Update LATEST )
|
||||
|
Loading…
Reference in New Issue
Block a user