include 'gsos.equ' include 'minix.equ' include 'fst.equ' include 'fst.macros' include 'M16.Debug' TimeRec RECORD 0 second DS.B 1 minute DS.B 1 hour DS.B 1 year DS.B 1 day DS.B 1 month DS.B 1 extra DS.B 1 weekDay DS.B 1 ENDR FileInfoRecGS RECORD 0 pCount DS.W 1 pathname DS.L 1 access DS.W 1 fileType DS.W 1 auxType DS.L 1 storageType DS.W 1 createDateTime DS TimeRec modDateTime DS TimeRec optionList DS.L 1 eof DS.L 1 blocksUsed DS.L 1 resourceEOF DS.L 1 resourceBlocks DS.L 1 ENDR FileRec RECORD 0 pathname DS.B 4 fAccess DS.B 2 fileType DS.B 2 auxType DS.B 4 storageType DS.B 2 createDate DS.B 2 createTime DS.B 2 modDate DS.B 2 modTime DS.B 2 blocksUsed DS.B 4 ENDR entry path_to_inode import id_disk import device_read get_file_info procname export with fst_parms with dev_parms with dp jsr path_to_inode bcc @inode rtl @inode ; we have an inode. and my_vcr is valid. ; we need to actually _load_ the inode. ; todo -- check if inode # is valid? ; todo -- check if bit set in imap? ;pha ; space ;~DebugSetTrace #1 ;pla ; prev value ldy #vcr.first_inode_block lda [my_vcr],y asl a ; x 2 sta dev_blk_num ; 32 inodes per block. ; however, I'd rather read half-block chunks, with means ; 16 inodes per half-block. lda inode dec a ; inode 1 is offset 0. lsr a ; / 2 lsr a ; / 4 lsr a ; / 8 lsr a ; / 16 ;lsr a ; / 32 clc adc dev_blk_num sta dev_blk_num lda #512 sta dev_req_cnt lda device sta dev_num jsr device_read bcc ok rtl ok ; find the inode... lda inode dec a ; inode 1 is offset 0. and #$0f ; multiply by 32 asl a ; x 2 asl a ; x 4 asl a ; x 8 asl a ; x 16 asl a ; x 32 clc adc io_buffer sta ptr lda #0 adc io_buffer+2 sta ptr+2 ; copy to dp ldy #0 ldx #0 @loop lda [ptr],y sta disk_inode,x inx inx iny iny cpy #v1_inode.sizeof blt @loop ;pha ; space ;~DebugSetTrace #0 ;pla ; prev value lda