소스 검색

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


불러오는 중...
취소
저장