ArnoldLayne wrote:
Hi,
we are working our own FAT32 implementation as part of the operating system "SteckOS" for our 6502-based homebrew computer "Steckschwein"
http://www.steckschwein.deIt's not complete yet, we currently do not follow cluster chains, so files > 1 cluster are a problem.
We chose not to support long file names either.
But creating, reading, writing files and directories works. The "API" is loosely modeled after POSIX (open,close,read,write).
The code is publicly available:
https://bitbucket.org/steckschwein/stec ... os/kernel/Our implementation only needs a means to read and write (512 byte)blocks and a few memory locations.
Cheers,
Thomas
Hi again!
I am grinding through your code, and mostly its easy reading. Only a few 65c02 specific instructions, so they are easy to replace. At least up until now. Then I came accross this code segment which makes less sense to me:
Code:
path_inverse:
stz krn_tmp
stz krn_tmp2
ldy #0
jsr l_inv
iny
lda #0
sta (krn_ptr2),y
rts
l_inv:
lda (krn_ptr3), y
iny
cpy krn_tmp3
beq l_seg
cmp #'/'
bne l_inv
phy
jsr l_inv
ply
sty krn_tmp
l_seg:
ldy krn_tmp
inc krn_tmp
lda (krn_ptr3), y
ldy krn_tmp2
inc krn_tmp2
sta (krn_ptr2), y
cmp #'/'
bne l_seg
rts
The jsr instruction that goes back to its own code segment seems somewhat untraditional. Could you explain what is happening here?