Hardware
The Silicon hard disk designed by Andrew Gregory delivers a 128K battery backed up disk drive to DOS65, as third drive 2:. It is empty after a boot of the system by formatting by a program at startup.
Extremely useful to use for utilities and fast disk access for temporary files, leaving drive 0: and 1: free to switch floppies. Ofcourse all is lost on the silicon drive if the battery backup is not active.
The hardware consists of 4x 62256 SRAMs with glue logic and latches to hardware addresses latch at $FFF1 and disc paged memory at $E200. he hardware of the disc consists of 256 blocks of 512 bytes.
A block is selected by writing its number to the block latch at $FFF1. This also activates the card.
The card can be deactivated leaving the 512 bytes of memory available to other cards by writing anything to $FFF0.
Software
The following program formats a silicon disk, to be used at boot in LOGIN.COM, note that this destroys the contents!
ttl Silicon disc formatter V0.1
pag 66
;
;files silicon.MAC
;
;last modified 20th February 1988
;
;program Silicon
;
;function Verify and format silicon disc
; This version for 128K discs
;
;usage SIlicon -AVY
;
;by Andrew Gregory
;
;
;Notes: The hardware of the disc consists of 256 blocks
;of 512 bytes. A block is selected by writing its number
;to the block latch at $fff1. This also activates the card.
;The card can be deactivated leaving the 512 bytes of memory
;available to other cards by writing anything to $fff0
;
;The disc is configured to 16 sectors by 32 tracks
;in software. (Performed by setup routine in
;dospatch.bin).
;
;DOS65 routines and variables
lib dvar.mac
opt lis
;
;interface addresses
;
;hardware addresses
latch equ $FFF1 paging latch
silic equ $E200 disc paged memory
;
;zero page workspace
;
org $80
opt1 res 1
;
org $A000
jmp begin
;
;give help reply
fcc $C8,$C5,$CC,$D0
fcc $EA,$EA,$EA
fcc '128K SILICON DISC FORMATTER v0.1'
fcc '\rSyntax: SILicon -AVY'
fcc '\rOptions -A : Close all files if error'
fcc '\r -V : Verify before formatting'
fcc '\r -Y : Do not ask for '
fcc 'permission first',0
;
;tables
;point to each fcb+0 (indicates if file open)
fcb0 fcc 0,24,48,72,96,120
;point to each fcb+13 (indicates drive/dir)
fcb13 fcc 13,37,61,85,109,133
;
begin php save flags
;
jsr sopt get options
fcc 'AYV',0
bcc 1.f branch if OK
er1 jsr print
fcc 'Illegal -options',0
exitcr jsr crlf
exit plp
rts return to DOS65
;
er2 jsr print
fcc '*** File(s) open on drive 2',0
jmp err
;
;Check that all files to this drive are closed:
1 ldx #5 six files
3 ldy fcb0,x
lda varo,y file number x+4 open?
beq 2.f branch if no
ldy fcb13,x
lda varo,y
and #3 discard sub-dir
cmp #2 drive 2?
beq er2 error if yes
2 dex
bpl 3.b
;
lda opt Get options
asla
sta opt1
asl opt1 Permission needed?
bcs 1.f branch if no
jsr print
fcc 'Destroy silicon disc? Y/N ',0
cli
jsr in get input
jsr loupch
cmp #'Y
bne exitcr abort if no
jsr crlf
;
1 lda #0 try to find out if
tay card plugged in.
dey
sta latch First block
sta silic
cmp silic
bne 0.f
sty silic
cpy silic
beq 2.f
0 jsr print
fcc '*** Silicon disc not working',0
;
err lda opt -A option
bpl 0.f
jsr sync close all files
0 jmp exitcr
;
2 sta silic+$100 second block
cmp silic+$100
bne 0.b
sty silic+$100
cpy silic+$100
bne 0.b
1 asl opt1 Verification?
bcs 4.f Branch if yes
jmp 9.f
;
;
;fill all memory with $00
4 tax
3 stx latch
tay
2 sta silic,y
sta silic+$100,y second page
iny
bne 2.b
inx
bne 3.b
;
;check all 0's and fill with $ff
tax
3 stx latch
ldy #0
2 lda silic,y
bne badmem1
lda #$ff
sta silic,y
cmp silic,y
bne badmem1
lda silic+$100,y
bne badmem2
lda #$ff
sta silic+$100,y
cmp silic+$100,y
bne badmem2
iny
bne 2.b
inx
bne 3.b
;
beq 9.f
;
;Error message and return.
badmem1 sec
bcs 1.f
badmem2 clc
1 txa
php
jsr print
fcc '*** Error at block=',0
tay
pha
txa
jsr hexout
jsr print
fcc ' address=',0
pla
plp
bcc 1.f
jsr print
fcc 'E2',0
jmp 2.f
1 jsr print
fcc 'E3',0
2 jsr hexout
jsr crlf
jmp err
;
;
;Copy syssec to track 0 sector 1
9 ldy #0
sty latch
1 lda sysdat,y
sta silic,y
iny
bne 1.b
;
;set creation and modification dates
ldx #3
6 lda date,x
sta silic+$58,x
sta silic+$5C,x
dex
bpl 6.b
;
;fill directory sector with zeros
;track 0 sector 3.
tya
ldx #32
stx latch
2 sta silic,y
iny
bne 2.b
plp
rts
;
;system sector. 256 bytes.
sysdat fcc '0123456789ABCDEF' stab. Not used.
fcc '0123456789ABCDEF'
fcc $80 s.mode indicate stab not used
fcc 32 s.mtrk number of tracks
fcc 16 s.mcil sectors/track
fcc 16 s.msec single-sided
fcc $ff,$ff,$ff,$ff
fcc 1 s.acnt 1 sector per bit
fcc 1 s.sht one shift -> bmap pos.
fcc 0 s.tbas first tsl track
fcc $ff s.tbam
fcc 1 s.dbas first data track
fcc 0,0,0 reserved
fcc 0,0 s.boot Not bootable
;
; Subdirectory track-sector addresses
fcc 0,0 A
fcc 0,0 B
fcc 0,0 C
fcc 0,0 D
fcc 0,0 E
fcc 0,0 F
fcc 0,0 G
;
;disc name. Exactly 24 characters.
fcc 'Silicon disc'
fcc 0,0,0,0
fcc 0,0,0,0
fcc 0,0,0,0
;
fcc 0,0,0,0 s.cdat creation date
fcc 0,0,0,0 s.mdat modification date
;
;bitmap follows. 64 bytes signifigant. Unused bytes
;must all be zero. Each bit represents occupancy
;of one sector.
fcc $fa,$ff,$ff,$ff,$ff,$ff,$ff,$ff
fcc $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
fcc $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
fcc $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
fcc $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
fcc $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
fcc $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
fcc $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
fcc 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
fcc 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
fcc 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
fcc 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
fcc 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
fcc 0,0,0,0,0,0,0,0,0,0,0
ttl "tp DOS65 Patch for silicon disc %s page %d"
pag 66
; ;files dospatch.MAC ; ;last modified 15th February 1988 ; ;program DOS65 patch for silicon disc ; ;function replacement read /write routines ; ;by Andrew Gregory ; England ; ;Include the following statement near the beginning ;of your LOGIN.COM command: ;LOAD dospatch.bin ; ; ***************************************************** ; * * ; * You may have to assemble to a different address * ; * to suit your version of DOS65 * ; * * ; * These routines overwrite the existing routines * ; * without any spare bytes! * ; * * ; ***************************************************** ; ;DOS65 routines and variables lib dvar.mac opt lis ; ;64K Virtual disc configured as 16 tracks by 16 sectors. ;128K disc configured as 32 tracks by 16 sectors. ; ;hardware addresses silic equ $e200 disc memory latch equ $fff1 disc page latch disable equ $fff0 disable card address ; ;X=trk number. Y=sector number. ; org $cee3 setup sty $aafd (ytmp) bit $aaf8 (ctype) fcc $10,$17 bpl if floppy dey tya ldy #4 2 pha txa lsra tax pla rola dey bne 2.b sty disable clear all devices sta latch select board and page ora #$80 N=1 clc ret rts ; ; ;64K drive (2 track): x=0 ;128K drive (1 track): x=0 or x=1 ; org $ce4a wvirt sec same as existing routine rvirt php " sei " ldy #0 txa beq 10.f if track 0 ; 0 bcc 2.f lda [rwpoin],y write sta silic+$100,y bcs 3.f always 2 lda silic+$100,y read sta [rwpoin],y 3 iny bne 0.b beq 9.f ; 10 bcc 2.f lda [rwpoin],y write sta silic,y bcs 3.f always 2 lda silic,y read sta [rwpoin],y 3 iny bne 10.b ; 9 plp clc jmp $ce2c (rs9) Check this!
