mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-25 20:33:13 +00:00
Kernel 0.94
This commit is contained in:
parent
9f6b280b9f
commit
e552a07365
Binary file not shown.
Binary file not shown.
@ -118,10 +118,7 @@ scperr lda #MLI.E.BADCNT
|
||||
*--------------------------------------
|
||||
* ProDOS Device Manager
|
||||
*--------------------------------------
|
||||
XDOS.devmgr php do not allow interrupts.
|
||||
sei the call spec for devices must
|
||||
|
||||
ldy #$05
|
||||
XDOS.devmgr ldy #$05 the call spec for devices must
|
||||
|
||||
.1 lda (A3L),y be passed to drivers in page zero:
|
||||
sta A4L,y
|
||||
@ -138,24 +135,38 @@ XDOS.devmgr php do not allow interrupts.
|
||||
inx else account for 3-page straddle
|
||||
|
||||
.2 jsr vldbuf1 make sure user buffer is not
|
||||
bcs .9 conflicting with protected ram.
|
||||
bcs gosyserr conflicting with protected ram.
|
||||
|
||||
jsr dmgr call internal entry for device dispatch
|
||||
bcs .9 branch if error
|
||||
plp
|
||||
clc no error
|
||||
rts
|
||||
jsr XDOS.DevCall call internal entry for device dispatch
|
||||
bcc XDOS.DevCall.RTS
|
||||
|
||||
.9 plp restore interrupt status
|
||||
gosyserr jsr GP.P8errv
|
||||
*--------------------------------------
|
||||
dmgr lda unitnum get device # and
|
||||
XDOS.DevCall php do not allow interrupts.
|
||||
sei
|
||||
|
||||
lda unitnum get device # and
|
||||
and #$F0 strip misc lower nibble
|
||||
sta unitnum then save it.
|
||||
lsr use as index to device table
|
||||
lsr
|
||||
lsr
|
||||
tax
|
||||
jsr XDOS.DevCall.Jmp
|
||||
|
||||
bcs .9
|
||||
|
||||
plp
|
||||
clc
|
||||
rts
|
||||
|
||||
.9 plp
|
||||
sec
|
||||
|
||||
XDOS.DevCall.RTS
|
||||
rts
|
||||
|
||||
XDOS.DevCall.Jmp
|
||||
jmp (DEVPTRS,x) goto driver (or error if no driver)
|
||||
*--------------------------------------
|
||||
* ProDOS interrupt manager
|
||||
@ -751,11 +762,11 @@ swpbloks lda bloknml,x prepare new directory block
|
||||
sta bloknml,x and save new block as next to be written
|
||||
dex
|
||||
bpl swpbloks
|
||||
inx
|
||||
txa x and a = 0
|
||||
|
||||
clrdir sta gbuf+2,x
|
||||
sta gbuf+$100,x
|
||||
inx x = 0
|
||||
|
||||
clrdir stz gbuf+2,x
|
||||
stz gbuf+$100,x
|
||||
inx
|
||||
bne clrdir
|
||||
|
||||
@ -768,11 +779,13 @@ clrdir sta gbuf+2,x
|
||||
|
||||
lda own_blk
|
||||
ldx own_blk+1
|
||||
|
||||
.DO LOWERCASE=1
|
||||
jsr XDOS.ReadGBufAXDir
|
||||
.ELSE
|
||||
jsr XDOS.ReadGBufAX read in parent directory block
|
||||
.FIN
|
||||
|
||||
ldx own_ent and calc entry address.
|
||||
lda /gbuf
|
||||
sta zpt+1
|
||||
|
@ -460,6 +460,7 @@ L39F4 cmp loklst,x of prospective devices.
|
||||
|
||||
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.
|
||||
|
@ -264,9 +264,7 @@ XDOS.WriteGBuf lda #$02 write command
|
||||
sta A4L pass to device handler.
|
||||
lda /gbuf general buffer.
|
||||
|
||||
XDOS.RWBlock php no interrupts
|
||||
sei
|
||||
sta buf+1 buffer high.
|
||||
XDOS.RWBlock sta buf+1 buffer high.
|
||||
stz buf buffer low (always on page boundary)
|
||||
|
||||
stz p8error clear global error code.
|
||||
@ -276,16 +274,7 @@ XDOS.RWBlock php no interrupts
|
||||
|
||||
lda devnum transfer dev # for dispatcher to
|
||||
sta unitnum convert to unit #.
|
||||
jsr dmgr call the driver.
|
||||
bcs .9 if error.
|
||||
|
||||
plp restore interrupts.
|
||||
clc
|
||||
rts
|
||||
|
||||
.9 plp file i/o error. restore interrupts.
|
||||
sec
|
||||
rts
|
||||
jmp XDOS.DevCall call the driver.
|
||||
*--------------------------------------
|
||||
.DO LOWERCASE=1
|
||||
|
||||
@ -489,7 +478,7 @@ L3E50 ldy #$A4 clear illegal filetype entry in fcb
|
||||
L3E59 lda FCBs+FCB.STYPE,y use storage type as # of index levels
|
||||
sta levels since 1=seed, 2=sapling, 3=tree.
|
||||
lda FCBs+FCB.F,y
|
||||
and #$40 if previous data was modified then
|
||||
and #FCB.F.DBLKMOD if previous data was modified then
|
||||
beq L3E6B disk must be updated.
|
||||
|
||||
jsr wfcbdat
|
||||
@ -671,13 +660,13 @@ L3F68 lda FCBs+FCB.MARK,y save old mark in case calling routine
|
||||
adc datptr+1
|
||||
sta sos+1
|
||||
L3F86 rts carry set if error
|
||||
|
||||
*--------------------------------------
|
||||
clrstats ldy fcbptr clear allocation states for data block
|
||||
lda FCBs+FCB.F,y and both levels of indexes/
|
||||
and #$F8
|
||||
sta FCBs+FCB.F,y indicates that either they exist now
|
||||
rts or unnecessary for current position.
|
||||
|
||||
*--------------------------------------
|
||||
dirmark cmp #$0D is it a directory ?
|
||||
beq L3F9C yes...
|
||||
|
||||
@ -754,7 +743,7 @@ rfcbidx lda #$01 prepare to read index block : read command
|
||||
* clc
|
||||
|
||||
L400C rts
|
||||
|
||||
*--------------------------------------
|
||||
wfcbfst jsr upbmap update the bitmap and write file's 1st block.
|
||||
|
||||
lda #$02 write command
|
||||
@ -783,10 +772,7 @@ dofileio sta A4L command
|
||||
L4031 lda FCBs+FCB.DEVID,y high address of disk block
|
||||
sta bloknml+1
|
||||
|
||||
fileio1 php no interrupts
|
||||
sei
|
||||
|
||||
lda $00,x get memory address of buffer from
|
||||
fileio1 lda $00,x get memory address of buffer from
|
||||
sta buf page zero pointed to by x register
|
||||
lda $01,x
|
||||
sta buf+1 and pass address to device handler
|
||||
@ -798,17 +784,8 @@ fileio1 php no interrupts
|
||||
lda devnum transfer device # for dispatcher
|
||||
sta unitnum to convert to unit #.
|
||||
stz p8error clear global error code.
|
||||
jsr dmgr call the driver.
|
||||
bcs L405E if error.
|
||||
|
||||
plp restore interrupts
|
||||
clc
|
||||
rts
|
||||
|
||||
L405E plp restore interrupts
|
||||
sec
|
||||
rts
|
||||
|
||||
jmp XDOS.DevCall call the driver.
|
||||
*--------------------------------------
|
||||
wfcbdat ldx #datptr point at memory address with x and
|
||||
lda #$10 disk address with y.
|
||||
ora fcbptr add offset to fcbptr
|
||||
@ -938,15 +915,15 @@ L413C sta tposll,y
|
||||
bcc L4163 if successful.
|
||||
|
||||
L4147 pha save error code.
|
||||
ldy fcbptr free buffer space.
|
||||
lda FCBs+FCB.BUFID,y
|
||||
|
||||
ldx fcbptr free buffer space.
|
||||
lda FCBs+FCB.BUFID,x
|
||||
beq L4156 if no bufnum, ok because never alloc'd.
|
||||
|
||||
jsr relbuffr go release buffer.
|
||||
ldy fcbptr since error was before file was
|
||||
ldx fcbptr
|
||||
|
||||
L4156 lda #$00 successfully opened, then it is
|
||||
sta FCBs,y necessary to release fcb also.
|
||||
L4156 stz FCBs,x necessary to release fcb also.
|
||||
pla error code.
|
||||
sec
|
||||
rts
|
||||
|
@ -119,17 +119,11 @@ L429C dec zpt+1
|
||||
lda ioaccess has 1st call gone to device yet ?
|
||||
beq L4249 no, go thru normal route
|
||||
|
||||
php interrupts can't occur during dmgr call
|
||||
sei
|
||||
lda datptr+1 reset hi buffer address for dev handler
|
||||
sta buf+1
|
||||
jsr dmgr
|
||||
bcs L42B6 if error
|
||||
jsr XDOS.DevCall
|
||||
bcc L424E no errors, branch always.
|
||||
|
||||
plp
|
||||
bra L424E no errors, branch always.
|
||||
|
||||
L42B6 plp restore interrupts.
|
||||
L42B7 pha save error code.
|
||||
jsr fxdatptr go restore data pointers, etc.
|
||||
pla
|
||||
@ -166,6 +160,7 @@ L42E9 lda FCBs+FCB.NLMASK,y test for new line enabled.
|
||||
sta nlmask
|
||||
lda FCBs+FCB.NLBYTE,y move newline character to more
|
||||
sta nlchar accesible spot.
|
||||
|
||||
L42F9 ldy tposll index to 1st data.
|
||||
lda datptr reset low order of position pointer to
|
||||
sta sos beginning of page.
|
||||
@ -231,6 +226,7 @@ L4350 iny adjust position.
|
||||
inc tposhi
|
||||
|
||||
L435D bit setvflg (sets v flag)
|
||||
|
||||
L4360 sty tposll save low position
|
||||
bvs L4366
|
||||
|
||||
@ -536,13 +532,16 @@ L4539 iny and position
|
||||
bne L4546
|
||||
|
||||
inc tposhi
|
||||
|
||||
L4546 bit setvflg set v flag
|
||||
|
||||
L4549 sty tposll save low position
|
||||
stx rwreql and remainder of request count.
|
||||
php save statuses
|
||||
jsr gfcbstat
|
||||
ora #$50
|
||||
sta FCBs+FCB.F,y
|
||||
|
||||
lda #$50
|
||||
jsr XDOS.SetFCBStatus
|
||||
|
||||
clc adjust user's low buffer address
|
||||
lda tposll
|
||||
adc usrbuf
|
||||
@ -600,9 +599,9 @@ sapdown jsr gfcbstyp find out if dealing with a tree.
|
||||
bcc L457A if no error.
|
||||
|
||||
L45B1 rts return errors.
|
||||
|
||||
*--------------------------------------
|
||||
swapdown jsr alcwblk make current seed into a sapling, allocate a block before swap.
|
||||
bcs L45F6 return errors.
|
||||
bcs .9 return errors.
|
||||
|
||||
ldy fcbptr get previous first block
|
||||
lda FCBs+FCB.1stBLK,y address into index block.
|
||||
@ -624,47 +623,38 @@ swapdown jsr alcwblk make current seed into a sapling, allocate a block befo
|
||||
pla
|
||||
sta (zpt)
|
||||
jsr wfcbfst save new file top.
|
||||
bcs L45F6 if error.
|
||||
bcs .9 if error.
|
||||
|
||||
jsr gfcbstyp now adjust storage type by adding 1
|
||||
* adc #$01 (seed becomes sapling becomes tree)
|
||||
inc
|
||||
sta FCBs+FCB.STYPE,y
|
||||
lda FCBs+FCB.F,y mark storage type modified
|
||||
ora #FCB.F.STMOD
|
||||
sta FCBs+FCB.F,y
|
||||
lda #FCB.F.STMOD
|
||||
jsr XDOS.SetFCBStatus
|
||||
|
||||
clc no error
|
||||
L45F6 rts
|
||||
inc FCBs+FCB.STYPE,x
|
||||
|
||||
* clc no error
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
alcwblk jsr alc1blk
|
||||
bcs L4616
|
||||
bcs .9
|
||||
|
||||
jsr gfcbstat mark usage as modified
|
||||
lda #FCB.F.UMOD
|
||||
jsr XDOS.SetFCBStatus
|
||||
|
||||
ora #FCB.F.UMOD
|
||||
sta FCBs+FCB.F,y
|
||||
|
||||
lda FCBs+FCB.UBLK,y inc current usage count by 1
|
||||
inc
|
||||
sta FCBs+FCB.UBLK,y
|
||||
bne L4615
|
||||
inc FCBs+FCB.UBLK,x
|
||||
bne .9
|
||||
|
||||
lda FCBs+FCB.UBLK+1,y
|
||||
inc
|
||||
sta FCBs+FCB.UBLK+1,y
|
||||
|
||||
L4615 clc no error
|
||||
L4616 rts
|
||||
inc FCBs+FCB.UBLK+1,x
|
||||
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
tstwprot jsr gfcbstat check for 'never been modified' condition
|
||||
and #$F0
|
||||
bne L4615 ordinary rts if known write ok.
|
||||
bne tstwprot.8 ordinary rts if known write ok.
|
||||
|
||||
lda FCBs+FCB.DEVID,y get file's dev #.
|
||||
sta devnum get current status of block device.
|
||||
|
||||
twrprot1 sta unitnum make the device status call
|
||||
|
||||
lda bloknml+1
|
||||
pha
|
||||
lda bloknml save the current block values
|
||||
@ -673,26 +663,20 @@ twrprot1 sta unitnum make the device status call
|
||||
stz bloknml zero the block #
|
||||
stz bloknml+1
|
||||
|
||||
php
|
||||
sei
|
||||
jsr dmgr
|
||||
jsr XDOS.DevCall
|
||||
bcs .1 branch if write protect error
|
||||
|
||||
lda #$00 otherwise, assume no errors.
|
||||
|
||||
.1 plp restore interrupt status
|
||||
clc
|
||||
tax save error.
|
||||
beq .2 branch if no error
|
||||
.1 plx
|
||||
stx bloknml restore the block #
|
||||
plx
|
||||
stx bloknml+1
|
||||
|
||||
sec else, set carry to show error.
|
||||
rts
|
||||
|
||||
.2 pla
|
||||
sta bloknml restore the block #
|
||||
pla
|
||||
sta bloknml+1
|
||||
txa
|
||||
rts carry is indeterminate.
|
||||
tstwprot.8 clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE usr/src/prodos.fx/prodos.s.xdos.d
|
||||
|
@ -45,9 +45,10 @@ close2 ldy fcbptr
|
||||
bcs L46B6
|
||||
|
||||
lda #$00
|
||||
ldy fcbptr
|
||||
sta FCBs,y free fcb too
|
||||
lda FCBs+FCB.DEVID,y
|
||||
ldx fcbptr
|
||||
stz FCBs,x free fcb too
|
||||
|
||||
lda FCBs+FCB.DEVID,x
|
||||
sta devnum go look for associated vcb
|
||||
jsr XDOS.FindVCBForDevNum get vcb pointer.
|
||||
|
||||
@ -190,10 +191,9 @@ L4780 lda FCBs+FCB.STYPE-2,y the last thing to update is storage
|
||||
jsr drevise go update directory.
|
||||
bcs glberr error.
|
||||
|
||||
ldy fcbptr mark
|
||||
lda FCBs+FCB.DIRTY,y fcb/directory
|
||||
and #$7F as
|
||||
sta FCBs+FCB.DIRTY,y undirty.
|
||||
ldx fcbptr mark
|
||||
stz FCBs+FCB.DIRTY,x fcb/directory as undirty.
|
||||
|
||||
lda d_dev see if bitmap should be written.
|
||||
cmp bmadev is it in same as current file ?
|
||||
bne L47B2 yes, put it on the disk if necessary.
|
||||
@ -228,6 +228,12 @@ L47CA lda #MLI.E.LOCKED access error
|
||||
sec
|
||||
L47CD rts
|
||||
*--------------------------------------
|
||||
XDOS.SetFCBStatus
|
||||
ldx fcbptr
|
||||
ora FCBs+FCB.F,x
|
||||
sta FCBs+FCB.F,x
|
||||
rts
|
||||
*--------------------------------------
|
||||
XDOS.SetEOF jsr gfcbstyp can only move end of tree, sapling or seed.
|
||||
cmp #$04 tree type ?
|
||||
bcs L47CA if not then access error
|
||||
@ -363,6 +369,7 @@ L48A2 ldy fcbptr also must pass file's 1st block address.
|
||||
jsr detree deallocate blocks from tree.
|
||||
php save any error status until fcb
|
||||
pha is cleaned up.
|
||||
|
||||
sec
|
||||
ldy fcbptr
|
||||
ldx #$00
|
||||
|
@ -147,8 +147,8 @@ fcbused pha mark fcb as dirty so the directory will be flushed on 'flush
|
||||
tya save regs.
|
||||
pha
|
||||
ldy fcbptr
|
||||
lda FCBs+FCB.DIRTY,y fetch current fcb dirty byte.
|
||||
ora #$80 mark fcb as dirty.
|
||||
|
||||
lda #$80 mark fcb as dirty.
|
||||
sta FCBs+FCB.DIRTY,y save it back
|
||||
pla and restore regs.
|
||||
tay
|
||||
@ -513,6 +513,7 @@ freebuf ldx bufaddrh get hi buffer address
|
||||
inx
|
||||
inx
|
||||
inx
|
||||
|
||||
L4E43 dex drop to next lower page.
|
||||
jsr cmembit get bit and position to memtable of
|
||||
eor #$FF this page. invert mask.
|
||||
|
Loading…
Reference in New Issue
Block a user