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 ***
SET PS1='$PWD'
# Main Screen
INSDRV CONSOLE.DRV
STARTPROC GETTY /DEV/CON ${ROOT}SBIN/LOGIN
# INSDRV CONSOLE.DRV
# STARTPROC GETTY /DEV/CON ${ROOT}SBIN/LOGIN
# Serial Login
#INSDRV SSC.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
pIOBuf .EQ ZPKERNEL+14
*--------------------------------------
SYS.BASL0 .EQ $800
SYS.BASL0 .EQ $400
*--------------------------------------
* AuxMove / XFer
*--------------------------------------

View File

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

View File

@ -145,18 +145,18 @@ Kernel.Init3 sta SETALTZP
>LDYAI MSG.Prefix
>SYSCALL printf
lda KBD
bpl .1
sta KBDSTROBE
cmp #$84 CTRL-D for Maintenace mode
bne .1
* lda KBD
* bpl .1
* sta KBDSTROBE
* cmp #146 CTRL-R for Maintenance mode
* bne .1
>PUSHBI 0
>LDYAI MSG.CTRLD
>SYSCALL printf
>PUSHBI 0 PS Flags
>LDYAI CTRLD.SHELL
>LDYAI CTRLR.SHELL
bra .8
.1 >PUSHWI ETCINIT.CMDLINE
@ -338,54 +338,6 @@ SysScrInit jsr SysScrInit.EnvBuf
clc
.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
clc
@ -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"
*--------------------------------------
SYSSCREEN.TOP .AZ "A2osX 0.92 Console"
MSG.Init3 .AS "A2osX[Stage3]:Init "
.AZ "*** Press Ctrl-D for Mantenance Mode ***"
MSG.Init3 .AZ "A2osX[Stage3]:Init *** Press Ctrl-R for ROOT Mode ***"
MSG.DEV .AZ "Device Manager..."
MSG.BLKDEV .AZ " Adding : /DEV/%s\r\n"
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.LIB .AZ "LIB=${ROOT}LIB/"
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"
*--------------------------------------
MLIOPEN00 .DA #3

View File

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