# HG changeset patch # User afra # Date 1136384425 0 # Node ID 4b599621c682574114ceeb54709c3765dc368df2 # Parent bb1b40b486e975bd59c4d34ac9d36efa97c9ca6f Moved to using new boot_common/hardware dependent boot system diff -r bb1b40b486e9 -r 4b599621c682 level1/modules/boot_d64.asm --- a/level1/modules/boot_d64.asm Wed Jan 04 14:19:36 2006 +0000 +++ b/level1/modules/boot_d64.asm Wed Jan 04 14:20:25 2006 +0000 @@ -19,22 +19,25 @@ * Added NMI enable/disable code, as I know know how to enable/disable * NMI on the Alpha, having disasembled the Alpha's OS9's ddisk. * -* * 2005-10-22, P.Harvey-Smith. * Removed unused user stack variable (u0000). * +* 2005-12-31, P.Harvey-Smith. +* Converted to using new boot system which can support fragmented +* boot files. +* - nam Boot - ttl os9 system module + nam Boot + ttl os9 system module * Disassembled 1900/00/00 00:05:56 by Disasm v1.5 (C) 1988 by RML - ifp1 - use defsfile.dragon - endc + ifp1 + use defsfile.dragon + endc - IFNE DragonAlpha + IFNE DragonAlpha * Dragon Alpha has a third PIA at FF24, this is used for * Drive select / motor control, and provides FIRQ from the @@ -68,6 +71,13 @@ SDensEn EQU SDensEnA MotorOn EQU MotorOnA +; Drive selects for non default boot drives. + +DRVSEL0 EQU Drive0A +DRVSEL1 EQU Drive1A +DRVSEL2 EQU Drive2A +DRVSEL3 EQU Drive3A + ELSE DPPIADA EQU DPPIA1DA @@ -98,8 +108,28 @@ SDensEn EQU SDensEnD MotorOn EQU MotorOnD + +; Drive selects for non default boot drives. + +DRVSEL0 EQU Drive0D +DRVSEL1 EQU Drive1D +DRVSEL2 EQU Drive2D +DRVSEL3 EQU Drive3D + ENDC +* Default Boot is from drive 0 +BootDr set DRVSEL0 + IFEQ DNum-1 +BootDr set DRVSEL1 Alternate boot from drive 1 + ENDC + IFEQ DNum-2 +BootDr set DRVSEL2 Alternate boot from drive 2 + ENDC + IFEQ DNum-3 +BootDr set DRVSEL3 Alternate boot from drive 3 + ENDC + StepRate EQU %00000011 tylg set Systm+Objct @@ -107,34 +137,51 @@ rev set $01 mod eom,name,tylg,atrv,start,size -BuffPtr rmb 2 -SideSel rmb 1 ; Side select mask +;BuffPtr rmb 2 +;SideSel rmb 1 ; Side select mask +;CurrentTrack rmb 1 ; Current track number + +* NOTE: these are U-stack offsets, not DP +seglist rmb 2 pointer to segment list +blockloc rmb 2 pointer to memory requested +blockimg rmb 2 duplicate of the above +bootsize rmb 2 size in bytes +LSN0Ptr rmb 2 In memory LSN0 pointer +drvsel rmb 1 CurrentTrack rmb 1 ; Current track number +* Note, for optimization purposes, the following two variables +* should be adjacent!! +ddtks rmb 1 no. of sectors per track +ddfmt rmb 1 +side rmb 1 side 2 flag + size equ . name equ * fcs /Boot/ fcb $00 - +* Common booter-required defines +LSN24BIT equ 0 +FLOPPY equ 1 -start equ * +;start equ * - clra +HWInit clra - ldb #size -L0015 pshs a ; Clear size bytes on system stack - decb - bne L0015 +; ldb #size +;L0015 pshs a ; Clear size bytes on system stack +; decb +; bne L0015 - tfr s,u ; Point u to data area on s stack. +; tfr s,u ; Point u to data area on s stack. ldx #CMDREG ; Force inturrupt lda #FrcInt sta ,x lbsr Delay ; Wait for command to complete lda ,x - lda >piadb ; Clear DRQ from WD. + lda piadb ; Clear DRQ from WD. IFNE DragonAlpha lda #NMICA2Dis ; Set PIA2 CA2 as output & disable NMI @@ -149,6 +196,9 @@ sta >D.XNMI lda #MotorOn ; Turn on motor + ora WhichDrv,pcr ; OR in selected drive + sta drvsel,u ; save drive selection byte + IFNE DragonAlpha lbsr AlphaDskCtl ELSE @@ -161,63 +211,69 @@ nop subd #$0001 bne MotorOnDelay - - pshs u,x,b,a - clra - clrb - ldy #$0001 - ldx SideSel,U ; mask in side select +; orb >SideSel,U ; mask in side select + orb side,u ; mask in side select stb SideSel,U ; Single sided, make sure sidesel set correctly +; stb >SideSel,U ; Set side + stb side,U ; Set side puls b ; Get sector number incb - stb >SECREG + stb SECREG ldb CurrentTrack,u - stb >TRKREG + stb TRKREG cmpa CurrentTrack,u beq L0158 sta CurrentTrack,u - sta >DATAREG + sta DATAREG ldb #SeekCmnd+3 ; Seek command+ step rate code $13 bsr CommandWaitReady pshs x @@ -410,8 +483,9 @@ rts MotorOnCmdB - lda #MotorOn ; Turn on motor - +; lda #MotorOn ; Turn on motor + lda drvsel,u ; Turn on motor + IFNE DragonAlpha bsr AlphaDskCtl ELSE @@ -443,7 +517,7 @@ ADrvTab FCB Drive0A,Drive1A,Drive2A,Drive3A AlphaDskCtl - PSHS x,A,B,CC + PSHS X,A,B,CC ; ldb PIA2CRA ; Get control reg ; bita #NMIEnA ; NMI enable flag set ? @@ -460,13 +534,13 @@ ; stb PIA2CRA ; Save back in ctrl reg PSHS A - anda #DDosDriveMask ; mask out dragondos format drive number - leax ADrvTab,pcr ; point at table - lda a,x ; get bitmap - ldb ,s - andb #AlphaCtrlMask ; mask out drive number bits - stb ,s - ora ,s ; recombine drive no & ctrl bits +; anda #DDosDriveMask ; mask out dragondos format drive number +; leax ADrvTab,pcr ; point at table +; lda a,x ; get bitmap +; ldb ,s +; andb #AlphaCtrlMask ; mask out drive number bits +; stb ,s +; ora ,s ; recombine drive no & ctrl bits ; sta ,s bita #MotorOn ; test motor on ? @@ -479,25 +553,35 @@ orcc #$50 ; disable inturrupts + ldx #PIA2DA lda #AYIOREG ; AY-8912 IO register - sta PIA2DB ; Output to PIA +; sta PIA2DB ; Output to PIA + sta 2,X ; Output to PIA ldb #AYREGLatch ; Latch register to modify - stb PIA2DA - - clr PIA2DA ; Idle AY +; stb PIA2DA + stb ,x +; clr PIA2DA ; Idle AY + clr ,x ; Idle AY + lda ,s+ ; Fetch saved Drive Selects etc - sta PIA2DB ; output to PIA +; sta PIA2DB ; output to PIA + sta 2,x ; output to PIA ldb #AYWriteReg ; Write value to latched register - stb PIA2DA ; Set register - - clr PIA2DA ; Idle AY - +; stb PIA2DA ; Set register + stb ,x + +; clr PIA2DA ; Idle AY + clr ,x + PULS x,A,B,CC RTS ENDC +Address fdb DPort +WhichDrv fcb BootDr + emod eom equ * end