Kernel 0.92

This commit is contained in:
Rémy GIBERT 2018-12-10 17:45:37 +01:00
parent 52f5193415
commit c5ff44ac93
8 changed files with 155 additions and 81 deletions

View File

@ -225,8 +225,8 @@ CS.QUIT clc
rts rts
*-------------------------------------- *--------------------------------------
CS.END CS.END
MSG0 .AZ "ID hFD Name Addr. Status Typ/Sub IDString Version Size (BLK)" MSG0 .AZ "ID hFD Name Addr. Status Typ/Sub IDString Version Size (BLK)"
MSG1 .AZ "%03d $%h %7s $%H " MSG1 .AZ "%03d $%h %12s $%H "
MSG2.ERR .AZ "Device Error : $%h\r\n" MSG2.ERR .AZ "Device Error : $%h\r\n"
MSG2 .AZ "%s $%h/$%h %16S %03d.%03d " MSG2 .AZ "%s $%h/$%h %16S %03d.%03d "
MSG2.B .AZ "%10u\r\n" MSG2.B .AZ "%10u\r\n"

View File

@ -146,8 +146,21 @@ STATUS >STYA ZPIOCTL
sec sec
rts rts
*-------------------------------------- *--------------------------------------
OPEN sta A2osX.SCRNDEVS DEV.ID in A OPEN ldx #0
.1 ldy A2osX.SCRNDEVS,x
beq .2
inx
cpx #K.SCR.MAX
bne .1
lda #E.OOH
sec
rts
.2 sta A2osX.SCRNDEVS,x DEV.ID in A
sta DEVID
lda #S.DIB.S.OPENED lda #S.DIB.S.OPENED
tsb DIB+S.DIB.S tsb DIB+S.DIB.S
@ -161,7 +174,7 @@ CONTROL sta SETTEXT
sta SET80DISP sta SET80DISP
sta CLR80STORE sta CLR80STORE
sta CLRPAGE2 sta CLRPAGE2
lda #1 lda DEVID
sta A2osX.ASCREEN sta A2osX.ASCREEN
clc clc
@ -1116,6 +1129,7 @@ SB.IS.NAWS .DA #IAC,#SB,#TELOPT.NAWS,#SB.IS
.DA #IAC,#SE .DA #IAC,#SE
SB.IS.NAWS.LEN .EQ *-SB.IS.NAWS SB.IS.NAWS.LEN .EQ *-SB.IS.NAWS
*-------------------------------------- *--------------------------------------
DEVID .BS 1
CH .BS 1 CH .BS 1
CV .BS 1 CV .BS 1
LWFLG .BS 1 LWFLG .BS 1

View File

@ -13,6 +13,7 @@ K.PS.MAX .EQ 32
K.OF.MAX .EQ 32 K.OF.MAX .EQ 32
K.FLT.MAX .EQ 4 K.FLT.MAX .EQ 4
K.EVT.MAX .EQ 4 K.EVT.MAX .EQ 4
K.SCR.MAX .EQ 6
*-------------------------------------- *--------------------------------------
ZPDRV .EQ $20 32 bytes ZPDRV .EQ $20 32 bytes
ZPLIB .EQ $40 32 bytes ZPLIB .EQ $40 32 bytes
@ -44,15 +45,13 @@ A2osX.SLEEP .EQ $BD10
* $BEE0->$BEEF : Public Variables * $BEE0->$BEEF : Public Variables
*-------------------------------------- *--------------------------------------
A2osX.ASCREEN .EQ $BEE0 Active Screen A2osX.ASCREEN .EQ $BEE0 Active Screen
A2osX.SCRNDEVS .EQ $BEE1 -> $BEE4 (4 screen devices) A2osX.SCRNDEVS .EQ $BEE1 -> $BEE4 (5 screen devices)
A2osX.CPUTYPE .EQ $BEE5 A2osX.CPUTYPE .EQ $BEE6
A2osX.CPUSPEED .EQ $BEE6 WORD, (->255.99 Mhz) A2osX.CPUSPEED .EQ $BEE7 WORD, (->255.99 Mhz)
A2osX.Z80SLOT .EQ $BEE8 A2osX.Z80SLOT .EQ $BEE9
A2osX.Z80SPEED .EQ $BEE9 WORD A2osX.Z80SPEED .EQ $BEEA WORD
* .EQ $BEEB
A2osX.TIMER16 .EQ $BEEC WORD A2osX.TIMER16 .EQ $BEEC WORD
A2osX.RANDOM16 .EQ $BEEE WORD A2osX.RANDOM16 .EQ $BEEE WORD
@ -61,6 +60,7 @@ A2osX.RANDOM16 .EQ $BEEE WORD
*-------------------------------------- *--------------------------------------
A2osX.KCONFIG .EQ $BEF0 A2osX.KCONFIG .EQ $BEF0
A2osX.HZ .EQ $BEF0 5/6 for 50/60Hz A2osX.HZ .EQ $BEF0 5/6 for 50/60Hz
A2osX.TTYDEVS .EQ $BEF1 K.SCR.MAX = 6 !
A2osX.F .EQ $BEF8 A2osX.F .EQ $BEF8
A2osX.F.CHROOT .EQ %10000000 ChRooting to /RAMx A2osX.F.CHROOT .EQ %10000000 ChRooting to /RAMx
A2osX.F.PMODE .EQ %01000000 Preemptive Mode A2osX.F.PMODE .EQ %01000000 Preemptive Mode

View File

@ -120,9 +120,9 @@ CORE.Events jsr CORE.GetEvents
bpl .8 bpl .8
cmp #"1" cmp #"0"
bcc .8 bcc .8
cmp #"5" cmp #"6"
bcs .8 bcs .8
sta KBDSTROBE sta KBDSTROBE
@ -380,7 +380,7 @@ CORE.ScrSel and #$0F
tax tax
lda A2osX.SCRNDEVS-1,x Get DevID lda A2osX.SCRNDEVS,x Get DevID
beq .8 No device claimed this screen beq .8 No device claimed this screen
stx A2osX.ASCREEN set active screen stx A2osX.ASCREEN set active screen

View File

@ -140,6 +140,11 @@ H.BIN.EXE.REL.TABLE .EQ 16
* *
H.BIN.DRV.REL.TABLE .EQ 2 Including main jmp H.BIN.DRV.REL.TABLE .EQ 2 Including main jmp
*-------------------------------------- *--------------------------------------
S.TTY.TITLE .EQ 48
S.TTY.FRBUF .EQ 128
*
S.TTY .EQ 2048
*--------------------------------------
MAN MAN
SAVE USR/SRC/SYS/KERNEL.S.DEF SAVE USR/SRC/SYS/KERNEL.S.DEF
LOAD USR/SRC/SYS/KERNEL.S LOAD USR/SRC/SYS/KERNEL.S

View File

@ -23,7 +23,7 @@ DRV.DiskII.STATUS
DRV.DiskII.DIB .DA #S.DIB.S.BLOCK+S.DIB.S.WRITE+S.DIB.S.READ DRV.DiskII.DIB .DA #S.DIB.S.BLOCK+S.DIB.S.WRITE+S.DIB.S.READ
.DA 280 .DA 280
.DA #0 .DA #0
>PSTR "Disk II 5.25" >PSTR "Disk ][ 5.25"
.BS 4 .BS 4
.DA #S.DIB.T.DISKII .DA #S.DIB.T.DISKII
.DA #0 .DA #0
@ -239,13 +239,25 @@ DRV.SYS cld
.DA DRV.SYS.CLOSE .DA DRV.SYS.CLOSE
.DA DRV.SYS.Read .DA DRV.SYS.Read
.DA DRV.SYS.Write .DA DRV.SYS.Write
.DA A2osX.BADCALL IRQ
*-------------------------------------- *--------------------------------------
DRV.SYS.STATUS >LDYAI DRV.SYS.DIB DRV.SYS.STATUS >LDYAI DRV.SYS.DIB
jmp DRV.STATUS.YA jmp DRV.STATUS.YA
*-------------------------------------- *--------------------------------------
DRV.SYS.Open lda #DEVID.SYS DRV.SYS.Open ldx #0
sta A2osX.SCRNDEVS+1
.1 ldy A2osX.SCRNDEVS,x
beq .2
inx
cpx #K.SCR.MAX
bne .1
lda #E.OOH
sec
rts
.2 sta A2osX.SCRNDEVS,x DEV.ID in A
sta DRV.SYS.DEVID
jsr DRV.SYS.FF jsr DRV.SYS.FF
*-------------------------------------- *--------------------------------------
DRV.SYS.Control sta SETTEXT DRV.SYS.Control sta SETTEXT
@ -253,7 +265,7 @@ DRV.SYS.Control sta SETTEXT
sta SET80DISP sta SET80DISP
sta CLR80STORE sta CLR80STORE
sta SETPAGE2 sta SETPAGE2
lda #2 lda DRV.SYS.DEVID
sta A2osX.ASCREEN sta A2osX.ASCREEN
DRV.SYS.CLOSE DRV.SYS.CLOSE
clc clc
@ -515,13 +527,14 @@ DRV.SYS.SetBaseX
sta ZPDRV+1 sta ZPDRV+1
rts rts
*-------------------------------------- *--------------------------------------
DRV.SYS.DIB .DA #S.DIB.S.WRITE+S.DIB.S.READ+S.DIB.S.OPENED DRV.SYS.DIB .DA #S.DIB.S.WRITE+S.DIB.S.READ
.DA #0,#0,#0 .DA #0,#0,#0
>PSTR "A2osX SYS Screen" >PSTR "A2osX VT100 TERM"
.DA #S.DIB.T.CHAR .DA #S.DIB.T.CHAR
.DA #0 .DA #0
.DA K.VER .DA K.VER
*-------------------------------------- *--------------------------------------
DRV.SYS.DEVID .BS 1
DRV.SYS.CH .BS 1 DRV.SYS.CH .BS 1
DRV.SYS.CV .BS 1 DRV.SYS.CV .BS 1
*-------------------------------------- *--------------------------------------

View File

@ -343,7 +343,8 @@ GP.CodeEnd .BS $BEE0-*
* $BEF0->$BEFF : Kernel Config Block * $BEF0->$BEFF : Kernel Config Block
*-------------------------------------- *--------------------------------------
.DA #6 A2osX.HZ=60hz .DA #6 A2osX.HZ=60hz
.HS 00000000000000 .DA #4 A2osX.TTYDEVS=4
.HS 000000000000
.DA #0 ChRoot/Preemptive Disabled .DA #0 ChRoot/Preemptive Disabled
.HS 00000000000000 All Slots marked as "Free" .HS 00000000000000 All Slots marked as "Free"
*-------------------------------------- *--------------------------------------

View File

@ -101,14 +101,12 @@ Kernel.Init3 sta SETALTZP
lda #$ff Make sure we are in Kernel Mode during setup lda #$ff Make sure we are in Kernel Mode during setup
sta IRQ.InKernel sta IRQ.InKernel
jsr SysScrInit
jsr MemMgrInit jsr MemMgrInit
>LDYAI FD.NULL >LDYAI FD.NULL
>SYSCALL MKDev >SYSCALL MKDev
>LDYAI FD.SYS jsr SysScrInit
>SYSCALL MKDev
jsr PS0.Init jsr PS0.Init
bcs * bcs *
@ -130,7 +128,6 @@ Kernel.Init3 sta SETALTZP
jsr TskMgrInit jsr TskMgrInit
bcs * bcs *
ldy #S.PS.hPREFIX ldy #S.PS.hPREFIX
lda (pPs),y lda (pPs),y
jsr K.GetMemPtr jsr K.GetMemPtr
@ -238,7 +235,94 @@ KConfigLoad >LDYAI MSG.KCREAD
*-------------------------------------- *--------------------------------------
* INIT3 Subs * INIT3 Subs
*-------------------------------------- *--------------------------------------
SysScrInit ldx #0 MemMgrInit >LDYAI Mem.MHiMem
>STYA Mem.HiMem
>STYA Mem.Free
>LDYAI Mem.MLoMem
>STYA Mem.LoMem
stz Mem.LastSlot Reserve Slot #0
* reserve AUXmem for TTY Frame bufers
lda A2osX.TTYDEVS
inc +1 for /DEV/CONSOLE
asl
asl
asl 8 pages (2k)
sta .10+1
sta SETWRITEAUX
ldy #Mem.XHiMem
sty Mem.HiMem
lda /Mem.XHiMem
sec
.10 sbc #$FF SELF MODIFIED
sta Mem.HiMem+1
>STYA Mem.Free
>LDYAI Mem.XLoMem
>STYA Mem.LoMem
stz Mem.LastSlot Reserve Slot #0
sta CLRWRITEAUX
ldx #K.DEV.MAX*2-1
.1 stz Dev.Table.hPath,x
dex
bpl .1
ldx #K.NOD.MAX*2-1
.2 stz Nod.Table.hPath,x
dex
bpl .2
ldx #K.PS.MAX*4-1
.3 stz PS.Table.PID,x
dex
bpl .3
ldx #K.OF.MAX*2-1
.4 stz OF.Table.hPath,x
dex
bpl .4
ldx #K.EVT.MAX*S.EVT-1
.5 stz Evt.Table,x
dex
bpl .5
stz Flt.Table
rts
*--------------------------------------
SysScrInit >LDYAI FD.SYS
>SYSCALL MKDev
lda A2osX.TTYDEVS
.1 pha
inc FD.TTY+S.FD.DEV.DEVID
inc FD.TTY+S.FD.DEV.NAME+3
lda FD.TTY+S.FD.DEV.BUSPTR+1
sec
sbc /2048
sta FD.TTY+S.FD.DEV.BUSPTR+1
>LDYAI FD.TTY
>SYSCALL MKDev
pla
dec
bne .1
SysScrInit.OLD ldx #0
ldy #0 ldy #0
@ -491,58 +575,6 @@ DetectZ80 ldx #Z80Code.Size
clc clc
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
MemMgrInit >LDYAI Mem.MHiMem
>STYA Mem.HiMem
>STYA Mem.Free
>LDYAI Mem.MLoMem
>STYA Mem.LoMem
stz Mem.LastSlot Reserve Slot #0
sta SETWRITEAUX
>LDYAI Mem.XHiMem
>STYA Mem.HiMem
>STYA Mem.Free
>LDYAI Mem.XLoMem
>STYA Mem.LoMem
stz Mem.LastSlot Reserve Slot #0
sta CLRWRITEAUX
ldx #K.DEV.MAX*2-1
.1 stz Dev.Table.hPath,x
dex
bpl .1
ldx #K.NOD.MAX*2-1
.2 stz Nod.Table.hPath,x
dex
bpl .2
ldx #K.PS.MAX*4-1
.3 stz PS.Table.PID,x
dex
bpl .3
ldx #K.OF.MAX*2-1
.4 stz OF.Table.hPath,x
dex
bpl .4
ldx #K.EVT.MAX*S.EVT-1
.5 stz Evt.Table,x
dex
bpl .5
stz Flt.Table
rts
*--------------------------------------
* Setup AuxLC $FFFE->Kernel IRQ Handler * Setup AuxLC $FFFE->Kernel IRQ Handler
* if irq not handled, jmp (S.IrqMgrOldFFFE) * if irq not handled, jmp (S.IrqMgrOldFFFE)
*-------------------------------------- *--------------------------------------
@ -1110,11 +1142,20 @@ FD.SYS .DA #S.FD.T.CDEV
.DA #0 HANDLER .DA #0 HANDLER
.DA #0 BUSID .DA #0 BUSID
.DA #DEVID.SYS .DA #DEVID.SYS
.DA 0 BUSPTR .DA $B800 BUSPTR
.DA DRV.SYS .DA DRV.SYS
.AZ "SYS" NAME .AZ "SYS" NAME
.HS 00000000 .HS 00000000
*-------------------------------------- *--------------------------------------
FD.TTY .DA #S.FD.T.CDEV
.DA #0 HANDLER
.DA #0 BUSID
.DA #DEVID.SYS DEVID
.DA $B800 BUSPTR
.DA DRV.SYS
.AZ "TTY0" NAME
.HS 000000
*--------------------------------------
FD.BDEV .DA #S.FD.T.BDEV FD.BDEV .DA #S.FD.T.BDEV
.DA #0 HANDLER .DA #0 HANDLER
.DA #0 BUSID .DA #0 BUSID