1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-26 22:38:05 +11:00

Compare commits

..

No commits in common. "ab6a2688fe98226f23a8f8c50c15012e375fd08b" and "b89fa2981fab306054c3c8c339e8aa2fed682949" have entirely different histories.

11 changed files with 42 additions and 78 deletions

View File

@ -1,9 +1,7 @@
Return Stack Return Stack
>R n -- R:n Pops PS and push to RS >R n -- R:n Pops PS and push to RS
2>R x y -- R:x y Equivalent to SWAP >R >R
R> R:n -- n Pops RS and push to PS R> R:n -- n Pops RS and push to PS
2R> R:x y -- x y Equivalent to R> R> SWAP
I -- n Copy RS TOS to PS I -- n Copy RS TOS to PS
I' -- n Copy RS second item to PS I' -- n Copy RS second item to PS
J -- n Copy RS third item to PS J -- n Copy RS third item to PS

View File

@ -2,7 +2,7 @@ T ( n -- ): select line n for editing.
P xxx: put typed line on selected line. P xxx: put typed line on selected line.
U xxx: insert typed line on selected line. U xxx: insert typed line on selected line.
F xxx: find typed string in block. F xxx: find typed string in block.
I xxx: insert typed string at cursor

View File

@ -1,5 +1,5 @@
50 LOAD+ ( B152, extras ) 50 LOAD+ ( B152, extras )
1 6 LOADR+ 1 5 LOADR+
: BROWSE : BROWSE
0 ACC ! L 0 ACC ! L

View File

@ -1,5 +1,5 @@
: _type ( buf -- ) : _type ( buf -- )
C< DUP 0xd = IF 2DROP EXIT THEN OVER DUP _zbuf ( c a ) C< DUP 0xd = IF DROP EXIT THEN OVER DUP _zbuf ( c a )
BEGIN ( c a ) BEGIN ( c a )
C!+ C< SWAP C!+ C< SWAP
OVER 0x0d = UNTIL ( c a ) C! ; OVER 0x0d = UNTIL ( c a ) C! ;

15
blk/108
View File

@ -1,15 +0,0 @@
: _ilen ( length of str in IBUF )
IBUF BEGIN C@+ EOL? UNTIL IBUF - 1- ;
: I
IBUF _type EDPOS @ 64 /MOD ( cno lno )
1+ 64 * _cpos ( cno next-line-ptr )
SWAP 63 -^ _ilen ( nlp nb-of-chars-to-move ilen )
2DUP > IF
SWAP OVER - 1+ ( nlp ilen nbc ) 0 DO ( a ilen )
SWAP 1- 2DUP -^ ( ilen a-1 a-ilen-1 ) C@ OVER C!
SWAP ( a ilen )
LOOP
ELSE DROP ( ilen becomes nbc )
THEN
SWAP DROP IBUF EDPOS @ _cpos ROT MOVE
;

24
blk/326
View File

@ -1,17 +1,13 @@
CODE >R CODE >R
HL POPqq, chkPS, HL POPqq,
17 BCALL, ( 17 == pushRS ) chkPS,
;CODE ( 17 == pushRS )
CODE 2>R 17 BCALL,
DE POPqq, HL POPqq, chkPS, ;CODE
17 BCALL, ( 17 == pushRS ) EXDEHL, 17 BCALL,
;CODE CODE R>
CODE R> ( 20 == popRS )
20 BCALL, ( 20 == popRS ) 20 BCALL,
HL PUSHqq, HL PUSHqq,
;CODE
CODE 2R>
20 BCALL, ( 20 == popRS ) EXDEHL, 20 BCALL,
HL PUSHqq, DE PUSHqq,
;CODE ;CODE

View File

@ -5,6 +5,9 @@
( In addition to pushing H@ this compiles 2 >R so that loop ( In addition to pushing H@ this compiles 2 >R so that loop
variables are sent to PS at runtime ) variables are sent to PS at runtime )
: DO COMPILE 2>R H@ ; IMMEDIATE : DO
COMPILE SWAP COMPILE >R COMPILE >R
H@
; IMMEDIATE

View File

@ -12,5 +12,5 @@
: LOOP : LOOP
COMPILE _ COMPILE (?br) COMPILE _ COMPILE (?br)
H@ - , H@ - ,
COMPILE 2R> COMPILE 2DROP COMPILE R> COMPILE DROP COMPILE R> COMPILE DROP
; IMMEDIATE ; IMMEDIATE

View File

@ -1,12 +1,10 @@
: .2 DUP 10 < IF SPC THEN . ; : .2 DUP 10 < IF SPC THEN . ;
: EOL? ( c -- f ) DUP 0xd = SWAP NOT OR ;
: LIST : LIST
BLK@ BLK@
16 0 DO 16 0 DO
I 1+ .2 SPC I 1+ .2 SPC
64 I * BLK( + DUP 64 + SWAP DO 64 I * BLK( + (print)
I C@ DUP EOL? IF DROP LEAVE ELSE EMIT THEN
LOOP
NL NL
LOOP LOOP
; ;

Binary file not shown.

View File

@ -276,47 +276,31 @@ you're already supposed to know that one). Then, run `BYE` to return to TRSDOS
just halting). Then, you can dump memory to floppy as you already did for just halting). Then, you can dump memory to floppy as you already did for
`RECV`. `RECV`.
## Sending blkfs to floppy ## Configuration
As it is, your system fully supports reading and writing to floppy drive 1. It In addition to the generic basic shell, this build of Collapse OS has support
also had `*CL<` to read a char from `*cl` and `*CL>` to emit a char to `*cl`. for floppy drive `:1` as a block device (mapped to device `0`). Block device
commands work as expected.
That's all you need to have a full Collapse OS with access to disk blocks. In addition to this, there is a `flush` command to ensure that dirty buffers are
synced to disk. Make sure you run this after a write operation or before
swapping disks.
First, make sure your floppies are formatted. Collapse OS is currently On top of that, there's CFS support builtin. To enable a FS, type `fson` while
hardcoded to single side and single density, which means there's a limit of 100 the active block device is properly placed (you can initialize a new FS by
blocks per disk. writing `CFS\0\0\0\0` to the disk). If it doesn't error out, commands like
`fls` and `fnew` will work. Don't forget to flush when you're finished :)
You'll need to send those blocks through RS-232. Begin by taking over the There is also a custom `recv` command that does the same "ping pong" as in
prompt: `recv.asm`, but once. It puts the result in `A`. This can be useful to send down
a raw CFS: you just need a while loop that repeatedly call `recv:putb a`.
' *CL> 0x53 RAM+ ! ## Assembling programs
' *CL< 0x55 RAM+ !
See B80 for details about those RAM offsets. Your serial link now has the Running `make` will yield a `floppy.cfs` file that you can dump on a disk. This
prompt. Now, you can use `/tools/blkup` to send a disk's contents. First, CFS contains a properly configured `zasm` as well as a test `hello.asm` file.
extract the first 100 blocks from blkfs:
dd if=emul/blkfs bs=1024 count=100 > d1
Now, insert your formatted disk in drive 1 and push your blocks:
tools/blkup /dev/ttyUSB0 0 d1
It takes a while, but you will end up having your first 100 blocks on floppy!
Go ahead, `LIST` around. Then, repeat for other disks.
## Floppy organisation
Making blkfs span multiple disk is a bit problematic with regards to absolute
block references in the code. You'll need to work a bit to design your very
own Collapse OS floppy set. See Usage guide (B3) for details.
## Self-hosting
As it is, your installment of Collapse OS is self-hosting using instructions
very similar to `recipes/rc2014/selhost`. The difference is that instead of
writing the binary you have in memory to EEPROM, you'll quit to TRSDOS with
`BYE` and use TRSDOS' `DUMP` utility to save to disk like you already did
before.
By mounting this CFS (running `fson` with the active device properly placed),
you can assemble and run a binary from `hello.asm` in the same way that you
would in any CFS-enabled shell. You'll then see those sweet "Assembled from a
TRS-80" words!