Skip to content

Commit

Permalink
Don't load install-to by default (moved to block 5f)
Browse files Browse the repository at this point in the history
  • Loading branch information
meithecatte committed Mar 6, 2023
1 parent 5ff0aa8 commit 5016138
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
16 changes: 0 additions & 16 deletions filesystem.fth
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,6 @@
-->


( install to other disk )
value target
$2000 constant buffer $4000 #512 u/ constant bufsize
: read-orig target 0. 1 buffer dread ;
: read-ours disk# 0. 1 buffer $200 + dread ;
: copy-code buffer $200 + buffer #446 cmove ;
: write-back target 0. 1 buffer dwrite ;
: copy-mbr read-orig read-ours copy-code write-back ;
: copy-small ( lo count -- ) 2dup 2>r 2>r
disk# 2r> 0 swap buffer dread
target 2r> 0 swap buffer dwrite ;
: copy-rest ( lo count -- ) begin dup while
2dup bufsize min copy-small dup bufsize min tuck - >r + r>
repeat ;
: install-to ( sectors disk -- ) to target copy-mbr
1- 1 swap copy-rest ; -->
( partition table and chainloading )
: load-ptable 0 $1c00 read-block ;
: ptable $1c00 #446 + ;
Expand Down
16 changes: 16 additions & 0 deletions install.fth
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
( install to other disk )
value target
$2000 constant buffer $4000 #512 u/ constant bufsize
: read-orig target 0. 1 buffer dread ;
: read-ours disk# 0. 1 buffer $200 + dread ;
: copy-code buffer $200 + buffer #446 cmove ;
: write-back target 0. 1 buffer dwrite ;
: copy-mbr read-orig read-ours copy-code write-back ;
: copy-small ( lo count -- ) 2dup 2>r 2>r
disk# 2r> 0 swap buffer dread
target 2r> 0 swap buffer dwrite ;
: copy-rest ( lo count -- ) begin dup while
2dup bufsize min copy-small dup bufsize min tuck - >r + r>
repeat ;
: install-to ( sectors disk -- ) to target copy-mbr
1- 1 swap copy-rest ;
1 change: 1 addition & 0 deletions mkdisk.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
(0x2f, 'grep.fth'),
(0x30, 'editor.fth'),
(0x50, 'filesystem.fth'),
(0x5f, 'install.fth'),
(0x60, 'feddy.fth'),
]

Expand Down

0 comments on commit 5016138

Please sign in to comment.