Kernel 0.93+

This commit is contained in:
Rémy GIBERT 2019-11-20 08:04:00 +01:00
parent e9968face0
commit 202ae6eac9
6 changed files with 81 additions and 33 deletions

Binary file not shown.

View File

@ -216,7 +216,7 @@ isname and #$0F strip byte (is checked by 'filfound')
cmpname inx (first) next letter index
iny
.DO LOWERCASE=1
.DO LOWERCASE=2
phy
cpy #8 CS if MIN_VERSION to use
@ -347,9 +347,6 @@ L398A cmp pathbuf,y is it the same as requested vol name?
dec namcnt last character?
bpl L398A if not.
.DO LOWERCASEMATCH=1
.FIN
plx restore pointer to matching vcb.
stx vcbptr save it for future reference.
lda vcbbuf+16,x get it's device #
@ -375,8 +372,10 @@ L39AC tay if prefix then find ptr to prefixed
L39C2 jsr rdgbuf read in directory (or prefix dir)
bcs L39CC if error then look on other devices.
jsr cmppnam compare dir name with path name.
jsr XDOS.CheckVolName compare dir name with path name.
bcc L39F0 if they match, stop looking.
L39CC ldx vcbptr check if current (matched) vcb is active
lda vcbbuf+17,x i.e. does it have open files?
bmi L39ED report not found if active.
@ -398,12 +397,14 @@ L39ED lda #MLI.E.VNOTFND no mounted volume
sec error
L39F0 rts
L39F1 ldx DEVCNT now remove the device from the list
L39F1 ldx DEVCNT now remove the device from the list
L39F4 cmp loklst,x of prospective devices.
beq L39FE branch if match.
dex look until found.
bpl L39F4 always taken (usually) unless
bmi L39ED if dev was removed from devlst (/RAM).
L39FE sta devnum preserve device to be checked next.
stz loklst,x mark this one as tested.
jsr fnddvcb find vcb that claims this dev (if any).
@ -413,26 +414,33 @@ L39FE sta devnum preserve device to be checked next.
beq L3A16 if free vcb.
lda vcbbuf+17,x is this volume active?
bmi L39E2 if so, no need to re-log.
L3A16 lda #$02 go read root dir into gbuf
ldx #$00
jsr rdblk
bcs L39E2 ignore if unable to read.
jsr logvcb go log in volume name.
bcs L39E2 look at next if non-xdos disk mounted.
jsr cmppnam is this the volume ?
jsr XDOS.CheckVolName is this the volume ?
bcs L39E2 if not
L3A29 rts
*--------------------------------------
mvdevnums ldx DEVCNT copy all dev #'s to be checked.
L3A2D lda DEVLST,x active device list.
and #$F0 strip device type info.
sta loklst,x copy them to a temp workspace
dex
bpl L3A2D
ldx DEVCNT
rts
*--------------------------------------
fnddvcb lda #$00 look for vcb with this device#
ldy #$FF
L3A40 tax new index to next vcb
lda vcbbuf+16,x check all devnums
cmp devnum is this the vcb?
@ -440,17 +448,22 @@ L3A40 tax new index to next vcb
stx vcbptr
clc indicates found
rts
L3A4E lda vcbbuf,x is this a free vcb?
bne L3A57 if not
iny
stx vcbptr
L3A57 txa
clc inc index to next vcb
adc #$20
bne L3A40
tya any free vcb's available?
bpl L3A79 yes
lda #$00 look for an entry to kick out
L3A62 tax
lda vcbbuf+17,x any open files?
bpl L3A70 no, kick this one out.
@ -459,42 +472,70 @@ L3A62 tax
adc #$20 (vcb entry size)
bne L3A62
beq L3A7A all vcb entries have open files
L3A70 stx vcbptr save entry index.
stz vcbbuf,x free this entry
stz vcbbuf+16,x
L3A79 clc no error.
L3A7A lda #$55 # vcb full error
rts
cmppnam ldx #$00 index to directory name.
*--------------------------------------
XDOS.CheckVolName
ldx #$00 index to directory name.
ldy namptr index to pathname.
lda gbuf+4 get dir name length and type.
cmp #$E0 is it a directory?
bcc L3A90 if not.
and #$0F isolate name length and
sta namcnt save as a counter.
bne L3A95 branch if valid length.
L3A90 sec indicate not found
rts
L3A92 lda gbuf+4,x next char
L3A92 .DO LOWERCASE=2
lda gbuf+$20 VERSION
bpl .8
cpx #8
bcs .1
and whichbit,x
beq .8
bra .2
.1 lda gbuf+$21 MIN_VERSION
and whichbit-8,x
beq .8
.2 lda gbuf+4,x
jsr XDOS.ToLower
bra L3A95
.8 .FIN
lda gbuf+4,x next char
L3A95 cmp pathbuf,y
bne L3A90 if not the same.
inx check next char
iny
dec namcnt
bpl L3A92 if more to compare.
.DO LOWERCASEMATCH=1
.FIN
clc match found
rts
*--------------------------------------
logvcb ldx vcbptr previously logged in volume?
lda vcbbuf,x (acc = 0?)
beq logvcb1 no, go prepare vcb.
jsr cmpvcb does vcb match vol read?
bcc L3B05 yes, do not disturb.
logvcb1 ldy #$1F zero out vcb entry
L3AB2 stz vcbbuf,x
@ -514,11 +555,13 @@ L3AB2 stz vcbbuf,x
pha
ora vcbptr
tax
L3ACE lda gbuf+4,y
sta vcbbuf,x
dex
dey
bne L3ACE
pla get length again
sta vcbbuf,x and save.
lda devnum last device used.
@ -535,9 +578,10 @@ L3ACE lda gbuf+4,y
sta vcbbuf+26,x
lda gbuf+40
sta vcbbuf+27,x
L3B04 clc indicate logged if possible
L3B05 rts
*--------------------------------------
cmpvcb lda gbuf+4 with name in directory.
and #$0F
cmp vcbbuf,x are they the same length?
@ -574,6 +618,7 @@ L3B41 txa index to next vcb
bcc L3B2C branch if more to check
L3B49 clc
rts
L3B4B sta duplflag duplicate has been found.
stx vcbentry save pointer to conflicting vcb.
sec error.

View File

@ -222,8 +222,7 @@ dobitmap php no interrupts
L3DE8 plp file i/o error. restore interrupts.
sec
rts
* get mark command
*--------------------------------------
getmark ldx fcbptr index to open fcb.
ldy #$02 index to user's mark parmeter.
.1 lda fcbbuf+18,x transfer current position

View File

@ -1,18 +1,15 @@
NEW
AUTO 3,1
* read command
readf jsr mvdbufr xfer buffer address and request count
*--------------------------------------
XDOS.Read jsr mvdbufr xfer buffer address and request count
jsr mvcbytes to a more accessable location, also
pha get fcb attributes and save on stack.
jsr calcmrk calc mark after read, test if mark > eof
pla carry set means end mark > eof.
and #$01 test for read enabled.
bne L41DE branch if ok to read.
lda #$4E illegal access.
bne L4202 always.
L41DE bcc L4205 branch if result mark < eof. adjust
beq .9
bcc L4205 branch if result mark < eof. adjust
ldy fcbptr request to read until just before eof.
lda fcbbuf+21,y result = (eof-1) - position
sbc tposll
@ -24,20 +21,26 @@ L41DE bcc L4205 branch if result mark < eof. adjust
sta rwreqh
ora cbytes if both bytes = 0 then eof error
bne L4210
lda #$4C eof error
lda #MLI.E.EOF
.HS 2C
.9 lda #MLI.E.LOCKED
L4202 jmp errfix1
L4205 lda cbytes
ora cbytes+1
bne L4210 if read request definitely non-zero.
L420D jmp rwdone do nothing.
L4210 jsr valdbuf validate user's data buffer range.
bcs L4202 branch if memory conflict.
jsr gfcbstyp get storage type
cmp #$04 and find out if it's a tree or other.
bcc L421F branch if a tree file
jmp dread otherwise assume it's a directory.
L421F jsr rdposn set up data pointer.
bcs L4202 errors.
jsr preprw test for newline, setup for partial
jsr readpart read. move current data buffer contents
bvs L420D to user area. branch if satisfied.
@ -109,11 +112,13 @@ L42B6 plp restore interrupts.
L42B7 pha save error code.
jsr fxdatptr go restore data pointers, etc.
pla
errfix1 pha save error code
jsr rwdone pass back # of bytes actually read
pla
sec error
rts
rwdone ldy #$06 return total # of bytes actually read
sec derived from cbytes-rwreq.
lda cbytes
@ -168,6 +173,7 @@ L4329 inc sos+1 and sos buffer high address.
beq L4310 branch if more to read in buffer.
clv indicate not finished.
bvc L4360 always.
L4332 lda rwreqh
beq L4350 branch if request is satisfied.
iny done with this block of data ?
@ -237,6 +243,7 @@ L43A6 lda fcbbuf+16,x
L43B6 clc no error
L43B7 rts
L43B8 jmp errfix1 report how much xfer'd before error.
mvcbytes ldy #$04 move request count to a more accessable location
lda (A3L),y
sta cbytes
@ -319,10 +326,8 @@ plus2fcb lda #$02 on exit both a and y = fcbptr+2.
ora fcbptr
tay
rts
* write command
writef jsr mvcbytes first determine if requested write is legal.
*--------------------------------------
XDOS.Write jsr mvcbytes first determine if requested write is legal.
pha
jsr calcmrk save a copy of eof to old eof, set/clr
jsr wadjeof carry to determine if new mark > eof.
@ -569,7 +574,7 @@ twrprot1 sta unitnum make the device status call
sta bloknml+1
txa
rts carry is indeterminate.
*--------------------------------------
MAN
SAVE USR/SRC/PRODOS.FX/PRODOS.S.XDOS.D
LOAD USR/SRC/PRODOS.FX/PRODOS.S

View File

@ -725,8 +725,8 @@ cmdtable .DA XDOS.Create
.DA XDOS.GetPrefix
.DA XDOS.Open
.DA newline
.DA readf
.DA writef
.DA XDOS.Read
.DA XDOS.Write
.DA XDOS.Close
.DA XDOS.Flush
.DA setmark

View File

@ -7,7 +7,6 @@ NEW
*--------------------------------------
ENHFILENAME .EQ 1
LOWERCASE .EQ 1
LOWERCASEMATCH .EQ 0
FASTSEEK .EQ 0
FASTWRITE .EQ 0
*--------------------------------------