LOADDER:cleanup...

This commit is contained in:
Rémy GIBERT 2016-03-13 22:55:47 +01:00
parent 7b2c457def
commit d86b13c580
8 changed files with 323 additions and 191 deletions

View File

@ -1,4 +1,6 @@
PR#3
PREFIX /A2OSX.BOOT
DELETE A2OSX.SYSTEM
PREFIX /A2OSX.SRC
NEW
INC 1
@ -33,6 +35,7 @@ A2osX.GP.Start jmp (KERNEL.SYSCALL,x)
jmp A2osX.MLICALL1
*--------------------------------------
jmp A2osX.ROMCALL1
jmp BrkHandler
.BS $BE10-*
*--------------------------------------
jmp (pDev) pDevJmp
@ -123,11 +126,10 @@ A2osX.SaveA .BS 1
A2osX.SaveX .BS 1
A2osX.SaveY .BS 1
*--------------------------------------
BrkHandler sta SETPAGE2
bra *
*--------------------------------------
IrqHandler
IrqHandler bra *
*--------------------------------------
A2osX.GP.End .EQ *
*--------------------------------------

153
A2osX.S.KM.txt Normal file
View File

@ -0,0 +1,153 @@
PR#3
PREFIX /A2OSX.BOOT
DELETE A2OSX.SYSTEM
PREFIX /A2OSX.SRC
NEW
INC 1
AUTO 6
.LIST OFF
*--------------------------------------
EnumKM.EPB .EQ $0D
EnumKM.EL .EQ $27
*--------------------------------------
EnumKM ldx #0
ldy Boot.Prefix
.1 inx
lda SYS,x
sta Boot.Prefix+1,y
iny
cpx SYS
bne .1
sty Boot.Prefix
jsr MLI
.DA #MLIOPEN
.DA MLIOPEN01
bcs .99
lda MLIOPEN01+5
sta MLIREAD01+1
sta MLICLOSE01+1
.2 jsr MLI
.DA #MLIREAD
.DA MLIREAD01
bcs .98
lda #EnumKM.EPB
sta EnumKM.EC
>LDYAI A2osX.ReadBuff+4
>STYA EnumKM.BPTR
.3 >LDYA EnumKM.BPTR
>STYA TmpPtr1
lda (TmpPtr1)
and #$F0 Empty ?
beq .5 yes, skip
and #$C0 anything out of type 1,2 or 3 ?
bne .5 yes, skip
lda (TmpPtr1)
and #$0F
cmp KM.PREFIX at least enough chars for KM.*?
bcc .5 no, skip
ldy #$10 file type
lda (TmpPtr1),y
cmp #$06 'BIN'?
bne .5 skip
ldy KM.PREFIX
.4 lda (TmpPtr1),y
cmp KM.PREFIX,y
bne .5
dey
bne .4
jsr LoadKM
.5 lda EnumKM.BPTR
clc
adc #EnumKM.EL
sta EnumKM.BPTR
bcc .6
inc EnumKM.BPTR+1
.6 dec EnumKM.EC
bne .3
bra .2
.8 jsr MLI
.DA #MLICLOSE
.DA MLICLOSE01
rts
.98 cmp #MLI.ERR.EOF
beq .8
pha
jsr .8
pla
.99 sec
rts
*--------------------------------------
EnumKM.EC .BS 1
EnumKM.BPTR .BS 2
*--------------------------------------
LoadKM ldx Boot.Prefix
.1 lda Boot.Prefix,x
sta KM.Filename,x
dex
bne .1
ldx Boot.Prefix
lda (TmpPtr1)
and #$0F
tay
clc
adc Boot.Prefix
sta KM.Filename
tax
.2 lda (TmpPtr1),y
sta KM.Filename,x
dex
dey
bne .2
>LDAXI MSG.KMLOAD
jsr PrintCStrAX
>LDAXI KM.Filename
jsr PrintPStrAX
jsr CROUT
jsr MLI
.DA #MLIOPEN
.DA MLIOPEN02
bcs .99
lda MLIOPEN02+5
sta MLIREAD02+1
sta MLICLOSE02+1
jsr MLI
.DA #MLIREAD
.DA MLIREAD02
bcs .98
jsr .9
jsr A2osX.KMLOAD
jsr CROUT
.98 pha
jsr .9
pla
sec
rts
.9 jsr MLI
.DA #MLICLOSE
.DA MLICLOSE02
.99 rts
*--------------------------------------
MAN
SAVE A2OSX.S.KM
LOAD A2OSX.S
ASM

View File

@ -1,4 +1,6 @@
PR#3
PREFIX /A2OSX.BOOT
DELETE A2OSX.SYSTEM
PREFIX /A2OSX.SRC
NEW
INC 1

View File

@ -1,4 +1,6 @@
PR#3
PREFIX /A2OSX.BOOT
DELETE A2OSX.SYSTEM
PREFIX /A2OSX.SRC
NEW
INC 1
@ -27,15 +29,30 @@ PrintCStrAX >STAX TmpPtr1
sta TmpPtr2+1
ldy #0
.1 lda (TmpPtr1),y
.1 stz b0Flag
stz DigitCount
lda (TmpPtr1),y
beq .9
cmp #'%'
bne .4
iny
.11 iny
lda (TmpPtr1),y
beq .9
cmp #'d'
cmp #'0'
bne .22
ror b0Flag beq -> CS
bra .11
.22 bcc .21
cmp #'9'+1
bcs .21
and #$0f
sta DigitCount
bra .11
.21 cmp #'d'
bne .2
pla
jsr PrintADec
@ -101,41 +118,61 @@ PrintAXDec >STAX HEX
cld
stz bFlag
ldx #0
ldy #5
ldx #2
.4 lda BCD,x
lsr
lsr
lsr
lsr
bne .5
bit bFlag
bpl .6
.5 sec
ror bFlag
ora #$B0
jsr COUT
.6 lda BCD,x
pha
and #$0F
bne .7
bit bFlag
bpl .8
.7 sec
ror bFlag
ora #$B0
jsr COUT
.8 dex
sta DigitBuffer,y
dey
pla
lsr
lsr
lsr
lsr
ora #$B0
sta DigitBuffer,y
inx
dey
bpl .4
bit bFlag
bmi .9
lda #$B0
jsr COUT
lda DigitCount
beq .5
lda #6
sec
sbc DigitCount
.5 tay
.6 lda DigitBuffer,y
cmp #"0"
beq .7
sec
ror b0Flag
bra .8
.7 cpy #5
beq .8
lda #" "
bit b0Flag
bpl .81
lda #"0"
.8 jsr COUT
.81 iny
cpy #6
bne .6
.9 ply
rts
*--------------------------------------
HEX .BS 2
BCD .BS 3
b0Flag .BS 1
DigitCount .BS 1
DigitBuffer .BS 6
*--------------------------------------
MAN
SAVE A2OSX.S.TOOLS
LOAD A2OSX.S

View File

@ -83,7 +83,13 @@ A2osX.Init1 bit RROMBNK1
>LDAXI MSG.SYSMEM.OK
jsr PrintCStrAX
*--------------------------------------
A2osX.SetHZ lda #6
sta A2osX.HZ
pha push HZ
>LDAXI MSG.HZ
jsr PrintCStrAX
*--------------------------------------
>LDAXI MSG.CPU
jsr PrintCStrAX
jsr Init6502 Y = CPU type
@ -97,11 +103,79 @@ A2osX.Init1 bit RROMBNK1
jsr PrintCStrAX
lda A2osX.CPUTYPE
bne A2osX.Prefix
bne .1
>LDAXI MSG.CPU.KO
jsr PrintCStrAX
bra *
*--------------------------------------
.1 lda MACHID
and #MACHID.TYPE
cmp #MACHID.TYPE.IIc
beq A2osX.Prefix
>LDAXI MSG.CPU.SPEED
jsr PrintCStrAX
stz A2osX.RANDOM16
stz A2osX.RANDOM16+1
php
sei
.2 bit VBL
bpl .2
.21 bit VBL
bmi .21
ldx #0 Count LO
lda #0 Count HI
.3 ldy #3 (2)
.4 nop (2)
dey (2)
bne .4 (2*)
inc A2osX.RANDOM16 (6)
bne .5 (2*)
inc A2osX.RANDOM16+1 (6)
bit VBL (4)
bpl .3 (2*)
bmi .6
.5 nop (2)
nop (2)
nop (2)
bit VBL (4)
bpl .3 (2*)
.6 plp
stz A2osX.CPUSPEED
.7 sec
lda A2osX.RANDOM16
sbc #100
tax
lda A2osX.RANDOM16+1
sbc /100
bcc .8
stx A2osX.RANDOM16
sta A2osX.RANDOM16+1
inc A2osX.CPUSPEED
bra .7
.8 lda A2osX.RANDOM16
sta A2osX.CPUSPEED+1
pha push CPU speed LO
lda A2osX.CPUSPEED
pha push CPU speed HI
>LDAXI MSG.CPU.SPEEDOK
jsr PrintCStrAX
*--------------------------------------
A2osX.Prefix >LDAXI MSG.BOOTPREFIX
jsr PrintCStrAX
jsr MLI
@ -313,153 +387,18 @@ InitZ80 ldx #Z80Code.Size
sec
rts
*--------------------------------------
EnumKM.EPB .EQ $0D
EnumKM.EL .EQ $27
*--------------------------------------
EnumKM ldx #0
ldy Boot.Prefix
.1 inx
lda SYS,x
sta Boot.Prefix+1,y
iny
cpx SYS
bne .1
sty Boot.Prefix
jsr MLI
.DA #MLIOPEN
.DA MLIOPEN01
bcs .99
lda MLIOPEN01+5
sta MLIREAD01+1
sta MLICLOSE01+1
.2 jsr MLI
.DA #MLIREAD
.DA MLIREAD01
bcs .98
lda #EnumKM.EPB
sta EnumKM.EC
>LDYAI A2osX.ReadBuff+4
>STYA EnumKM.BPTR
.3 >LDYA EnumKM.BPTR
>STYA TmpPtr1
lda (TmpPtr1)
and #$F0 Empty ?
beq .5 yes, skip
and #$C0 anything out of type 1,2 or 3 ?
bne .5 yes, skip
lda (TmpPtr1)
and #$0F
cmp KM.PREFIX at least enough chars for KM.*?
bcc .5 no, skip
ldy #$10 file type
lda (TmpPtr1),y
cmp #$06 'BIN'?
bne .5 skip
ldy KM.PREFIX
.4 lda (TmpPtr1),y
cmp KM.PREFIX,y
bne .5
dey
bne .4
jsr LoadKM
.5 lda EnumKM.BPTR
clc
adc #EnumKM.EL
sta EnumKM.BPTR
bcc .6
inc EnumKM.BPTR+1
.6 dec EnumKM.EC
bne .3
bra .2
.8 jsr MLI
.DA #MLICLOSE
.DA MLICLOSE01
rts
.98 cmp #MLI.ERR.EOF
beq .8
pha
jsr .8
pla
.99 sec
rts
EnumKM.EC .BS 1
EnumKM.BPTR .BS 2
*--------------------------------------
LoadKM ldx Boot.Prefix
.1 lda Boot.Prefix,x
sta KM.Filename,x
dex
bne .1
ldx Boot.Prefix
lda (TmpPtr1)
and #$0F
tay
clc
adc Boot.Prefix
sta KM.Filename
tax
.2 lda (TmpPtr1),y
sta KM.Filename,x
dex
dey
bne .2
>LDAXI MSG.KMLOAD
jsr PrintCStrAX
>LDAXI KM.Filename
jsr PrintPStrAX
jsr CROUT
jsr MLI
.DA #MLIOPEN
.DA MLIOPEN02
bcs .99
lda MLIOPEN02+5
sta MLIREAD02+1
sta MLICLOSE02+1
jsr MLI
.DA #MLIREAD
.DA MLIREAD02
bcs .98
jsr .9
jsr A2osX.KMLOAD
jsr CROUT
.98 pha
jsr .9
pla
sec
rts
.9 jsr MLI
.DA #MLICLOSE
.DA MLICLOSE02
.99 rts
*--------------------------------------
.INB A2OSX.S.KM
.INB A2OSX.S.TOOLS
*--------------------------------------
MSG.STAGE0 >CSTRING "A2osX[Stage0]:Init\n"
MSG.SYSMEM >CSTRING "Checking System Memory..."
MSG.SYSMEM.OK >CSTRING "128k Detected.\n"
MSG.SYSMEM.KO >CSTRING "A2osX Requires At Least 128k Memory.\n"
MSG.HZ >CSTRING "Kernel SYS Timer Setup For %d0 hz.\n"
MSG.CPU >CSTRING "Checking CPU..."
MSG.CPU.KO >CSTRING "A2osX Requires At Least A 65C02 CPU.\n"
MSG.CPU.SPEED >CSTRING "Detecting CPU Speed..."
MSG.CPU.SPEEDOK >CSTRING "%d.%02d Mhz.\n"
MSG.BOOTPREFIX >CSTRING "Boot Prefix:"
MSG.RAMDRV >CSTRING "Checking ProDOS RamDrive..."
MSG.RAMDRV.OK >CSTRING "Successfully Disabled.\n"
@ -520,9 +459,6 @@ MLIQUIT01 .DA #4
*--------------------------------------
SYS >PSTRING "SYS/"
KM.PREFIX >PSTRING "KM."
HEX .BS 2
BCD .BS 3
bFlag .BS 1
*--------------------------------------
Z80Code.Start .HS 31FFFF START: LD SP,0FFFFH Init Stack
.HS 3EFF LD A,0FFH Set Flag

View File

@ -8,17 +8,18 @@ echo Env:
SET
# Main Screen
INSDRV CONSOLE.DRV
GETTY CON SBIN/LOGIN
STARTPROC GETTY CON SBIN/LOGIN
# Serial Login
INSDRV SSC.I.DRV 9600 N 8 1 X
GETTY COM2 SBIN/LOGIN
STARTPROC GETTY COM2 SBIN/LOGIN
#INSDRV PPIC.DRV
# Network Section
INSDRV UTHERNET.DRV 000E3A123456
INSDRV UTHERNET2.DRV 0008DC123456
INSDRV LANCEGS.DRV 000E3A123456
TCPIP
DHCPCLNT
INSDRV LANCEGS.DRV
STARTPROC TCPIP
STARTPROC DHCPCLNT
STARTPROC HTTPD
#TELNETD
#MOUNT TFTP 192.168.1.5:/A2OSX /MNT/A2OSX
#MOUNT CIFS 192.168.1.5:/MSSHARE /MNT/MSSHARE

View File

@ -47,13 +47,14 @@ OApple+1,OApple+2,OApple+3 to switch between screens : Kernel Log, text, DHGR.
| Name | Status | Comment |
| ---- | ------ | ------- |
| CD | Working | |
| SET | Working | |
| DATE | Working | |
| TIME | Working | |
| EXIT | Working | |
| TYPE | Working | |
| PAUSE | Working | |
| ECHO | Working | |
| EXIT | Working | |
| PAUSE | Working | |
| TIME | Working | |
| TYPE | Working | |
| SET | Working | |
| STARTPROC | NOT Working | |
## BIN,External Shell commands:
| Name | Status | Comment |
@ -68,10 +69,10 @@ OApple+1,OApple+2,OApple+3 to switch between screens : Kernel Log, text, DHGR.
| ARP | Working | |
| PING | Working | |
| DNSINFO | In Progress | |
| NETINFO | Working | |
| IPCONFIG | Working | renamed from NETINFO |
| NETSTAT | Working | |
| RPCINFO | In Progress | |
| EDIT | In Progress | BUG: DEL |
| RPCDUMP | In Progress | tool based on UDP socket API, renamed from RPCINFO |
| EDIT | Working | still missing : find/replace |
| NSCUTIL | Working | Tool for setting time in NSC/DL1216E |
| ASM | In Progress | S-C MASM based multi CPU assembler |

View File

@ -1,12 +1,12 @@
PR#3
PREFIX /A2OSX.SRC
NEW
INC 1
AUTO 6
PREFIX /A2OSX.BOOT
BLOAD A2OSX.SYSTEM
DELETE A2OSX.SYSTEM
BSAVE A2OSX.SYSTEM,TSYS,A$2000,L$1300
BSAVE A2OSX.SYSTEM,TSYS,A$2000,L4864
-A2OSX.SYSTEM
MAN
PREFIX /A2OSX.SRC
TEXT MAKESYS