瀏覽代碼

Make FLUSH also invalidate the blk cache

master
Virgil Dupras 3 年之前
父節點
當前提交
18f6978399
共有 3 個文件被更改,包括 11 次插入2 次删除
  1. +1
    -1
      blk.fs
  2. +2
    -1
      doc/dict.txt
  3. +8
    -0
      doc/usage.txt

+ 1
- 1
blk.fs 查看文件

@@ -1939,7 +1939,7 @@ SYSVARS 0x0c + :** C<*
: BLK! ( -- )
BLK> @ BLK!* @ EXECUTE
0 BLKDTY ! ;
: FLUSH BLKDTY @ IF BLK! THEN ;
: FLUSH BLKDTY @ IF BLK! THEN -1 BLK> ! ;
: BLK@ ( n -- )
DUP BLK> @ = IF DROP EXIT THEN
FLUSH DUP BLK> ! BLK@* @ EXECUTE ;


+ 2
- 1
doc/dict.txt 查看文件

@@ -264,7 +264,8 @@ BLK> -- a Address of the current block variable.
BLK( -- a Beginning addr of blk buf.
BLK) -- a Ending addr of blk buf.
COPY s d -- Copy contents of s block to d block.
FLUSH -- Write current block to disk if dirty.
FLUSH -- Write current block to disk if dirty and inval-
idates current block cache.
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


+ 8
- 0
doc/usage.txt 查看文件

@@ -108,6 +108,8 @@ Many blocks contain code. That code can be interpreted through
LOAD. Programs stored in blocks frequently have "loader blocks"
that take care of loading all blocks relevant to the program.

# Spanning multiple disks

Blocks spanning multiple disks are tricky. If your media isn't
large enough to hold all Collapse OS blocks in one unit, you'll
have to make it span multiple disks. Block reference in
@@ -123,6 +125,12 @@ Although the usage of absolute LOAD calls are minimally used
When you span Collapse OS over multiple disks, don't forget to
adjust those absolute LOADs.

When you work with multiple disks, you have to remember to FLUSH
before swapping the disk. This will write current block if it's
dirty and also invalidate the cache. This way, you're not at
risk of either overwriting a block on your other disk or LOADing
cached contents without noticing.

# How blocks are organized

Organization of contiguous blocks is an ongoing challenge and


Loading…
取消
儲存