Kernel 0.92

This commit is contained in:
Rémy GIBERT 2018-12-14 17:19:05 +01:00
parent 69ea50ba1a
commit e1011e4ae9
6 changed files with 175 additions and 134 deletions

View File

@ -5,8 +5,8 @@ AUTO 4,1
ECHO *** A2osX INIT Script *** ECHO *** A2osX INIT Script ***
SET PS1='$PWD' SET PS1='$PWD'
# Main Screen # Main Screen
INSDRV CONSOLE.DRV # INSDRV CONSOLE.DRV
STARTPROC GETTY /DEV/CON ${ROOT}SBIN/LOGIN # STARTPROC GETTY /DEV/CON ${ROOT}SBIN/LOGIN
# Serial Login # Serial Login
#INSDRV SSC.DRV 9600,N,8,1,X #INSDRV SSC.DRV 9600,N,8,1,X
#INSDRV SSC.I.DRV 9600,N,8,1,X #INSDRV SSC.I.DRV 9600,N,8,1,X

View File

@ -15,7 +15,7 @@ pDRV .EQ ZPKERNEL+10
pIOCTL .EQ ZPKERNEL+12 pIOCTL .EQ ZPKERNEL+12
pIOBuf .EQ ZPKERNEL+14 pIOBuf .EQ ZPKERNEL+14
*-------------------------------------- *--------------------------------------
SYS.BASL0 .EQ $800 SYS.BASL0 .EQ $400
*-------------------------------------- *--------------------------------------
* AuxMove / XFer * AuxMove / XFer
*-------------------------------------- *--------------------------------------

View File

@ -151,7 +151,6 @@ K.MKDev jsr MEM.SPtr1PPtr2 ptr1=fd, ptr2=name
.8 >LDYA ZPPtr2 .8 >LDYA ZPPtr2
jsr K.NewStr jsr K.NewStr
bcs .99 bcs .99
>DEBUG
txa txa
ldx DevMgr.DevCnt ldx DevMgr.DevCnt

View File

@ -117,7 +117,7 @@ Kernel.Init3 sta SETALTZP
bcs * bcs *
jsr PS0.Init jsr PS0.Init
bcs * bcs *
>LDYAI MSG.Init3 >LDYAI MSG.Init3
>SYSCALL puts >SYSCALL puts
@ -145,18 +145,18 @@ Kernel.Init3 sta SETALTZP
>LDYAI MSG.Prefix >LDYAI MSG.Prefix
>SYSCALL printf >SYSCALL printf
lda KBD * lda KBD
bpl .1 * bpl .1
sta KBDSTROBE * sta KBDSTROBE
cmp #$84 CTRL-D for Maintenace mode * cmp #146 CTRL-R for Maintenance mode
bne .1 * bne .1
>PUSHBI 0 >PUSHBI 0
>LDYAI MSG.CTRLD >LDYAI MSG.CTRLD
>SYSCALL printf >SYSCALL printf
>PUSHBI 0 PS Flags >PUSHBI 0 PS Flags
>LDYAI CTRLD.SHELL >LDYAI CTRLR.SHELL
bra .8 bra .8
.1 >PUSHWI ETCINIT.CMDLINE .1 >PUSHWI ETCINIT.CMDLINE
@ -338,54 +338,6 @@ SysScrInit jsr SysScrInit.EnvBuf
clc clc
.9 rts .9 rts
SysScrInit.OLD ldx #0
ldy #0
.2 lda SYSSCREEN.TOP,y
beq .3
cmp #$40
bcc .10
cmp #$5F
bcs .10
and #$3F
.10 sta SETWRITEAUX
sta SYS.BASL0,x
sta CLRWRITEAUX
iny
lda SYSSCREEN.TOP,y
beq .5
cmp #$40
bcc .11
cmp #$5F
bcs .11
and #$3F
.11 sta SYS.BASL0,x
iny
inx
bra .2
.3 lda #$20
.4 sta SETWRITEAUX
sta SYS.BASL0,x
sta CLRWRITEAUX
.5 lda #$20
sta SYS.BASL0,x
inx
cpx #40
bne .4
rts
*-------------------------------------- *--------------------------------------
SysScrInit.EnvBuf SysScrInit.EnvBuf
clc clc
@ -411,7 +363,7 @@ PS0.Init >LDYAI CORE.S.PS0 Select Process 0 (Kernel)
>PUSHWI 0 Aux type >PUSHWI 0 Aux type
>PUSHBI S.FI.T.TXT >PUSHBI S.FI.T.TXT
>PUSHBI O.RDWR >PUSHBI O.RDWR
>LDYAI DEV.CONSOLE >LDYAI DEV.CONSOLE
>SYSCALL fopen >SYSCALL fopen
bcs .9 bcs .9
@ -1107,8 +1059,7 @@ MSG.KCREAD.KO .AZ "\nError While Reading Kernel Config File, Using Default.\n"
MSG.Init2.OK .AZ "A2osX[Stage2]:Complete.\n" MSG.Init2.OK .AZ "A2osX[Stage2]:Complete.\n"
*-------------------------------------- *--------------------------------------
SYSSCREEN.TOP .AZ "A2osX 0.92 Console" SYSSCREEN.TOP .AZ "A2osX 0.92 Console"
MSG.Init3 .AS "A2osX[Stage3]:Init " MSG.Init3 .AZ "A2osX[Stage3]:Init *** Press Ctrl-R for ROOT Mode ***"
.AZ "*** Press Ctrl-D for Mantenance Mode ***"
MSG.DEV .AZ "Device Manager..." MSG.DEV .AZ "Device Manager..."
MSG.BLKDEV .AZ " Adding : /DEV/%s\r\n" MSG.BLKDEV .AZ " Adding : /DEV/%s\r\n"
MSG.IRQ .AZ "Interrupt Manager..." MSG.IRQ .AZ "Interrupt Manager..."
@ -1143,7 +1094,7 @@ I.ENV.ROOT .AZ "ROOT"
I.ENV.PATH .AZ "PATH=${ROOT}SBIN/:${ROOT}BIN/" I.ENV.PATH .AZ "PATH=${ROOT}SBIN/:${ROOT}BIN/"
I.ENV.LIB .AZ "LIB=${ROOT}LIB/" I.ENV.LIB .AZ "LIB=${ROOT}LIB/"
I.ENV.DRV .AZ "DRV=${ROOT}DRV/" I.ENV.DRV .AZ "DRV=${ROOT}DRV/"
CTRLD.SHELL .AZ "${ROOT}BIN/SHELL" CTRLR.SHELL .AZ "${ROOT}BIN/SHELL"
ETCINIT.CMDLINE .AZ "${ROOT}ETC/INIT" ETCINIT.CMDLINE .AZ "${ROOT}ETC/INIT"
*-------------------------------------- *--------------------------------------
MLIOPEN00 .DA #3 MLIOPEN00 .DA #3

View File

@ -4,37 +4,23 @@ AUTO 4,1
*-------------------------------------- *--------------------------------------
CURSOR.BLINK.SPEED .EQ 2 CURSOR.BLINK.SPEED .EQ 2
*-------------------------------------- *--------------------------------------
ZPIOCTL .EQ ZPDRV .DUMMY
ZPDCBPtr .EQ ZPDRV+2 .OR ZPDRV
ZPBufPtr .EQ ZPDRV+10 ZPIOCTL .BS 2
ZPCount .EQ ZPDRV+12 ZPDCBPtr .BS 2
ZPBufBaseL1 .EQ ZPDRV+14 ZPBufPtr .BS 2
ZPBufBaseL2 .EQ ZPDRV+16 ZPCount .BS 2
ZPScrBaseL1 .EQ ZPDRV+18 ZPBufBaseL1 .BS 2
ZPScrBaseL2 .EQ ZPDRV+20 ZPBufBaseL2 .BS 2
ZPTmpWord .EQ ZPDRV+22 ZPScrBaseL1 .BS 2
ZPTmpBool .EQ ZPDRV+24 ZPScrBaseL2 .BS 2
ZPTmpWord .BS 2
ZPTmpBool .BS 1
.ED
*-------------------------------------- *--------------------------------------
DRV.TERM cld DRV.TERM cld
>STYA pIOCTL jmp (.1,x)
.1 .DA DRV.TERM.STATUS
ldy #S.FD.DEV.DCBPTR
lda (pFD),y
sta ZPDCBPtr
iny
lda (pFD),y
sta ZPDCBPtr+1
ldy #S.DCB.TTY.DEVID
lda (ZPDCBPtr),y
cmp A2osX.ASCREEN
beq .1 CS
clc
.1 ror bActive
jmp (.8,x)
.8 .DA DRV.TERM.STATUS
.DA A2osX.BADCALL .DA A2osX.BADCALL
.DA A2osX.BADCALL .DA A2osX.BADCALL
.DA A2osX.BADCALL .DA A2osX.BADCALL
@ -45,12 +31,9 @@ DRV.TERM cld
.DA DRV.TERM.READ .DA DRV.TERM.READ
.DA DRV.TERM.WRITE .DA DRV.TERM.WRITE
*-------------------------------------- *--------------------------------------
DRV.TERM.STATUS ldy #S.IOCTL.BUFPTR DRV.TERM.STATUS >STYA ZPIOCTL
lda (ZPIOCTL),y
sta ZPBufPtr jsr GetIOCTLBuf
iny
lda (ZPIOCTL),y
sta ZPBufPtr+1
ldy #S.IOCTL.STATCODE ldy #S.IOCTL.STATCODE
lda (ZPIOCTL),y lda (ZPIOCTL),y
@ -68,6 +51,8 @@ DRV.TERM.STATUS ldy #S.IOCTL.BUFPTR
dey dey
bne .2 bne .2
jsr DRV.TERM.GetDCB
ldy #S.DCB.TTY.STATUS ldy #S.DCB.TTY.STATUS
lda (ZPDCBPtr),y lda (ZPDCBPtr),y
sta (ZPBufPtr) sta (ZPBufPtr)
@ -79,7 +64,7 @@ DRV.TERM.STATUS ldy #S.IOCTL.BUFPTR
sec sec
rts rts
*-------------------------------------- *--------------------------------------
DRV.TERM.OPEN ldx #0 DRV.TERM.OPEN ldx #0 DEV.ID in A
.1 ldy A2osX.SCRNDEVS,x .1 ldy A2osX.SCRNDEVS,x
beq .2 beq .2
@ -96,7 +81,11 @@ DRV.TERM.OPEN ldx #0
sec sec
rts rts
.2 sta A2osX.SCRNDEVS,x DEV.ID in A .2 pha DEV.ID in A
jsr DRV.TERM.GetDCB
pla
ldy #S.DCB.TTY.DEVID ldy #S.DCB.TTY.DEVID
sta (ZPDCBPtr),y sta (ZPDCBPtr),y
@ -114,14 +103,20 @@ DRV.TERM.OPEN ldx #0
DRV.TERM.CONTROL DRV.TERM.CONTROL
sta SETTEXT sta SETTEXT
jsr DRV.TERM.GetDCB
ldy #S.DCB.TTY.DEVID ldy #S.DCB.TTY.DEVID
lda (ZPDCBPtr),y lda (ZPDCBPtr),y
sta A2osX.ASCREEN sta A2osX.ASCREEN
jsr DRV.TERM.SCRCPY
clc clc
rts rts
*-------------------------------------- *--------------------------------------
DRV.TERM.CLOSE ldy #S.DCB.TTY.STATUS DRV.TERM.CLOSE jsr DRV.TERM.GetDCB
ldy #S.DCB.TTY.STATUS
lda (ZPDCBPtr),y lda (ZPDCBPtr),y
bit #S.DIB.S.OPENED bit #S.DIB.S.OPENED
beq .9 beq .9
@ -145,13 +140,21 @@ DRV.TERM.CLOSE ldy #S.DCB.TTY.STATUS
clc clc
rts rts
.9 lda MLI.E.IO .9 lda #MLI.E.IO
sec sec
rts rts
*-------------------------------------- *--------------------------------------
DRV.TERM.READ bit bActive is screen active? DRV.TERM.READ >STYA ZPIOCTL
bpl .6 no....go check flush...
jsr GetIOCTLBufAndCnt
jsr DRV.TERM.GetDCB
jsr DRV.TERM.GetActive
bit bActive is screen active?
bpl .6 no....go check flush...
lda A2osX.TIMER16 lda A2osX.TIMER16
and #CURSOR.BLINK.SPEED and #CURSOR.BLINK.SPEED
ldy #S.DCB.TTY.bCURON ldy #S.DCB.TTY.bCURON
@ -194,7 +197,7 @@ DRV.TERM.READ bit bActive is screen active?
beq .9 no char in output buffer... beq .9 no char in output buffer...
.7 stz .8+1 .7 stz .8+1
jsr GetPtrsAndCnt jsr GetIOCTLBufAndCnt
.70 inc ZPCount .70 inc ZPCount
bne .71 bne .71
@ -224,7 +227,13 @@ DRV.TERM.READ bit bActive is screen active?
sec sec
rts rts
*-------------------------------------- *--------------------------------------
DRV.TERM.WRITE jsr GetPtrsAndCnt DRV.TERM.WRITE >STYA ZPIOCTL
jsr GetIOCTLBufAndCnt
jsr DRV.TERM.GetDCB
jsr DRV.TERM.GetActive
.1 inc ZPCount .1 inc ZPCount
bne .2 bne .2
@ -639,7 +648,7 @@ RESET jsr RESET.MODE
lda #23 lda #23
sta (ZPDCBPtr),y sta (ZPDCBPtr),y
jsr CLRSCR jsr DRV.TERM.CLRSCR
*-------------------------------------- *--------------------------------------
RESETATTR lda #$80 RESETATTR lda #$80
ldy #S.DCB.TTY.bINVERSE ldy #S.DCB.TTY.bINVERSE
@ -650,7 +659,7 @@ RESETATTR lda #$80
J.CtrlChars .DA ENQ 5 J.CtrlChars .DA ENQ 5
.DA BS 8 .DA BS 8
.DA LF 10 .DA LF 10
.DA CLRSCR 12 .DA DRV.TERM.CLRSCR 12
.DA CROUT 13 .DA CROUT 13
.DA FS 21 .DA FS 21
.DA ESC 27 .DA ESC 27
@ -1089,15 +1098,26 @@ Char.Out.Get ldy #S.DCB.TTY.OUTHEAD
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
GetPtrsAndCnt ldy #S.IOCTL.BUFPTR DRV.TERM.GetDCB ldy #S.FD.DEV.DCBPTR
lda (ZPIOCTL),y lda (pFD),y
sta ZPBufPtr sta ZPDCBPtr
iny
lda (ZPIOCTL),y
sta ZPBufPtr+1
* ldy #S.IOCTL.BYTECNT
iny iny
lda (pFD),y
sta ZPDCBPtr+1
rts
*--------------------------------------
DRV.TERM.GetActive
ldy #S.DCB.TTY.DEVID
lda (ZPDCBPtr),y
cmp A2osX.ASCREEN
beq .1 CS
clc
.1 ror bActive
rts
*--------------------------------------
GetIOCTLBufAndCnt
ldy #S.IOCTL.BYTECNT
lda (ZPIOCTL),y lda (ZPIOCTL),y
eor #$ff eor #$ff
@ -1106,17 +1126,25 @@ GetPtrsAndCnt ldy #S.IOCTL.BUFPTR
lda (ZPIOCTL),y lda (ZPIOCTL),y
eor #$ff eor #$ff
sta ZPCount+1 sta ZPCount+1
GetIOCTLBuf ldy #S.IOCTL.BUFPTR
lda (ZPIOCTL),y
sta ZPBufPtr
iny
lda (ZPIOCTL),y
sta ZPBufPtr+1
rts rts
*-------------------------------------- *--------------------------------------
SETUP.L1X clc SETUP.L1X clc
ldy #S.FD.DEV.BUFPTR ldy #S.FD.DEV.BUFPTR
lda SCR.BASEL,x lda BUF.BASEL,x
adc (pFD),y adc (pFD),y
sta ZPBufBaseL1 sta ZPBufBaseL1
iny iny
lda SCR.BASEH,x lda BUF.BASEH,x
adc (pFD),y adc (pFD),y
sta ZPBufBaseL1+1 sta ZPBufBaseL1+1
@ -1129,8 +1157,6 @@ SETUP.L1X clc
sta ZPScrBaseL1+1 sta ZPScrBaseL1+1
.8 rts .8 rts
*-------------------------------------- *--------------------------------------
DRV.CS.END
*--------------------------------------
SCR.BASEL .HS 00.80.00.80.00.80.00.80.28.A8.28.A8.28.A8.28.A8.50.D0.50.D0.50.D0.50.D0 SCR.BASEL .HS 00.80.00.80.00.80.00.80.28.A8.28.A8.28.A8.28.A8.50.D0.50.D0.50.D0.50.D0
SCR.BASEH .HS 04.04.05.05.06.06.07.07.04.04.05.05.06.06.07.07.04.04.05.05.06.06.07.07 SCR.BASEH .HS 04.04.05.05.06.06.07.07.04.04.05.05.06.06.07.07.04.04.05.05.06.06.07.07
*-------------------------------------- *--------------------------------------

View File

@ -2,7 +2,7 @@ NEW
PREFIX PREFIX
AUTO 4,1 AUTO 4,1
*-------------------------------------- *--------------------------------------
ClrScr ldx #23 DRV.TERM.CLRSCR ldx #23
.1 jsr SETUP.L1X .1 jsr SETUP.L1X
@ -35,6 +35,8 @@ ClrScr ldx #23
dey dey
bpl .5 bpl .5
sta CLRWRITEAUX
dex dex
bpl .1 bpl .1
@ -45,6 +47,60 @@ ClrScr ldx #23
sta (ZPDCBPtr),y sta (ZPDCBPtr),y
rts rts
*-------------------------------------- *--------------------------------------
DRV.TERM.SCRCPY ldx #0
.1 ldy #S.FD.DEV.BUFPTR
lda (pFD),y
clc
adc BUF.BASEL,x
sta .2+1
sta .3+1
iny
lda (pFD),y
adc BUF.BASEH,x
sta .2+2
sta .3+2
lda SCR.BASEL,x
sta ZPScrBaseL1
lda SCR.BASEH,x
sta ZPScrBaseL1+1
phx
sta SETREADAUX
ldx #79
ldy #39
sta SETPAGE2
.2 lda $ffff,x SELF MODIFIED
sta (ZPScrBaseL1),y
dex
dex
dey
bpl .2
ldx #78
ldy #39
sta CLRPAGE2
.3 lda $ffff,x SELF MODIFIED
sta (ZPScrBaseL1),y
dex
dex
dey
bpl .3
sta CLRREADAUX
plx
inx
cpx #24
bne .1
rts
*--------------------------------------
SetCharAtCurPos pha SetCharAtCurPos pha
ldy #S.DCB.TTY.CV ldy #S.DCB.TTY.CV
lda (ZPDCBPtr),y lda (ZPDCBPtr),y
@ -55,26 +111,37 @@ SetCharAtCurPos pha
pla pla
*-------------------------------------- *--------------------------------------
SetCharAtYX cmp #$40 SetCharAtYX cmp #$40
bcc .10 bcc .1
cmp #$5F cmp #$5F
bcs .10 bcs .1
and #$3F and #$3F
.10 pha .1 pha
phy phy
jsr SETUP.L1X jsr SETUP.L1X
ply
pla pla
sta SETWRITEAUX
sta (ZPBufBaseL1),y
sta CLRWRITEAUX
bit bActive
bpl .8
pha
tya
lsr lsr
tay tay
pla pla
bcs .1 bcs .2
sta SETPAGE2 sta SETPAGE2
.1 sta (ZPScrBaseL1),y .2 sta (ZPScrBaseL1),y
sta CLRPAGE2 sta CLRPAGE2
rts .8 rts
*-------------------------------------- *--------------------------------------
GetCharAtCurPos ldy #S.DCB.TTY.CV GetCharAtCurPos ldy #S.DCB.TTY.CV
lda (ZPDCBPtr),y lda (ZPDCBPtr),y
@ -84,14 +151,12 @@ GetCharAtCurPos ldy #S.DCB.TTY.CV
ldy #S.DCB.TTY.CH ldy #S.DCB.TTY.CH
lda (ZPDCBPtr),y lda (ZPDCBPtr),y
lsr
tay tay
bcs .1 sta SETREADAUX
lda (ZPBufBaseL1),y
sta SETPAGE2 sta CLRREADAUX
.1 lda (ZPScrBaseL1),y
sta CLRPAGE2
rts rts
*-------------------------------------- *--------------------------------------
COPY.XtoL1 ldy #79 COPY.XtoL1 ldy #79