rdos/kernel/fcb.asm

56 lines
1000 B
NASM

; in FCB required
; word offset in rootdir
; used for search
; word current cluster
; byte record num in cluster
; FCB open
fcbopn: ; call fcbfst
; copy match
; store cluster number in fcb
; record = 0
ret
; FCB close
fcbcls: ; flush disk buffer
ret
; FCB find first
fcbfst: ; init search state in FCB
; jmp to fcbnxt
ret
; FCB find next
fcbnxt: ; load rootdir sector from state
; search until next match
; next sec & loop if mismatch
; err exit if no further matches
ret
; FCB delete file
fcbdel: ; call fcbfst
; get search state, load root dir from there
; mark file as deleted
ret
; FCB read
; read sector from cluster into diskbuf
fcbrd: ; read record from sector
; advance record num, carry over to cluster
ret
; FCB write
fcbwr: ; read sector from cluster into diskbuf
; write record into sector
; mark buffer dirty
; advance record num, carry over to cluster
ret
; FCB create
fcbcre:
ret
; FCB rename
fcbren:
ret