Kernel 0.94

This commit is contained in:
Rémy GIBERT 2020-05-25 15:58:59 +02:00
parent e92224f139
commit 9d007ebf8e
16 changed files with 202 additions and 181 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -5,12 +5,12 @@ NEW
.OR $2000 .OR $2000
.TF drv/uthernet.drv .TF drv/uthernet.drv
*-------------------------------------- *--------------------------------------
.INB INC/MACROS.I .INB inc/macros.i
.INB INC/A2OSX.I .INB inc/a2osx.i
.INB INC/MLI.E.I .INB inc/mli.e.i
.INB INC/NIC.I .INB inc/nic.i
.INB INC/NIC.8900A.I .INB inc/nic.8900a.i
.INB INC/ETH.I .INB inc/eth.i
*-------------------------------------- *--------------------------------------
.DUMMY .DUMMY
.OR ZPBIN .OR ZPBIN
@ -505,5 +505,5 @@ DCB .DA #S.DCB.T.NIC
*-------------------------------------- *--------------------------------------
DRV.END DRV.END
MAN MAN
SAVE USR/SRC/DRV/UTHERNET.DRV.S SAVE usr/src/drv/uthernet.drv.s
ASM ASM

View File

@ -34,7 +34,7 @@ MLI.E.INVPARAM .EQ $53 Invalid Parameter
MLI.E.VCBFULL .EQ $55 Too Many Volumes MLI.E.VCBFULL .EQ $55 Too Many Volumes
MLI.E.BADBUF .EQ $56 Bad Buffer Address MLI.E.BADBUF .EQ $56 Bad Buffer Address
MLI.E.DUPVOL .EQ $57 Duplicate Volume MLI.E.DUPVOL .EQ $57 Duplicate Volume
* .EQ $5A File Structure Damaged MLI.E.BADFS .EQ $5A File Structure Damaged
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE INC/MLI.E.I SAVE INC/MLI.E.I

View File

@ -379,6 +379,7 @@ PutBytePtr2 sta (ZPPtr2)
.8 rts .8 rts
*-------------------------------------- *--------------------------------------
D2WriteTrackPtr2 D2WriteTrackPtr2
php
sei sei
ldy #TrkWriter.Size ldy #TrkWriter.Size
@ -395,7 +396,7 @@ D2WriteTrackPtr2
jsr $200 jsr $200
cli plp
rts rts
*-------------------------------------- *--------------------------------------
MAN MAN

View File

@ -90,7 +90,8 @@ p8date .HS 0000 bits 15-9=yr, 8-5=mo, 4-0=day
p8time .HS 0000 bits 12-8=hr, 5-0=min, low-hi format p8time .HS 0000 bits 12-8=hr, 5-0=min, low-hi format
flevel .DA #0 current file level flevel .DA #0 current file level
bubit .DA #0 backup bit disable, setfileinfo only bubit .DA #0 backup bit disable, setfileinfo only
spare1 .DA #0 used to save acc *spare1 .DA #0 used to save acc
.DA #0
newpfxptr .DA #0 appletalk alternate prefix ptr newpfxptr .DA #0 appletalk alternate prefix ptr
machidbyte .DA #0 machine ID byte machidbyte .DA #0 machine ID byte
rommap .DA #0 slot ROM bit map rommap .DA #0 slot ROM bit map
@ -122,7 +123,7 @@ GP.MLICONT sec
sta bnkbyt2 sta bnkbyt2
lda RRAMWRAMBNK1 force ram card on lda RRAMWRAMBNK1 force ram card on
lda RRAMWRAMBNK1 with write allowed lda RRAMWRAMBNK1 with write allowed
jmp XDOS.MLI jmp XDOS
*-------------------------------------- *--------------------------------------
*GP.IrqExit lda bankid determine state of ram card (ROM/RAM) *GP.IrqExit lda bankid determine state of ram card (ROM/RAM)
*irqxit0 *irqxit0

View File

@ -1,12 +1,14 @@
NEW NEW
AUTO 3,1 AUTO 3,1
*-------------------------------------- *--------------------------------------
XDOS.START XDOS cld no decimal.
XDOS.MLI cld no decimal.
pla get processor status
sta spare1 save it temporarily
sty mliy save x and y sty mliy save x and y
stx mlix stx mlix
* pla get processor status
* sta spare1 save it temporarily
ply
pla find out the address of the caller pla find out the address of the caller
sta A3L sta A3L
clc preserve the address of the call spec. clc preserve the address of the call spec.
@ -16,8 +18,11 @@ XDOS.MLI cld no decimal.
sta A3L+1 sta A3L+1
adc #$00 adc #$00
sta mliretn+1 sta mliretn+1
lda spare1
pha pull processor status * lda spare1
* pha pull processor status
phy
plp to re-enable interrupts. plp to re-enable interrupts.
cld still no decimal cld still no decimal
@ -255,6 +260,7 @@ XDOS.bfmgr lda XDOS.CmdFlags,x translate into command address.
sta H3274+1 sta H3274+1
lda cmdtable+1,x high byte lda cmdtable+1,x high byte
sta H3274+2 sta H3274+2
lda #$20 init backup bit flag lda #$20 init backup bit flag
sta bkbitflg to say 'file modified' sta bkbitflg to say 'file modified'
bcc nopath bcc nopath
@ -272,6 +278,7 @@ nopreref asl cmdtemp check for necessity of time stamp
bcc H3274 bcc H3274
jsr clockv date/time jsr clockv date/time
H3274 jsr $FFFF SELF MODIFIED : execute command H3274 jsr $FFFF SELF MODIFIED : execute command
bcc goodop bcc goodop
@ -602,7 +609,7 @@ online1 jsr fnddvcb see if it has already been logged in.
ldx #$00 read in root (volume) directory ldx #$00 read in root (volume) directory
lda #$02 lda #$02
jsr rdblk read it into general purpose buffer. jsr XDOS.ReadGBufAX read it into general purpose buffer.
ldx vcbptr index to the vcb entry. ldx vcbptr index to the vcb entry.
bcc volfound branch if read was ok. bcc volfound branch if read was ok.
@ -719,7 +726,7 @@ H352A lda bloknml preserve disk address of current (last)
sta gbuf+2 save block address in y,a to sta gbuf+2 save block address in y,a to
sty gbuf+3 current directory. sty gbuf+3 current directory.
jsr wrtgbuf update directory block with new link. jsr XDOS.WriteGBuf update directory block with new link.
bcs H351D if error bcs H351D if error
ldx #$01 ldx #$01
@ -738,12 +745,12 @@ clrdir sta gbuf+2,x
inx inx
bne clrdir bne clrdir
jsr wrtgbuf write prepared directory extension. jsr XDOS.WriteGBuf write prepared directory extension.
bcs H351D if error bcs H351D if error
lda own_blk lda own_blk
ldx own_blk+1 ldx own_blk+1
jsr rdblk read in parent directory block jsr XDOS.ReadGBufAX read in parent directory block
ldx own_ent and calc entry address. ldx own_ent and calc entry address.
lda /gbuf lda /gbuf
sta zpt+1 sta zpt+1
@ -766,7 +773,7 @@ H3588 lda (zpt),y
eor #$18 done with usage/eof update? eor #$18 done with usage/eof update?
bne H3588 branch if not. bne H3588 branch if not.
jsr wrtgbuf go update parent. jsr XDOS.WriteGBuf go update parent.
bcs crerr2 bcs crerr2
jmp XDOS.Create jmp XDOS.Create
@ -912,7 +919,7 @@ cralcblk jsr alc1blk get address of file's data block
sty d_frst+1 sty d_frst+1
sta bloknml sta bloknml
sty bloknml+1 sty bloknml+1
jsr wrtgbuf go write data block of file jsr XDOS.WriteGBuf go write data block of file
bcs crerr3 bcs crerr3
inc h_fcnt add 1 to total # of files in this dir inc h_fcnt add 1 to total # of files in this dir
@ -954,23 +961,24 @@ modtime lda p8date,x move last modification date/time
dex dex
bpl modtime bpl modtime
drevise1 lda d_attr mark entry as backupable drevise1 lda bkbitflg (bit 5 = backup needed)
ora bkbitflg (bit 5 = backup needed) tsb d_attr mark entry as backupable
sta d_attr
lda d_dev get device # of directory lda d_dev get device # of directory
sta devnum to be revised sta devnum to be revised
lda d_entblk and address of direcotry block. lda d_entblk and address of direcotry block.
ldx d_entblk+1 ldx d_entblk+1
jsr rdblk read block into general purpose buffer jsr XDOS.ReadGBufAX read block into general purpose buffer
bcs crerr3 bcs crerr3
jsr entcalc fix up ptr to entry location within gbuf. jsr entcalc fix up ptr to entry location within gbuf.
ldy h_entln now move 'd.' info to directory. ldy h_entln now move 'd.' info to directory.
.1 lda d_stor-1,y
dey dey
.1 lda d_stor,y
sta (zpt),y sta (zpt),y
dey
bpl .1 bpl .1
lda d_head is the entry block same as lda d_head is the entry block same as
@ -981,12 +989,12 @@ drevise1 lda d_attr mark entry as backupable
cmp bloknml+1 cmp bloknml+1
beq uphead branch if they are the same block. beq uphead branch if they are the same block.
H36E0 jsr wrtgbuf go write updated directory block. H36E0 jsr XDOS.WriteGBuf go write updated directory block.
bcs crerr3 bcs crerr3
lda d_head get address of header block and lda d_head get address of header block and
ldx d_head+1 ldx d_head+1
jsr rdblk go read in header block to modify. jsr XDOS.ReadGBufAX go read in header block to modify.
bcs crerr3 bcs crerr3
uphead ldy #$01 update current # of files in this dir. uphead ldy #$01 update current # of files in this dir.
@ -998,7 +1006,7 @@ H36F2 lda h_fcnt,y
lda h_attr also update header's attributes. lda h_attr also update header's attributes.
sta gbuf+34 sta gbuf+34
jsr wrtgbuf go write updated header jsr XDOS.WriteGBuf go write updated header
bcs H375A bcs H375A
ripple lda gbuf+4 test for 'root' directory because ripple lda gbuf+4 test for 'root' directory because
@ -1008,14 +1016,16 @@ ripple lda gbuf+4 test for 'root' directory because
lda gbuf+41 get entry # lda gbuf+41 get entry #
sta d_entnum sta d_entnum
lda gbuf+42 and the length of ertries in that dir lda gbuf+42 and the length of entries in that dir
sta h_entln sta h_entln
lda gbuf+39 get addr of parent entry's dir block lda gbuf+39 get addr of parent entry's dir block
ldx gbuf+40 ldx gbuf+40
jsr rdblk read it jsr XDOS.ReadGBufAX read it
bcs H375A bcs H375A
jsr entcalc get indirect ptr to parent entry in gbuf jsr entcalc get indirect ptr to parent entry in gbuf
lda p8date don't touch mod lda p8date don't touch mod
beq H373B if no clock... beq H373B if no clock...
@ -1028,7 +1038,7 @@ H3732 lda p8date,x
dex dex
bpl H3732 bpl H3732
H373B jsr wrtgbuf write updated entry back to disk. H373B jsr XDOS.WriteGBuf write updated entry back to disk.
bcs H375A if error. bcs H375A if error.
ldy #$25 compare current block # to this ldy #$25 compare current block # to this
@ -1044,7 +1054,7 @@ H373B jsr wrtgbuf write updated entry back to disk.
H3751 lda (zpt),y not same so read in this dir's header. H3751 lda (zpt),y not same so read in this dir's header.
sta bloknml+1 sta bloknml+1
jsr rdgbuf jsr XDOS.ReadGBuf
bcc ripple continue if read was good bcc ripple continue if read was good
H375A rts H375A rts

View File

@ -86,7 +86,7 @@ L37EB sta entcntl keep a running count.
beq errdir then not all entries were acct'd for. beq errdir then not all entries were acct'd for.
L37FC ldx gbuf+3 acc has value for block# (low). L37FC ldx gbuf+3 acc has value for block# (low).
jsr rdblk go read the next linked directory. jsr XDOS.ReadGBufAX go read the next linked directory.
bcc L37C9 if no error. bcc L37C9 if no error.
rts return error in acc. rts return error in acc.
@ -132,7 +132,7 @@ namfound jsr nxtpname adj index to next name in path.
sta bloknml+1 sta bloknml+1
sta d_head+1 sta d_head+1
jsr rdgbuf read subdirectory into gbuf. jsr XDOS.ReadGBuf read subdirectory into gbuf.
bcs lookfil0.RTS if error. bcs lookfil0.RTS if error.
lda gbuf+37 get the # of files contained in this lda gbuf+37 get the # of files contained in this
@ -400,7 +400,7 @@ L39AC tay if prefix then find ptr to prefixed
* verify volume name * verify volume name
L39C2 jsr rdgbuf read in directory (or prefix dir) L39C2 jsr XDOS.ReadGBuf read in directory (or prefix dir)
bcs L39CC if error then look on other devices. bcs L39CC if error then look on other devices.
jsr XDOS.CheckVolName compare dir name with path name. jsr XDOS.CheckVolName compare dir name with path name.
@ -448,7 +448,7 @@ L39FE sta devnum preserve device to be checked next.
L3A16 lda #$02 go read root dir into gbuf L3A16 lda #$02 go read root dir into gbuf
ldx #$00 ldx #$00
jsr rdblk jsr XDOS.ReadGBufAX
bcs L39E2 ignore if unable to read. bcs L39E2 ignore if unable to read.
jsr logvcb go log in volume name. jsr logvcb go log in volume name.
@ -619,24 +619,24 @@ L3ACE .DO LOWERCASE=1
lda bloknml+1 lda bloknml+1
sta VCBs+VCB.ROOT+1,x sta VCBs+VCB.ROOT+1,x
ldy #0 * ldy #0
.1 lda gbuf+39,y *.1 lda gbuf+39,y
sta VCBs+VCB.BMAP,x
iny
inx
cpy #4
bne .1
* lda gbuf+39,y save address of the 1st bitmap.
* sta VCBs+VCB.BMAP,x * sta VCBs+VCB.BMAP,x
* lda gbuf+40 * iny
* sta VCBs+VCB.BMAP+1,x * inx
* cpy #4
* bne .1
* lda gbuf+41 total # of blocks on this unit. lda gbuf+39,y save address of the 1st bitmap.
* sta VCBs+VCB.TBLK,x sta VCBs+VCB.BMAP,x
* lda gbuf+42 lda gbuf+40
* sta VCBs+VCB.TBLK+1,x 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
L3B04 clc indicate logged if possible L3B04 clc indicate logged if possible
rts rts
@ -727,7 +727,7 @@ tkfrecnt jsr cntbms get # of bitmaps
lda VCBs+VCB.BMAP+1,x lda VCBs+VCB.BMAP+1,x
sta bloknml+1 sta bloknml+1
L3B81 jsr rdgbuf use general buffer for temp space to L3B81 jsr XDOS.ReadGBuf use general buffer for temp space to
bcs L3BC1 count free blocks (bits). bcs L3BC1 count free blocks (bits).
jsr count jsr count

View File

@ -4,7 +4,7 @@ NEW
dealloc stx bmcnt high address of block. dealloc stx bmcnt high address of block.
pha save low address. pha save low address.
ldx vcbptr check that bitmap block address is ldx vcbptr check that bitmap block address is
lda VCBs+VCB.TBLK+1,x valid given the total # of blocks lda VCBs+VCB.TBLK+1,x valid given the total # of blocks
cmp bmcnt on the volume. cmp bmcnt on the volume.
pla pla
bcc L3C8C branch if invalid bcc L3C8C branch if invalid
@ -64,7 +64,7 @@ L3C7D lda #$80 mark bitmap as modified
L3C8A clc L3C8A clc
L3C8B rts L3C8B rts
L3C8C lda #$5A bitmap block # impossible. L3C8C lda #MLI.E.BADFS bitmap block # impossible.
sec bitmap disk address wrong sec bitmap disk address wrong
rts (maybe data masquerading as indx block) rts (maybe data masquerading as indx block)
*-------------------------------------- *--------------------------------------
@ -146,18 +146,16 @@ L3CF7 lda #$80 indicate map is modified.
clc no errors. clc no errors.
rts rts
*-------------------------------------- *--------------------------------------
nxtbmap ldy vcbptr inc to next bitmap, but 1st make sure there is another one. nxtbmap ldx vcbptr inc to next bitmap, but 1st make sure there is another one.
lda VCBs+VCB.TBLK+1,y lda VCBs+VCB.TBLK+1,x
lsr lsr
lsr lsr
lsr lsr
lsr lsr
cmp VCBs+VCB.BMAPIDX,y are there more maps ? cmp VCBs+VCB.BMAPIDX,x are there more maps ?
beq L3D60 if no more to look at. beq L3D60 if no more to look at.
lda VCBs+VCB.BMAPIDX,y add 1 to current map inc VCBs+VCB.BMAPIDX,x add 1 to current map
inc
sta VCBs+VCB.BMAPIDX,y
jsr upbmap jsr upbmap
fndbmap ldy vcbptr fndbmap ldy vcbptr
@ -202,18 +200,24 @@ upbmap clc
rts rts
*-------------------------------------- *--------------------------------------
gtbmap sta bmadev read bitmap specified by dev and vcb. gtbmap sta bmadev read bitmap specified by dev and vcb.
ldy vcbptr get lowest map # with free blocks in it ldy vcbptr get lowest map # with free blocks in it
lda VCBs+VCB.BMAPIDX,y lda VCBs+VCB.BMAPIDX,y
sta bmacmap associate offset with bitmap ctrl block. sta bmacmap associate offset with bitmap ctrl block.
clc add this # to the base address of clc add this # to the base address of
adc VCBs+VCB.BMAP,y 1st bitmap and save in bmadadr which adc VCBs+VCB.BMAP,y 1st bitmap and save in bmadadr which
sta bmadadr is address of bitmap to be used. sta bmadadr is address of bitmap to be used.
lda VCBs+VCB.BMAP+1,y lda VCBs+VCB.BMAP+1,y
adc #$00 adc #$00
sta bmadadr+1 sta bmadadr+1
lda #$01 read device command
L3D92 sta A4L lda #$01 read device command
.HS 2C BIT ABS
wrtbmap lda #$02 write command.
sta A4L
lda devnum save current dev # lda devnum save current dev #
pha pha
lda bmadev get bitmap's dev # lda bmadev get bitmap's dev #
@ -222,8 +226,10 @@ L3D92 sta A4L
sta bloknml sta bloknml
lda bmadadr+1 lda bmadadr+1
sta bloknml+1 sta bloknml+1
lda bmbufhi+2 address of the buffer (low = 0)
jsr dobitmap lda /bmbuf
* lda bmbufhi+2 address of the buffer (low = 0)
jsr XDOS.RWBlock
tax error code (if any). tax error code (if any).
pla restore current dev # pla restore current dev #
sta devnum sta devnum
@ -231,39 +237,39 @@ L3D92 sta A4L
txa error code txa error code
L3DB6 rts L3DB6 rts
*--------------------------------------
rdblk sta bloknml rdblk
XDOS.ReadGBufAX sta bloknml
stx bloknml+1 stx bloknml+1
jsr rdgbuf rdgbuf
rts XDOS.ReadGBuf lda #$01 read command.
wrtbmap lda #$02 write command.
bne L3D92 always.
wrtgbuf lda #$02 write command
.HS 2C BIT ABS .HS 2C BIT ABS
wrtgbuf
XDOS.WriteGBuf lda #$02 write command
rdgbuf lda #$01 read command.
sta A4L pass to device handler. sta A4L pass to device handler.
lda /gbuf general buffer. lda /gbuf general buffer.
dobitmap
dobitmap php no interrupts XDOS.RWBlock php no interrupts
sei sei
sta buf+1 buffer high. sta buf+1 buffer high.
stz buf buffer low (always on page boundary) stz buf buffer low (always on page boundary)
stz p8error clear global error code. stz p8error clear global error code.
lda #$FF indicates reg call made to dev handler lda #$FF indicates reg call made to dev handler
sta ioaccess sta ioaccess
lda devnum transfer dev # for dispatcher to lda devnum transfer dev # for dispatcher to
sta unitnum convert to unit #. sta unitnum convert to unit #.
jsr dmgr call the driver. jsr dmgr call the driver.
bcs L3DE8 if error. bcs .9 if error.
plp restore interrupts. plp restore interrupts.
clc clc
rts rts
L3DE8 plp file i/o error. restore interrupts. .9 plp file i/o error. restore interrupts.
sec sec
rts rts
*-------------------------------------- *--------------------------------------
@ -281,7 +287,7 @@ XDOS.GetMark ldx fcbptr index to open fcb.
clc clc
rts rts
L3DFD lda #$4D invalid position L3DFD lda #MLI.E.BEYEOF invalid position
sec sec
rts rts
*-------------------------------------- *--------------------------------------
@ -555,10 +561,13 @@ rfcbidx lda #$01 prepare to read index block : read command
clc clc
L400C rts L400C rts
L400D lda #$02 write command wfcbfst jsr upbmap update the bitmap and write file's 1st block.
lda #$02 write command
.HS 2C skip next instruction .HS 2C skip next instruction
rfcbfst lda #$01 read command. rfcbfst lda #$01 read command.
pha save the command pha save the command
lda #$0C lda #$0C
ora fcbptr add offset to fcbptr ora fcbptr add offset to fcbptr
@ -573,8 +582,10 @@ dofileio sta A4L command
bne L4031 bne L4031
cmp #$00 are both bytes 0 ? cmp #$00 are both bytes 0 ?
bne L4031 no, continue request bne L4031 no, continue request
lda #$0C otherwise, allocation error. lda #$0C otherwise, allocation error.
jsr sysdeath doesn't return... jsr sysdeath doesn't return...
L4031 lda fcbbuf+1,y high address of disk block L4031 lda fcbbuf+1,y high address of disk block
sta bloknml+1 sta bloknml+1
@ -603,9 +614,6 @@ L405E plp restore interrupts
sec sec
rts rts
wfcbfst jsr upbmap update the bitmap
bra L400D and write file's 1st block.
wfcbdat ldx #datptr point at memory address with x and wfcbdat ldx #datptr point at memory address with x and
lda #$10 disk address with y. lda #$10 disk address with y.
ora fcbptr add offset to fcbptr ora fcbptr add offset to fcbptr

View File

@ -133,23 +133,22 @@ L4723 lda fcbbuf,y note: this code depends on the defined
bne L4723 bne L4723
sta devnum sta devnum
lda d_head read the directory header for this file lda d_head read the directory header for this file
ldx d_head+1 ldx d_head+1
jsr rdblk into the general purpose buffer. jsr XDOS.ReadGBufAX into the general purpose buffer.
bcs L46E6 if error. bcs L46E6 if error.
jsr movhed0 move header info. jsr movhed0 move header info.
lda d_entblk get address of directory block that lda d_entblk get address of directory block that
ldy d_entblk+1 contains the file entry. ldx d_entblk+1 contains the file entry.
cmp d_head test to see if it's the same block the cmp d_head test to see if it's the same block the
bne L474E header is in. branch if not. bne .1 header is in. branch if not.
cpy d_head+1 cpx d_head+1
beq L4755 branch if header block = entry block beq L4755 branch if header block = entry block
L474E sta bloknml .1 jsr XDOS.ReadGBufAX get block with file entry in general
sty bloknml+1
jsr rdgbuf get block with file entry in general
L4755 jsr entcalc buffer. set up pointer to entry. L4755 jsr entcalc buffer. set up pointer to entry.
@ -607,12 +606,14 @@ L49FF ldy #0 get newname's length
ldy #$00 ldy #$00
ldx vcbptr update vcb also. ldx vcbptr update vcb also.
.1 iny next character .1 lda pathbuf,y move new name to vcb.
beq .8
sta VCBs,x
iny next character
inx inx
lda pathbuf-1,y move new name to vcb. bra .1
sta VCBs-1,x .8
bne .1
* clc no errors * clc no errors
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
@ -735,7 +736,7 @@ L4ABE lda pathbuf,y move local name to dir entry workspace.
lda d_frst read in 1st header block of subdir lda d_frst read in 1st header block of subdir
ldx d_frst+1 ldx d_frst+1
jsr rdblk jsr XDOS.ReadGBufAX
bcs L4A74 errors. bcs L4A74 errors.
ldy rnptr change the header's name to match the ldy rnptr change the header's name to match the
@ -787,7 +788,7 @@ XDOS.UpdateHdr .DO LOWERCASE=1
eor #$20 eor #$20
bra .1 bra .1
.8 jmp wrtgbuf write changed header block. .8 jmp XDOS.WriteGBuf write changed header block.
.ELSE .ELSE
@ -799,7 +800,7 @@ L4AF5 sta gbuf+4,x
lda pathbuf,y lda pathbuf,y
bne L4AF5 bne L4AF5
jmp wrtgbuf write changed header block. jmp XDOS.WriteGBuf write changed header block.
.FIN .FIN
*-------------------------------------- *--------------------------------------
getnamptr ldy #$00 return pointer to 1st name of path. getnamptr ldy #$00 return pointer to 1st name of path.

View File

@ -19,6 +19,7 @@ XDOS.Destroy jsr findfile look for file to be destroyed.
L4B39 lda d_attr make sure ok to destroy file. L4B39 lda d_attr make sure ok to destroy file.
and #$80 and #$80
bne L4B45 branch if ok to destroy. bne L4B45 branch if ok to destroy.
lda #MLI.E.LOCKED access error lda #MLI.E.LOCKED access error
jsr GP.P8errv jsr GP.P8errv
@ -92,6 +93,9 @@ dvcbrev ldx vcbptr update block free count in vcb. point to vcb of correct
sta VCBs+VCB.FBLK+1,x sta VCBs+VCB.FBLK+1,x
stz VCBs+VCB.BMAPIDX,x force re-scan from 1st bitmap stz VCBs+VCB.BMAPIDX,x force re-scan from 1st bitmap
* lda #0 ?????
rts rts
L4BCD bcc L4B85 branch widened (always taken) L4BCD bcc L4B85 branch widened (always taken)
@ -103,23 +107,16 @@ L4BCF cmp #$D0 is this a directory file ?
bcs L4C1A if error. bcs L4C1A if error.
lda d_frst read 1st block of directory into gbuf lda d_frst read 1st block of directory into gbuf
sta bloknml ldx d_frst+1
lda d_frst+1 jsr XDOS.ReadGBufAX
sta bloknml+1
jsr rdgbuf
bcs L4C1A bcs L4C1A
lda gbuf+37 do any files exist in this directory ? lda gbuf+37 do any files exist in this directory ?
bne L4BF1 if so, access error. ora gbuf+38
bne L4C1Abis if so, access error.
lda gbuf+38
beq L4BF6
L4BF1 lda #MLI.E.LOCKED access error.
jsr GP.P8errv
L4BF6 sta gbuf+4 make it an invalid subdirectory L4BF6 sta gbuf+4 make it an invalid subdirectory
jsr wrtgbuf jsr XDOS.WriteGBuf
bcs L4C1A bcs L4C1A
L4BFE lda gbuf+2 get forward link. L4BFE lda gbuf+2 get forward link.
@ -133,11 +130,13 @@ L4C0A jsr dealloc free this block.
lda gbuf+2 lda gbuf+2
ldx gbuf+3 ldx gbuf+3
jsr rdblk jsr XDOS.ReadGBufAX
bcc L4BFE loop until all freed bcc L4BFE loop until all freed
L4C1A rts L4C1A rts
L4C1Abis lda #MLI.E.LOCKED access error.
.HS 2C BIT ABS
L4C1B lda #MLI.E.INCFF file incompatible L4C1B lda #MLI.E.INCFF file incompatible
jsr GP.P8errv jsr GP.P8errv
@ -152,7 +151,7 @@ fcbused pha mark fcb as dirty so the directory will be flushed on 'flush
tay tay
pla pla
rts rts
*--------------------------------------
* 'detree' deallocates blocks from tree files. it is assumed that the device has * 'detree' deallocates blocks from tree files. it is assumed that the device has
* been pre-selected and the 'gbuf' may be used. * been pre-selected and the 'gbuf' may be used.
* *
@ -172,7 +171,7 @@ fcbused pha mark fcb as dirty so the directory will be flushed on 'flush
* *
* to trim a tree to a seed file, both dtree and dsap must be zero. * to trim a tree to a seed file, both dtree and dsap must be zero.
* to go from tree to sapling, dtree alone must be zero. * to go from tree to sapling, dtree alone must be zero.
*--------------------------------------
detree lda stortyp which kind of tree ? detree lda stortyp which kind of tree ?
cmp #$20 is it a 'seed' ? cmp #$20 is it a 'seed' ?
bcc L4C46 if yes. bcc L4C46 if yes.
@ -186,7 +185,7 @@ detree lda stortyp which kind of tree ?
lda #$0C block allocation error. lda #$0C block allocation error.
jsr sysdeath P8 system death vector jsr sysdeath P8 system death vector
* seedling file type - make sure first desireable block is the only * seedling file type - make sure first desirable block is the only
* block available in a seedling file. * block available in a seedling file.
L4C46 lda dsap L4C46 lda dsap
@ -195,7 +194,7 @@ L4C46 lda dsap
jmp seedel0 jmp seedel0
* sapling file type - make sure first desireable block is within the range of * sapling file type - make sure first desirable block is within the range of
* blocks available in a sapling file * blocks available in a sapling file
L4C51 lda dtree can't have any blocks in this range L4C51 lda dtree can't have any blocks in this range
@ -238,7 +237,9 @@ L4C8A stz dealbufl,x fill rest of dealc buffer with null addresses.
L4C93 dey decrement to prepare for next time. L4C93 dey decrement to prepare for next time.
sty topdest save index. sty topdest save index.
ldx #$07 ldx #$07
L4C99 stx dtmpx save index to dealc buf. L4C99 stx dtmpx save index to dealc buf.
lda dealbufl,x lda dealbufl,x
sta bloknml sta bloknml
@ -247,13 +248,13 @@ L4C99 stx dtmpx save index to dealc buf.
lda dealbufh,x complete address with high byte, lda dealbufh,x complete address with high byte,
sta bloknml+1 sta bloknml+1
jsr rdgbuf read sapling level into gbuf. jsr XDOS.ReadGBuf read sapling level into gbuf.
bcs L4CC2 return errors. bcs L4CC2 return errors.
jsr dealblk go free all data indexes in this block jsr dealblk go free all data indexes in this block
bcs L4CC2 bcs L4CC2
jsr wrtgbuf write the flipped index block jsr XDOS.WriteGBuf write the flipped index block
bcs L4CC2 bcs L4CC2
ldx dtmpx restore index to dealc buff. ldx dtmpx restore index to dealc buff.
@ -269,20 +270,20 @@ L4CC3 ldy dtree deallocate all sapling blocks greater
jsr dalblk1 (master index in gbuf) jsr dalblk1 (master index in gbuf)
bcs L4CC2 if errors. bcs L4CC2 if errors.
jsr wrtgbuf write updated master index back to disk. jsr XDOS.WriteGBuf write updated master index back to disk.
bcs L4CC2 bcs L4CC2
ldy dtree figure out if tree can become sapling. ldy dtree figure out if tree can become sapling.
beq L4CEB branch if it can. beq L4CEB branch if it can.
lda gbuf,y otherwise, continue with partial. lda gbuf,y otherwise, continue with partial, deallocation of last sapling index.
sta bloknml deallocation of last sapling index.
ora gbuf+$100,y is there such a sapling index block ? ora gbuf+$100,y is there such a sapling index block ?
beq L4CC2 all done if not. beq L4CC2 all done if not.
lda gbuf+$100,y read in sapling level to be modified. lda gbuf,y
sta bloknml+1 ldx gbuf+$100,y read in sapling level to be modified.
jsr rdgbuf read highest sapling index into gbuf.
jsr XDOS.ReadGBufAX read highest sapling index into gbuf.
bcc L4CF5 bcc L4CF5
rts rts
@ -300,38 +301,38 @@ L4CF5 ldy dsap pointer to last of desirable indexes.
jsr dalblk1 deallocate all indexes above specified. jsr dalblk1 deallocate all indexes above specified.
bcs L4CC2 bcs L4CC2
jsr wrtgbuf write out the index block jsr XDOS.WriteGBuf write out the index block
bcs L4CC2 bcs L4CC2
L4D05 ldy dsap prepare to clean up last data block. L4D05 ldy dsap prepare to clean up last data block.
beq L4D1F branch if possibility of making a seed. beq L4D1F branch if possibility of making a seed.
L4D0A lda gbuf,y fetch low order data block address. L4D0A lda gbuf,y fetch low order data block address.
sta bloknml
ora gbuf+$100,y is it a real block ? ora gbuf+$100,y is it a real block ?
beq L4CC2 if not, then done. beq L4CC2 if not, then done.
lda gbuf+$100,y lda gbuf,y
sta bloknml+1 ldx gbuf+$100,y
jsr rdgbuf go read data block into gbuf.
jsr XDOS.ReadGBufAX go read data block into gbuf.
bcc L4D2E branch if good read bcc L4D2E branch if good read
rts or return error. L4D1E rts or return error.
L4D1F lda dtree are both tree and sap levels zero ? L4D1F lda dtree are both tree and sap levels zero ?
bne L4D0A if not. bne L4D0A if not.
jsr shrink reduce this sap to a seed. jsr shrink reduce this sap to a seed.
bcs L4D52 if error. bcs L4D1E if error.
seedel0 jsr drdfrst go read data block. seedel0 jsr drdfrst go read data block.
bcs L4D52 if error. bcs L4D1E if error.
L4D2E ldy dseed+1 check high byte for no deletion. L4D2E ldy dseed+1 check high byte for no deletion.
beq L4D39 branch if all of 2nd page to be deleted. beq L4D39 branch if all of 2nd page to be deleted.
dey if dseed > $200 then all were done. dey if dseed > $200 then all were done.
bne L4D52 branch if that is the case. bne L4D1E branch if that is the case.
ldy dseed clear only bytes >= dseed. ldy dseed clear only bytes >= dseed.
@ -350,13 +351,13 @@ L4D49 sta gbuf,y
iny iny
bne L4D49 bne L4D49
L4D4F jmp wrtgbuf update data block to disk. L4D4F jmp XDOS.WriteGBuf update data block to disk.
L4D52 rts return error status. L4D52 rts return error status.
drdfrst lda firstbl read specified 1st block into gbuf drdfrst lda firstbl read specified 1st block into gbuf
ldx firstbh ldx firstbh
jmp rdblk go read it jmp XDOS.ReadGBufAX go read it
* beware that dealloc may bring in a new bitmap block and may destroy * beware that dealloc may bring in a new bitmap block and may destroy
* locations 46 and 47 which are used to point to the current index block. * locations 46 and 47 which are used to point to the current index block.
@ -371,7 +372,7 @@ shrink ldx firstbh first deallocate top index block
sta bloknml set master of sapling sta bloknml set master of sapling
pla index block address. pla index block address.
sta bloknml+1 sta bloknml+1
bcs L4D8D report errors. bcs L4D1E report errors.
lda gbuf get # of new 1st block from old index. lda gbuf get # of new 1st block from old index.
sta firstbl sta firstbl
@ -383,9 +384,7 @@ shrink ldx firstbh first deallocate top index block
lda stortyp from tree to sapling, lda stortyp from tree to sapling,
sbc #$10 or from sapling to seed. sbc #$10 or from sapling to seed.
sta stortyp sta stortyp
jsr wrtgbuf write the (deallocated) old top index. jmp XDOS.WriteGBuf write the (deallocated) old top index.
L4D8D rts return error status.
dealblk ldy #$00 start at beginning. dealblk ldy #$00 start at beginning.
dalblk1 lda bloknml save disk address of gbuf's data. dalblk1 lda bloknml save disk address of gbuf's data.
@ -1031,7 +1030,7 @@ XDOS.FREE .EQ $FEFD-*-XDOS.DATA.LEN (2.0.3 = $0C)
cortdisp .EQ $FEFD cortdisp .EQ $FEFD
cortflag .EQ $FEFF cortland flag. 1 = Cortland system (must stay within page boundary) cortflag .EQ $FEFF cortland flag. 1 = Cortland system (must stay within page boundary)
*-------------------------------------- *--------------------------------------
XDOS.LEN .EQ *-XDOS.START XDOS.LEN .EQ *-XDOS
MAN MAN
SAVE USR/SRC/PRODOS.FX/PRODOS.S.XDOS.F SAVE USR/SRC/PRODOS.FX/PRODOS.S.XDOS.F
LOAD USR/SRC/PRODOS.FX/PRODOS.S LOAD USR/SRC/PRODOS.FX/PRODOS.S

View File

@ -73,17 +73,18 @@ L59BD jsr XRW.AllPhaseOff make sure all motor phases are off.
pha save sector # across call pha save sector # across call
jsr regrwts jsr regrwts
pla plx
bcs .3 if error bcs .3 if error
inc buf+1 inc buf+1
txa
adc #$02 adc #$02
jsr regrwts get 2nd half of block jsr regrwts get 2nd half of block
dec buf+1 dec buf+1
.3 lda ibstat .3 rts
rts
.9 lda #MLI.E.IO .9 lda #MLI.E.IO
sec sec
@ -220,9 +221,8 @@ L53D5 lda XRW.AddrField.S is this the right sector ?
L53E7 lda #$00 L53E7 lda #$00
.HS D0 bne branch never taken (skip 1 byte) .HS D0 bne branch never taken (skip 1 byte)
hndlerr sec hndlerr sec
sta ibstat error #
ldx A2L slot offset ldx A2L slot offset
lda IO.D2.DrvOff,x turn off bit IO.D2.DrvOff,x turn off
rts rts
*-------------------------------------- *--------------------------------------
L53F4 jsr XRW.Write L53F4 jsr XRW.Write
@ -940,8 +940,8 @@ XRW.AddrField.S .HS 00 AddrField Sector
XRW.AddrField.T .HS 00 AddrField Track XRW.AddrField.T .HS 00 AddrField Track
XRW.AddrField.V .HS 00 AddrField Volume XRW.AddrField.V .HS 00 AddrField Volume
.HS 6C .HS 6C
* .HS FF .HS FF
ibstat .HS 00 *ibstat .HS 00
.HS 707478 .HS 707478
.HS FFFFFF .HS FFFFFF
.HS 7C .HS 7C

View File

@ -139,14 +139,15 @@ prefixbuf .EQ $D742+125
fcbbuf .EQ $D800 fcb buffer fcbbuf .EQ $D800 fcb buffer
VCBs .EQ $D900 VCBs .EQ $D900
VCB.DEV .EQ 16 VCB.DEV .EQ 16
VCB.OFCNT .EQ 17 *VCB.OF .EQ 17
VCB.ROOT .EQ 18 VCB.TBLK .EQ 18
VCB.BMAP .EQ 20 VCB.FBLK .EQ 20
VCB.TBLK .EQ 22 VCB.ROOT .EQ 22
VCB.FBLK .EQ 24 VCB.BMAP .EQ 26
VCB.BMAPIDX .EQ 26 VCB.BMAPIDX .EQ 28
VCB.OFCNT .EQ 30
* *
VCB .EQ 27 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
@ -175,38 +176,38 @@ X.Unpak.XatYA sty ZPOutBufPtr
.INB usr/src/shared/x.unpak.s .INB usr/src/shared/x.unpak.s
*-------------------------------------- *--------------------------------------
PAKME.Table PAKME.Table
PAKME.ILDR .DA ILDR PAKME.ILDR .DA ILDR.PAK
PAKME.GP .DA GP PAKME.GP .DA GP.PAK
PAKME.XRW .DA XRW PAKME.XRW .DA XRW.PAK
PAKME.XDOS .DA XDOS PAKME.XDOS .DA XDOS.PAK
PAKME.IRQ .DA IRQ PAKME.IRQ .DA IRQ.PAK
PAKME.RAM .DA RAM PAKME.RAM .DA RAM.PAK
PAKME.RAMX .DA RAMX PAKME.RAMX .DA RAMX.PAK
PAKME.NCLK .DA NCLK PAKME.NCLK .DA NCLK.PAK
PAKME.TCLK .DA TCLK PAKME.TCLK .DA TCLK.PAK
PAKME.CCLK .DA CCLK PAKME.CCLK .DA CCLK.PAK
PAKME.SEL1 .DA SEL1 PAKME.SEL1 .DA SEL1.PAK
PAKME.SEL2 .DA SEL2 PAKME.SEL2 .DA SEL2.PAK
ILDR .DA #0 ILDR.PAK .DA #0
.DA ILDR.LEN .DA ILDR.LEN
.PH $800 .PH $800
.INB usr/src/prodos.fx/prodos.s.ildr .INB usr/src/prodos.fx/prodos.s.ildr
.EP .EP
GP .DA #0 GP.PAK .DA #0
.DA GP.LEN .DA GP.LEN
.PH $BF00 .PH $BF00
.INB usr/src/prodos.fx/prodos.s.gp .INB usr/src/prodos.fx/prodos.s.gp
.EP .EP
XRW .DA #0 XRW.PAK .DA #0
.DA XRW.LEN .DA XRW.LEN
.PH $D000 .PH $D000
.INB usr/src/prodos.fx/prodos.s.xrw .INB usr/src/prodos.fx/prodos.s.xrw
.EP .EP
XDOS .DA #0 XDOS.PAK .DA #0
.DA XDOS.LEN .DA XDOS.LEN
.PH $DE00 .PH $DE00
.INB usr/src/prodos.fx/prodos.s.xdos.a .INB usr/src/prodos.fx/prodos.s.xdos.a
@ -217,49 +218,49 @@ XDOS .DA #0
.INB usr/src/prodos.fx/prodos.s.xdos.f .INB usr/src/prodos.fx/prodos.s.xdos.f
.EP .EP
IRQ .DA #0 IRQ.PAK .DA #0
.DA IRQ.LEN .DA IRQ.LEN
.PH $FF9B .PH $FF9B
.INB usr/src/prodos.fx/prodos.s.irq .INB usr/src/prodos.fx/prodos.s.irq
.EP .EP
RAM .DA #0 RAM.PAK .DA #0
.DA RAM.LEN .DA RAM.LEN
.PH $FF00 .PH $FF00
.INB usr/src/prodos.fx/prodos.s.ram .INB usr/src/prodos.fx/prodos.s.ram
.EP .EP
RAMX .DA #0 RAMX.PAK .DA #0
.DA RAMX.LEN .DA RAMX.LEN
.PH $200 .PH $200
.INB usr/src/prodos.fx/prodos.s.ramx .INB usr/src/prodos.fx/prodos.s.ramx
.EP .EP
NCLK .DA #0 NCLK.PAK .DA #0
.DA NCLK.LEN .DA NCLK.LEN
.PH XDOS.ClockDrv .PH XDOS.ClockDrv
.INB usr/src/prodos.fx/prodos.s.nclk .INB usr/src/prodos.fx/prodos.s.nclk
.EP .EP
TCLK .DA #0 TCLK.PAK .DA #0
.DA TCLK.LEN .DA TCLK.LEN
.PH XDOS.ClockDrv .PH XDOS.ClockDrv
.INB usr/src/prodos.fx/prodos.s.tclk .INB usr/src/prodos.fx/prodos.s.tclk
.EP .EP
CCLK .DA #0 CCLK.PAK .DA #0
.DA CCLK.LEN .DA CCLK.LEN
.PH XDOS.ClockDrv .PH XDOS.ClockDrv
.INB usr/src/prodos.fx/prodos.s.cclk .INB usr/src/prodos.fx/prodos.s.cclk
.EP .EP
SEL1 .DA #0 SEL1.PAK .DA #0
.DA SEL1.LEN .DA SEL1.LEN
.PH $1000 .PH $1000
.INB usr/src/prodos.fx/prodos.s.sel1 .INB usr/src/prodos.fx/prodos.s.sel1
.EP .EP
SEL2 .DA #0 SEL2.PAK .DA #0
.DA SEL2.LEN .DA SEL2.LEN
.PH $1000 .PH $1000
.INB usr/src/prodos.fx/prodos.s.sel2 .INB usr/src/prodos.fx/prodos.s.sel2