Kernel 0.94

This commit is contained in:
Rémy GIBERT 2020-08-28 17:11:27 +02:00
parent cfd16a2e66
commit 943d5a706a
8 changed files with 74 additions and 84 deletions

Binary file not shown.

Binary file not shown.

View File

@ -520,12 +520,15 @@ fndfcbuf lda FCBs+FCB.BUFID,y get page address of file buffer.
inx inx
inx index block always 2 pages after data inx index block always 2 pages after data
stx zpt+1 stx zpt+1
lda FCBs+FCB.DEVID,y also set up device # lda FCBs+FCB.DEVID,y also set up device #
sta devnum sta devnum
lda bufaddrl lda bufaddrl
sta datptr index and data buffers always on sta datptr index and data buffers always on
sta zpt page boundaries. sta zpt page boundaries.
lda #VCB0
fndfvol tax search for associated vcb fndfvol tax search for associated vcb
lda VCBs+VCB.DEV,x lda VCBs+VCB.DEV,x
cmp FCBs+FCB.DEVID,y is this vcb the same device? cmp FCBs+FCB.DEVID,y is this vcb the same device?
@ -603,33 +606,32 @@ H3459 phx save index to last item on list
clc clc
onlinerr rts onlinerr rts
*-------------------------------------- *--------------------------------------
online1 jsr fnddvcb see if it has already been logged in. online1 jsr XDOS.FindVCBForDevNum see if it has already been logged in.
bcs olinerr1 branch if vcb is full. bcs olinerr1 branch if vcb is full.
lda #$02 lda #$02
ldx #$00 read in root (volume) directory ldx #$00 read in root (volume) directory
jsr XDOS.ReadGBufAX read ROOT VOL into general purpose buffer. jsr XDOS.ReadGBufAX read ROOT VOL into general purpose buffer.
ldx vcbptr index to the vcb entry.
bcc volfound branch if read was ok. bcc volfound branch if read was ok.
tay error value. ldx vcbptr
lda VCBs+VCB.OFCNT,x don't take the vcb offline if ldy VCBs+VCB.OFCNT,x don't take the vcb offline if
bne rtrnerr there are active files present. bne olinerr1 there are active files present.
sta VCBs,x now take the volume offline stz VCBs,x now take the volume offline
sta VCBs+VCB.DEV,x stz VCBs+VCB.DEV,x
rtrnerr tya error value. bra olinerr1 branch if unable to read.
bcs olinerr1 branch if unable to read.
volfound .DO LOWERCASE=1 volfound .DO LOWERCASE=1
lda gbuf+$23 lda gbuf+$23
sta h_entln sta h_entln
lda gbuf+$24 lda gbuf+$24
sta h_maxent sta h_maxent
jsr XDOS.UnpackGBuf jsr XDOS.UnpackGBuf X trashed....
.FIN .FIN
ldx vcbptr
lda VCBs,x has it been logged in before? lda VCBs,x has it been logged in before?
beq H349E if not. beq H349E if not.
@ -1072,7 +1074,7 @@ ripple lda gbuf+4 test for 'root' directory because
ldx gbuf+40 ldx gbuf+40
.DO LOWERCASE=1 .DO LOWERCASE=1
jsr XDOS.ReadGBufAX Dir jsr XDOS.ReadGBufAX no need to pak/unpak....will disturb zpt
.ELSE .ELSE
jsr XDOS.ReadGBufAX read it jsr XDOS.ReadGBufAX read it
.FIN .FIN
@ -1093,7 +1095,7 @@ H3732 lda p8date,x
bpl H3732 bpl H3732
H373B .DO LOWERCASE=1 H373B .DO LOWERCASE=1
jsr XDOS.WriteGBuf Dir jsr XDOS.WriteGBuf
.ELSE .ELSE
jsr XDOS.WriteGBuf write updated entry back to disk. jsr XDOS.WriteGBuf write updated entry back to disk.
.FIN .FIN
@ -1111,7 +1113,7 @@ H373B .DO LOWERCASE=1
beq ripple they are the same, continue to root dir. beq ripple they are the same, continue to root dir.
H3751 .DO LOWERCASE=1 H3751 .DO LOWERCASE=1
jsr XDOS.ReadGBufAX Dir jsr XDOS.ReadGBufAX
.ELSE .ELSE
jsr XDOS.ReadGBufAX jsr XDOS.ReadGBufAX
.FIN .FIN

View File

@ -363,6 +363,8 @@ findvol lda #$00
L396F sty vnptr and save. L396F sty vnptr and save.
sta devnum zero out dev# until vcb located. sta devnum zero out dev# until vcb located.
lda #VCB0
L3975 pha acc now used as vcb lookup index. L3975 pha acc now used as vcb lookup index.
tax index pointer to x. tax index pointer to x.
lda VCBs,x get vcb volume name length. lda VCBs,x get vcb volume name length.
@ -373,6 +375,7 @@ L397C ldy vnptr restore pointer to requested vol name.
clc clc
adc #VCB adc #VCB
bcc L3975 branch if more vcb's to check bcc L3975 branch if more vcb's to check
bcs L39D4 otherwise go look for unlogged volumes. bcs L39D4 otherwise go look for unlogged volumes.
L3987 sta namcnt save length of vol name to be compared. L3987 sta namcnt save length of vol name to be compared.
@ -454,16 +457,18 @@ L39F1 ldx DEVCNT now remove the device from the list
L39F4 cmp loklst,x of prospective devices. L39F4 cmp loklst,x of prospective devices.
beq L39FE branch if match. beq L39FE branch if match.
dex look until found. dex look until found.
bpl L39F4 always taken (usually) unless bpl L39F4 always taken (usually) unless
bmi L39ED if dev was removed from devlst (/RAM). bmi L39ED if dev was removed from devlst (/RAM).
L39FE sta devnum preserve device to be checked next. L39FE sta devnum preserve device to be checked next.
stz loklst,x mark this one as tested. stz loklst,x mark this one as tested.
jsr fnddvcb find vcb that claims this dev (if any).
jsr XDOS.FindVCBForDevNum find vcb that claims this dev (if any).
bcs L3A29 branch if vcb full. bcs L3A29 branch if vcb full.
ldx vcbptr did fndvcb find it or return free vcb?
lda VCBs,x lda VCBs,x did we find it or return free vcb?
beq L3A16 if free vcb. beq L3A16 if free vcb.
lda VCBs+VCB.OFCNT,x is this volume active? lda VCBs+VCB.OFCNT,x is this volume active?
@ -496,51 +501,54 @@ L3A2D lda DEVLST,x active device list.
ldx DEVCNT ldx DEVCNT
rts rts
*-------------------------------------- *--------------------------------------
fnddvcb lda #$00 look for vcb with this device# XDOS.FindVCBForDevNum
lda #VCB0 look for vcb for devnum
ldy #$FF ldy #$FF
L3A40 tax new index to next vcb .1 tax new index to next vcb
lda VCBs+VCB.DEV,x check all devnums lda VCBs+VCB.DEV,x check all devnums
cmp devnum is this the vcb? cmp devnum is this the vcb?
bne L3A4E if not beq .7
stx vcbptr lda VCBs,x is this a free vcb?
clc indicates found bne .3 if not
rts
L3A4E lda VCBs,x is this a free vcb?
bne L3A57 if not
iny iny
stx vcbptr bne .3 already found a free one
stx vcbptr save first free VCB
L3A57 txa .3 txa
clc inc index to next vcb clc inc index to next vcb
adc #VCB adc #VCB
bcc L3A40 bcc .1
ldx vcbptr get found free if any
tya any free vcb's available? tya any free vcb's available?
bpl L3A79 yes bpl .8 yes, exit withX = vcbptr
lda #$00 look for an entry to kick out lda #VCB0 look for an entry to kick out
L3A62 tax .4 tax
lda VCBs+VCB.OFCNT,x any open files? lda VCBs+VCB.OFCNT,x any open files?
beq L3A70 no, kick this one out. beq .5 no, kick this one out.
txa next vcb txa next vcb
clc clc
adc #VCB adc #VCB
bcc L3A62 bcc .4
lda #MLI.E.VCBFULL all vcb entries have open files lda #MLI.E.VCBFULL all vcb entries have open files
* sec * sec
rts rts
L3A70 stx vcbptr save entry index. .5 stz VCBs,x free this entry
stz VCBs,x free this entry
stz VCBs+VCB.DEV,x stz VCBs+VCB.DEV,x
L3A79 clc no error.
.7 stx vcbptr save entry index.
.8 clc no error.
rts rts
*-------------------------------------- *--------------------------------------
XDOS.CheckVolName XDOS.CheckVolName
@ -579,12 +587,12 @@ logvcb ldx vcbptr previously logged in volume?
jsr cmpvcb does vcb match vol read? jsr cmpvcb does vcb match vol read?
bcc XDOS.CheckVolName.RTS yes, do not disturb. bcc XDOS.CheckVolName.RTS yes, do not disturb.
logvcb1 ldy #VCB-1 zero out vcb entry logvcb1 ldy #VCB zero out vcb entry
L3AB2 stz VCBs,x L3AB2 stz VCBs,x
inx inx
dey dey
bpl L3AB2 bne L3AB2
lda gbuf pointer to previous dir block lda gbuf pointer to previous dir block
ora gbuf+1 must be null ora gbuf+1 must be null
@ -602,7 +610,8 @@ L3AB2 stz VCBs,x
and #$0F strip root marker and #$0F strip root marker
tay tay
pha pha
ora vcbptr * clc
adc vcbptr
tax tax
L3ACE lda gbuf+4,y L3ACE lda gbuf+4,y
@ -617,21 +626,6 @@ L3ACE lda gbuf+4,y
lda devnum last device used. lda devnum last device used.
sta VCBs+VCB.DEV,x save device # and sta VCBs+VCB.DEV,x save device # and
* lda bloknml save address of root directory.
* sta VCBs+VCB.ROOT,x
* lda bloknml+1
* sta VCBs+VCB.ROOT+1,x
* lda gbuf+39 save address of the 1st bitmap.
* sta VCBs+VCB.BMAP,x
* lda gbuf+40
* sta VCBs+VCB.BMAP+1,x
* lda gbuf+41 total # of blocks on this unit.
* sta VCBs+VCB.TBLK,x
* lda gbuf+42
* sta VCBs+VCB.TBLK+1,x
ldy #0 ldy #0
.1 lda gbuf+39,y .1 lda gbuf+39,y
@ -655,7 +649,8 @@ cmpvcb lda gbuf+4 with name in directory.
bne L3B1E if not the same. bne L3B1E if not the same.
tay tay
ora xvcbptr clc
adc xvcbptr
tax tax
L3B18 lda gbuf+4,y L3B18 lda gbuf+4,y
@ -673,7 +668,7 @@ L3B1E sec anticipate different names.
L3B26 ldx xvcbptr offset to start of vcb (rev note #23) L3B26 ldx xvcbptr offset to start of vcb (rev note #23)
rts rts
*-------------------------------------- *--------------------------------------
tstdupvol lda #$00 check for other logged in volumes with the same name. tstdupvol lda #VCB0 check for other logged in volumes with the same name.
L3B2C tax L3B2C tax
jsr cmpvcb jsr cmpvcb

View File

@ -396,7 +396,7 @@ XDOS.Pack.Init lda #4
sta zpt+1 sta zpt+1
ldx h_maxent ldx h_maxent
beq * beq * DEBUG : should never happends
rts rts
*-------------------------------------- *--------------------------------------
XDOS.Pack.Next lda h_entln XDOS.Pack.Next lda h_entln

View File

@ -49,14 +49,9 @@ close2 ldy fcbptr
sta FCBs,y free fcb too sta FCBs,y free fcb too
lda FCBs+FCB.DEVID,y lda FCBs+FCB.DEVID,y
sta devnum go look for associated vcb sta devnum go look for associated vcb
jsr fnddvcb jsr XDOS.FindVCBForDevNum get vcb pointer.
ldx vcbptr get vcb pointer.
dec VCBs+VCB.OFCNT,x indicate one less file open. dec VCBs+VCB.OFCNT,x indicate one less file open.
* bne L46B4 branch if that wasn't the last...
* clc strip 'files open' bit
* ror VCBs+VCB.OF,x
L46B4 clc L46B4 clc
rts rts

View File

@ -162,6 +162,8 @@ FCB.NLMASK .EQ 31
FCB .EQ 32 FCB .EQ 32
*-------------------------------------- *--------------------------------------
VCBs .EQ $D900 VCBs .EQ $D900
* 6 free bytes
VCB0 .EQ 06 range $D906-$DA00
VCB.DEV .EQ 16 VCB.DEV .EQ 16
VCB.OFCNT .EQ 17 VCB.OFCNT .EQ 17
VCB.BMAP .EQ 18 2 bytes VCB.BMAP .EQ 18 2 bytes
@ -169,8 +171,7 @@ VCB.TBLK .EQ 20 2 bytes
VCB.FBLK .EQ 22 2 bytes VCB.FBLK .EQ 22 2 bytes
VCB.BMAPIDX .EQ 24 VCB.BMAPIDX .EQ 24
* *
*VCB .EQ 25 VCB .EQ 25
VCB .EQ 32
*-------------------------------------- *--------------------------------------
bmbuf .EQ $DA00 512 byte bitmap buffer bmbuf .EQ $DA00 512 byte bitmap buffer
gbuf .EQ $DC00 general purpose 512 byte block buffer gbuf .EQ $DC00 general purpose 512 byte block buffer

View File

@ -404,16 +404,21 @@ RWDRV.START cld ProDOS will check that byte!!!
ldy DRV.COMMAND 0 = Status ? ldy DRV.COMMAND 0 = Status ?
beq RMDRV.CMDSTATUS beq RMDRV.CMDSTATUS
cpy #3 cpy #3
beq RWDRV.EXITOK 3 = Format : nothing to do, exit with no error
bcs RWDRV.IOERR > 3 = Invalid OP, IO error
beq RWDRV.EXITOK 3 = Format : nothing to do, exit with no error
* bcs RWDRV.IOERR > 3 = Invalid OP, IO error
RWDRV.IOERR lda #MLI.E.IO Carry already set
rts
ldx DRV.BLKNUM ldx DRV.BLKNUM
cpx RWDRV.MAXLO+1 cpx RWDRV.MAXLO+1
lda DRV.BLKNUM+1 lda DRV.BLKNUM+1
sbc RWDRV.MAXHI+1 sbc RWDRV.MAXHI+1
bcs RWDRV.IOERR DRV.BLKNUM >= RW.DRV.SIZE, IO error bcs RWDRV.IOERR DRV.BLKNUM >= RW.DRV.SIZE, IO error
* bit RD80STORE save 80 Store status bit RD80STORE save 80 Store status
php Disable IRQ as no vector set in RW Banks php Disable IRQ as no vector set in RW Banks
sei sei
@ -468,14 +473,14 @@ RWDRV.RW.DST sta ($FF),y
dec DRV.A2H dec DRV.A2H
bcc RWDRV.RW.LOOP bcc RWDRV.RW.LOOP
stz RWBankSelect RWDRV.EXIT stz RWBankSelect
sta CLRREADAUX sta CLRREADAUX
sta CLRWRITEAUX sta CLRWRITEAUX
plp restore IRQ plp restore IRQ
* bpl RMDRV.CMDSTATUS bpl RMDRV.CMDSTATUS
* sta SET80STORE sta SET80STORE
RMDRV.CMDSTATUS RMDRV.CMDSTATUS
RWDRV.MAXLO ldx #$FF return device block count in X,Y... RWDRV.MAXLO ldx #$FF return device block count in X,Y...
@ -483,9 +488,6 @@ RWDRV.MAXHI ldy #$FF
RWDRV.EXITOK lda #0 make A=0 RWDRV.EXITOK lda #0 make A=0
clc clc
rts rts
RWDRV.IOERR lda #MLI.E.IO Carry already set
rts
*-------------------------------------- *--------------------------------------
* X=Page(0/1 or LC),A=Bank * X=Page(0/1 or LC),A=Bank
*-------------------------------------- *--------------------------------------
@ -506,12 +508,10 @@ RWDRV.GOAUX pha save BANK
* returns : CC=WRITE, CS=READ * returns : CC=WRITE, CS=READ
sta CLRREADAUX CLRWRITEAUX already triggered by code copy sta CLRREADAUX CLRWRITEAUX already triggered by code copy
jsr RWDRV.XM.RUN Now execute generated code in main memory jsr RWDRV.XM.RUN Now execute generated code in main memory
sta SETREADAUX
jsr RWDRVX.RESTORE sta SETREADAUX
sta CLRREADAUX jmp RWDRVX.RESTORE
plp restore IRQ
rts A & carry setup properly by RWDRVX.RESTORE
RWDRV.END .EP RWDRV.END .EP
RWDRV.B.END RWDRV.B.END
.LIST ON .LIST ON
@ -575,10 +575,7 @@ RWDRVX.RESTORE ldy #RWDRVX.XM.SIZE Now, restore begining of $300
dey dey
bne .1 bne .1
tya setup A=0 and CC for exit with non error jmp RWDRV.EXIT
clc
rts
*-------------------------------------- *--------------------------------------
* "auXMove" Code, moved from Aux to main $300 * "auXMove" Code, moved from Aux to main $300
* $0200 -> $02FF TMP buffer for 2 steps moving between LCs * $0200 -> $02FF TMP buffer for 2 steps moving between LCs