From 8164d94cf83b58e0055ce02a9e3c0acf650d7272 Mon Sep 17 00:00:00 2001 From: Elliot Nunn Date: Sun, 29 Apr 2018 00:24:33 +0800 Subject: [PATCH] basing classic on shaky master branch --- BuildResults/RISC/Obj/StartInterstix.c.o | Bin 27946 -> 11928 bytes Make/RISC.make | 3 - OS/StartMgr/Boot1.a | 220 +++++------ OS/StartMgr/StartInit.a | 483 ++++++----------------- OS/StartMgr/StartMgr.make | 5 + OS/StartMgr/StartSearch.a | 200 +++++----- OS/SysUtil.a | 6 +- 7 files changed, 324 insertions(+), 593 deletions(-) diff --git a/BuildResults/RISC/Obj/StartInterstix.c.o b/BuildResults/RISC/Obj/StartInterstix.c.o index 26120f9121eff1cf529712d0d2f8f52000449470..22394480e42db6b8775d7f56f6b1040e24e4b24e 100644 GIT binary patch delta 2268 zcmZuzTWl0n7(O%G?M|1r%d%y=yQS^Wu7uv`+;(S%7TTHFSu8h8w;)=v0b7$Q6vHj@ z#GCQKMCoq~@xd5lBGCtI0aF8VZ#A{Z=lCzL^;GKWBDltD!G@X1?=(|NnpI z`{(rY3*3=y@0ksfBz1~%&e7V$3PKi;6BQe_PfU^k;drpBhGBJkGAX;#sG|%PhKHQN z7sL_Si;*-10GSljsGRUvZe=X zUgx+UeEzmbOweq~pV9v-P`{VMr8xpx4zr`gLBr~Br^;tFtN0Ta_HQ{oyF+?q&B4?&j_1u~1MCuowI}2|# z#uphzRf2@cSwi?UZfPRt@OAw<@9jB!TY+!u$ZX9TclcRrV{W}$73{c9B&-q z{$$F2)SHCaOig$M4NSE)shj4FLrkD;HIPen@LQ&i9owbiv3-okb`%oorxkcky$I{{ z#Q3=qZ#^1))Uk$g_T~b*-n1ycWn1(V!sWw*XjhluQl%}!fbZl~2#16|z|T^H;82~d ztOHR5Y>hr-V4>U~SZtFf(TFyag{#zagRWH?K}9vB8j<~V7%Ws_p;^W$d7K&gVCLal zxgnIvdh2V*uTe_VWfiq+G@0qr5ueYmX+FO~2h4O_tTPVVl#Wfz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`+sNb_>+mEye6sD6s4k7XCrFszxNtiCNSyt9On6dNi)hjnhw1t z3F!ZT86^o#`j2L`agi>$1!wfu*o<-~WTi}4hHHx&yU*AX)$zDgz zP(WK_BNkrujr>rn3gC7EKwk|tHX%x`zR^ihatQ!j7Z=9xN^vMcp@P>XQIl!OsD@YX zxdO{y9RXg8U}FNW?V~RWo(V*9H?N=m%{RAY)s55^P=SBc#R$BFT{gv z2mTj)#moO2@x9-E-dKX~{S~c9jX2L6caCuC?J_MSUEAr1+Zfzq(Kpq5p6 z$I5H*ZEM@dS#y1^*RxwTZUidD;J&_~#J7p^u(Tj7Void>_#@GP#PWg>^85CS z9{(1$d?2zHhpqZKdZT;rLqJ%MtdOv&gx`V*1BlSBs!+UW3<=%nep(uVj2S@It z=n%C_^AT4ww;uFW&bb_F2ynC^%#oIjWq@x^hYD2dO1Fgh?2jPGeheCc&Y z^wkC6<~6uXCnXWL%!9BEI}Lwka2Ylj>I@|Yqwq)Jg78b>RpC2AQ1A#}6U>5u*xvWq z|7K6IF~se!M{EXop5;1cKD+P_?}knIf3oad$NvP+v)c8a9ckY~5a3&z={RovDJXoC z6^Ns(u>A?-l{*RuE@7p@l~6j?$NZaB*gF}~mi8^(9oQ@Csc)nZefosDL|oNPFA!7y z?$&Z)xjFs~ maxBootCodeSize then - aerror &concat('boot blocks donΥt fit: ', \ - &i2s(bootBlocksSoFar),' bytes; ', \ - 'maximum ',&i2s(maxBootCodeSize),' bytes') - else - dcb.b bootBlocksSize-bootBlocksSoFar,$DA - endif +; if bootBlocksSoFar > maxBootCodeSize then +; aerror &concat('boot blocks donΥt fit: ', \ +; &i2s(bootBlocksSoFar),' bytes; ', \ +; 'maximum ',&i2s(maxBootCodeSize),' bytes') +; else +; dcb.b bootBlocksSize-bootBlocksSoFar,$DA +; endif ; ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡ diff --git a/OS/StartMgr/StartInit.a b/OS/StartMgr/StartInit.a index 2caa756..55d9e05 100644 --- a/OS/StartMgr/StartInit.a +++ b/OS/StartMgr/StartInit.a @@ -1387,7 +1387,6 @@ getHInfo move.l a6,-(sp) ; save regs LEA SysCom,A0 ; A0 <- pointer to start of system globals @cont ; ENDIF LEA HeapStart,A1 ; A1 <- pointer to end of system globals. - BSR FillWithOnes ; Fill system globals with ones. BSR.L InitRomVectors ; initialize ROM vectorization @@ -1418,7 +1417,13 @@ getHInfo move.l a6,-(sp) ; save regs bsr SetupHWBases ; setup the hardware base address low mems - BSR InitSCC ; init the SCC + JSR * ; init the SCC? + movem.l D0-D7/A0-A5, -(sp) + move.l #$1D4, -(sp) + move.l #$00010800, d0 + dc.w $FE22 + addq.l #4, sp + movem.l (sp)+, D0-D7/A0-A5 bsr.l InitMMUGlobals ; set up MMU globals @@ -1491,19 +1496,24 @@ BootRetry MOVE #$2700,SR ; disable interrupts Move.l #emRecSize,(a0) ; size ENDWITH ; - IMPORT InterC_1cc0_MoveUnivInfoToSysHeap - BSR.L InterC_1cc0_MoveUnivInfoToSysHeap +; IMPORT InterC_1cc0_MoveUnivInfoToSysHeap +; BSR.L InterC_1cc0_MoveUnivInfoToSysHeap + nop + nop + nop BSR.L initGestalt ; initialize Gestalt BSR.L CreateAltiVecBufForEmulator BSR.L InitIntHandler ; initialize interrupt vectors and dispatch tables - BSR CheckForEgretOrCuda ; Do we have an Egret/Caboose/Cuda? - BNE.S @EInitDone ; -> Nope, don't be callin' shit - BSR.L InitEgretOrCuda ; Initialize Egret or Cuda Manager + nop + nop +; BSR CheckForEgretOrCuda ; Do we have an Egret/Caboose/Cuda? +; BNE.S @EInitDone ; -> Nope, don't be callin' shit +; BSR.L InitEgretOrCuda ; Initialize Egret or Cuda Manager - IMPORT GestaltCudaFunc - BSR.L GestaltCudaFunc -@EInitDone +; IMPORT GestaltCudaFunc +; BSR.L GestaltCudaFunc +;@EInitDone ************************************************************************************************* @@ -1555,10 +1565,6 @@ BootRetry MOVE #$2700,SR ; disable interrupts SUBA.W #BootStackSize,A0 _SetApplLimit - IMPORT InterC_2560 - BSR InterC_2560 - - CLR.L -(SP) ; who wrote this? MOVE.L (SP)+, ($D18) MOVE.L ToolScratch, -(SP) @@ -1568,15 +1574,11 @@ BootRetry MOVE #$2700,SR ; disable interrupts IMPORT InterC_2090_PowerMgr BSR InterC_2090_PowerMgr - IMPORT InterC_2a80_EtherPrintfLib - BSR.L InterC_2a80_EtherPrintfLib MOVE.L (SP)+, ToolScratch BSR GetPRAM ; get 20 bytes PRAM, and TIME - BSR InitSlots ; inits slot cards, grays the screen(s) - BSR.L InitDTQueue ; initialize the Deferred Task Manager Queue BSR.L EnableOneSecInts ; allow the clock interrupts @@ -1588,12 +1590,6 @@ BootRetry MOVE #$2700,SR ; disable interrupts MOVE #$2000,SR ; supervisor state, interrupts on - IMPORT RSETKMAP - BSR.L RSETKMAP - - IMPORT InterC_2bc0_DebugPrint - BSR.L InterC_2bc0_DebugPrint - MOVEQ.L #10, D0 _NewHandle ,Sys,Immed MOVE.L A0, D0 @@ -1626,15 +1622,8 @@ BootRetry MOVE #$2700,SR ; disable interrupts IMPORT InitDeviceDispatch BSR.L InitDeviceDispatch - BTST.B #$6, ($2400) - BNE.B @definitely - BTst.B #$0, ($DD0) - BEQ.B @dont -@definitely - BSR SetScsiIdFromPram ; taken from SCSIMgrInit.a BSR.L InitSCSIMgr ; Init old and new SCSI Mgrs -@dont IMPORT InitExpansionMgr BSR.L InitExpansionMgr @@ -1687,6 +1676,9 @@ BootRetry MOVE #$2700,SR ; disable interrupts IF hasPwrControls THEN BSR.L PowerDownAll ; power down all peripheral subsystems ENDIF + nop + nop + nop BSR DrawBeepScreen ; Horst BeepmanhΥs patented gray screen @@ -1697,12 +1689,6 @@ BootRetry MOVE #$2700,SR ; disable interrupts ; place where StarTest can see it w/o an MMU - - - import InterC_2780_FireWire - bsr.l InterC_2780_FireWire - - ;---------------------------------------------------------------- ; Initialize the File System. ;---------------------------------------------------------------- @@ -1716,31 +1702,37 @@ BootRetry MOVE #$2700,SR ; disable interrupts ;---------------------------------------------------------------- ; 3b6 - BTST #$1, $2409 - BEQ.B @dont_do_mysterious_thing - IMPORT LoadPCCardLib - BSR.L LoadPCCardLib -@dont_do_mysterious_thing +; IMPORT InterC_2a20_SCSITargetMode +; BSR.L InterC_2a20_SCSITargetMode + nop + nop + nop - IMPORT InterC_2a20_SCSITargetMode - BSR.L InterC_2a20_SCSITargetMode - BTst.B #5, $2408 - BEQ.B @nodiskmode - BSR.L SCSIDiskMode ; check if we should be in SCSI Disk Mode -@nodiskmode - BSR.L INITSCSIBOOT ; allocate some memory for SCSI booting - ; and load third party SIMs (SCSI Interface - ; modules + movem.l d0-d7/a0-a4, -(sp) + clr.l -(sp) + clr.l -(sp) + move.l #$00020700, d0 + dc.w $FE22 + addq #8, sp + movem.l (sp)+, d0-d7/a0-a4 - IMPORT ATAMgr_5dae0 - BSR.L ATAMgr_5dae0 - IMPORT ATAMgr_5dde0 - BSR.L ATAMgr_5dde0 - IMPORT InterC_2130_CardBus - BSR InterC_2130_CardBus + movem.l d0-d7/a0-a4, -(sp) + jsr * + movem.l (sp)+, d0-d7/a0-a4 + + movem.l d0-d7/a0-a4, -(sp) + jsr * + movem.l (sp)+, d0-d7/a0-a4 + + movem.l d0-d7/a0-a4, -(sp) + jsr * + movem.l (sp)+, d0-d7/a0-a4 + + bsr * + 1000 + ************************************************************************************************* @@ -1877,225 +1869,11 @@ WhichBoard swap d7 ; get CPU type in hi word ;________________________________________________________________________________________ SetUpTimeK - MoveM.L D1-D2/A1-A4, -(A7) - Move SR, -(A7) - OrI #$700, SR - Move.L ($64), -(A7) - BTst.B #$6, ($2400) - BNE.B L8 - BTst.B #$1, ($2400) - BNE L12 - Bra L13 -L8: MoveQ.L #$0, D0 - Move ([$68FFEFD0.L],$80), D0 - - MoveM.L D0-D2/A0, -(A7) - MoveA.L ([$68FFEFD0.L],$18), A0 - - Tst.L A0 - BNE.B L10 - MoveA.L ([$68FFEFF0.L],$100), A0 - - Move.L #$80000000, D1 - CmpI.L #$1F, D0 - BGT.B L9 - ROR.L D0, D1 - Or.L D1, $14(A0) - Nop - Bra L11 -L9: SubI.L #$20, D0 - ROR.L D0, D1 - Or.L D1, $4(A0) - Nop - Bra L11 -L10: AddA.L #$10000, A0 - LsL.L #$5, D0 - Move.L $0(A0,D0.W), D1 - BClr.L #$7, D1 - Move.L D1, $0(A0,D0.W) - Nop -L11: MoveM.L (A7)+, D0-D2/A0 - Bra.B L13 -L12: MoveA.L ($DD8), A0 - AddA.L (A0), A0 - MoveA.L $E4(A0), A0 - OrI.L #$400, $24(A0) - -L13: MoveA.L ($1D4), A1 - BClr.B #$5, $1600(A1) - Nop - Move.B #$FF, $1200(A1) - Nop - Move.B #$A0, $1C00(A1) - Nop - -; Load timer with number of VIA ticks per millisecond - 3. There are 3 clocks of overhead -; because it takes 1 clock for the timer to load, and 2 extra clocks because it has to count -; through -1, instead of down to 0. - - moveq.l #(NTicks-3)**$FF,d1 ; low byte of value to load into timer - moveq.l #(NTicks-3)>>8,d2 ; high byte of value to load into timer - - movea.l sp,a3 ; mark the stack - lea TimerInt,a0 ; point to the interrupt handler - move.l a0,AutoInt1 ; setup the interrupt handler - lea TimingTable,a4 ; point to table of routines to time - -@nextRoutine - movea.l a4,a0 ; point to table entry - adda.w (a4),a0 ; get routine address - moveq.l #2,d0 ; make a quick run to get it into the cache - lea @cacheLoaded,a2 ; setup return address - jmp (a0) ; call the routine to time -@cacheLoaded - movea.l a4,a0 ; point to table entry - adda.w (a4)+,a0 ; get routine address - moveq.l #-1,d0 ; run until the timer interrupts - lea @timedOut,a2 ; setup return address - andi.w #$F8FF,sr ; enable interrupts - jmp (a0) ; call the routine to time -@timedOut not.w d0 ; convert to number of loop executions. - - bne.s @skip_the_thing - move.w #$ffff, d0 -@skip_the_thing - - movea.w (a4)+,a0 ; get the address of the lowmem - move.w d0,(a0) ; store the result - - btst #6,$2400 - beq.b @dont - MOVE.B ([$68FFEFD0],$0083),([$68FFEFD0],$008D) ; VIAIntBit+1 -> CompletedInts+1 -@dont - - tst.w (a4) ; see if any more routines to time - bne.s @nextRoutine ; time all routines in the table - eieioSTP - move.b #(0< -; -; VIATime 5ca, in the IIci/IIfx/TERROR/HORROR ROMs, lives at 40x008BC. -; -------- -; This means that the @loop btst.b #0,(A0) is at 40x008C8, and the dbra d0,@loop -; is at 40x008CC. This code, "half cache-line aligned, when run on an 040 and above, will execute -; in an on-chip cache SEPARATE FROM THE I-CACHE, called (appropriately), the DBRA-CACHE (not to be -; confused with the Zebra-cache, or any other African equine). Why this is so important is that the -; memory address the BTST.B is referencing is a VIA (not surprising, since this is a loop that -; calculates Time-VIA-DB), and on 040s and above I/O space ($5xxxxxxx) is marked as non-cached and -; serialized. At 20MHz and below, 040s will encounter a 'beat frequency' between the CPU and VIA -; clocks, which will cause the CPU to miss both edges of the VIA clock on the first pass. This causes -; the CPU to have to wait an extra VIA clock cycle (1.2΅s * 2 = 2.4΅s) to access the register on the -; VIA about 21% of the time when running out of the DBRA CACHE. However, if the loop is unaligned and -; does not run from the DBRA-cache and CPU = 040 @ ² 20MHz, it will synchronize with the VIA clock -; on the first VIA clock cycle ZERO percent of the time. So, just to perform sadistic, saddalistic -; necroequinia, ALL unaligned loop VIA accesses at 20MHz and below will take 2.4΅s. This is important -; (you knew I'd get to this part eventually, right?) when using TimeVIADB as an EXACT time instead of -; a "minimum" type of timing constant. Poignant example - {Drivers}Sony:SonyMFM.a in mWrData uses -; TimeVIADB to wait EXACTLY a certain amount of time (~ 235΅s). However, the constant generated from -; this loop when it is aligned is $2B0. But 1ms/$2B0 ~= 1.45΅s, which indicates the bias of 79% of the -; VIA accesses taking 1.2΅s (1.2΅s * (0.79 * $2B0) = 652΅s) and 21% taking 2.4΅s -; (2.4΅s * (0.21 * $2B0) = 346΅s), giving (652+346 = 998΅s. The loop in mWrData is unaligned so 100% -; of the VIA accesses will take 2.4΅s. So instead of the loop waiting 235΅s (040 @ 20MHz = 162 times -; thru the loop; 162 * 1.45 = ~235), it actually waits 162 * 2.4 = ~389 ΅s. This is bad since the -; reason why this loop is waiting is for the floppy drive head to reach the correct place at the start -; of a sector to begin writing and since that loop waits so long, sectors are written late and the -; floppy is trashed. -; -; So by unaligning this loop it calculates a smaller number since each VIA access will then take 2.4΅s -; and mWrData will work correctly. -; -; In the case of 25MHz and above 040 processors, the rate that CPU and VIA clocks don't synchronize -; drops to ~ 1% and above that the CPU clock rate is fast enough that it always guarantees that it -; NEVER misses the first synchronization with the VIA clock. Unaligning the loop has no effect on -; ³ 25MHz 040 processors. -; -; ----------------------------------------------------------------------------------------------------- - -VIATime - lea vIER(a1),a0 ; <40x008BC> point to a VIA register - eieioSTP - move.b d1,vT2C(A1) ; <40x008C0> load low order byte - eieioSTP - move.b d2,vT2CH(A1) ; <40x008C4> load high order byte & go. - eieioSTP -@loop - btst.b #0,(A0) ; <40x008CA> typical VIA access loop - dbra d0,@loop ; <40x008CE> time the VIA DBRA loop - jmp (a2) ; <40x008D2> return if loop expires - ;________________________________________________________________________________________ ; @@ -2598,6 +2376,19 @@ InitCrsrMgrMiddle MOVE.W D0,CrsrNew ; flag cursor as changed, turn on tracking MOVE.L D0,MouseMask ; No jerkiness with $FFFFFFFF mask + MOVEQ #14, D0 ; Install JCrsrTask to VBL, with a twist + _NewPtrSysClear + MOVE #1, 4(A0) + MOVE #1, 10(A0) + LEA TheCrsrVBLTask, A1 + move.l A1, 6(A0) + _VInstall + + RTS + +TheCrsrVBLTask + MOVE #1, 10(A0) + MOVE.L JCrsrTask, -(SP) RTS @@ -2655,8 +2446,6 @@ SetupHWBases @BaseInitTable dc.w VIA1Exists,VIA ; init VIA1 base address - dc.w SCCRdExists,SCCRd ; init SCC read base address - dc.w SCCWrExists,SCCWr ; init SCC write base address IF hasIopScc THEN dc.w SCCIOPExists,SCCRd ; init SCC IOP read base address dc.w SCCIOPExists,SCCWr ; init SCC IOP write base address @@ -2701,21 +2490,6 @@ SetupHWBases ; d0 -> Addresses Map Flags, which system addresses are valid SetupMiscSCSI - IF hasSCSI96 THEN - btst.l #SCSI96_1Exists, d0 ; see if we have 1st SCSI96 - beq.s @2ndSCSI96 ; bra. if not - move.l SCSI96Addr1(a0), SCSIBase ; initialize the low mem -@2ndSCSI96 - btst.l #SCSI96_2Exists, d0 ; see if we have 2nd SCSI96 - beq.s @80based ; - move.l SCSI96Addr2(a0), SCSI2Base ; initialize the low mem - bra.s @SCSIHskDone -@80based - ENDIF - - - btst.b #6, ($2400) - bne.b @SCSIHskDone btst.l #SCSIDackExists,d0 ; see if we have SCSI Dack bne.s @SCSIDackDone ; if we do, it's setup ok @@ -2800,25 +2574,33 @@ LoadDrivers MOVE.L SP,A0 CLR.B IOPermssn(A0) ; r/w permissions -; -;ΡΡΡΡΡΡΡΡΡ RAM Disk Driver ΡΡΡΡΡΡΡΡΡ -; -; if we don't have an EDisk driver, this will not affect anything -; to enable the EDisk, make sure that it is included in the rom resources - IF hasEDisk THEN - LEA.L EDiskName,A1 - MOVEQ.L #$30,D2 ; and resource ID - BSR InstallDriver ; go install the driver - ENDIF +; +;ΡΡΡΡΡΡΡΡΡ Blue Box Driver ΡΡΡΡΡΡΡΡΡ +; + + lea BlueBoxSharedName, a1 ; Driver name + move #-20423, d2 ; DRVR resource ID + clr.l -(sp) + bsr InstallDriver + addq #4, sp + + lea BlueBoxSharedName, a1 + bsr OpenDRVR ; -;ΡΡΡΡΡΡΡΡΡ LAN Disk Driver ΡΡΡΡΡΡΡΡΡ +;ΡΡΡΡΡΡΡΡΡ AppleCD Driver ΡΡΡΡΡΡΡΡΡ ; - IMPORT InterC_1890_InitLANDisk - BSR InterC_1890_InitLANDisk + lea AppleCDName, a1 ; Driver name + move #-20424, d2 ; DRVR resource ID + clr.l -(sp) + bsr InstallDriver + addq #4, sp + + lea AppleCDName, a1 + bsr OpenDRVR ; @@ -2828,56 +2610,27 @@ LoadDrivers IF hasBCScreen THEN - SubQ.L #$2, sp - Move.L sp, -(sp) - Move.L #$3FF, -(sp) - Move.L #$36, -(sp) - Clr.L -(sp) - Pea.L BCScreenName - Move.L #$FFFFBF7D, -(sp) + btst #5, $240A + beq @noBCScreen - IMPORT Interstix208c_1 - BSR.L Interstix208c_1 - - dc.w $defc, $001a - ;AddA #$1A, A7 + move.l #'only', -(sp) + lea BCScreenName, a1 + move.w #-16515, d2 + bsr InstallDriver + addq #4, sp +@noBCScreen ENDIF ; -;ΡΡΡΡΡΡΡΡΡ Backlight Driver ΡΡΡΡΡΡΡΡΡ +;ΡΡΡΡΡΡΡΡΡ Sound Driver ΡΡΡΡΡΡΡΡΡ ; - IF hasPwrControls THEN - BTst.B #$0, (HWCfgFlags) - BEQ.B @noBacklight - BTst.B #$6, ($2409) - BNE.B @noBacklight - Move.L #'only', -(A7) - LEA.L BacklightName,A1 ; get the backlight driver's name - MOVE.W #-16511,D2 ; and resource ID - BSR InstallDriver ; go install the driver - AddQ #$4, A7 -@noBacklight - - MoveA.L A7, A0 - Clr.B $1B(A0) - Bsr FROVideo - Lea.L $32(A7), A7 - BTst.B #$6, ($2409) - BEQ.B @skipALine - import InterC_1f40_Backlight - Bsr.L InterC_1f40_Backlight -@skipALine - - BTst.B #$3, ($DD3) - BEQ @exitDrivers - ENDIF - - - - + MOVE.L SP,A0 ; iopb on the stack + CLR.B IOPermssn(A0) ; r/w permissions + BSR FROVideo ; open the default video driver and setup video globals + LEA IOQElSize(SP),SP ; deallocate parameter block for device manager calls. ; @@ -2889,13 +2642,16 @@ LoadDrivers ; whose entry point is an installation procedure. A 'SERD' installs itself into the unit ; table, remaining closed and inactive until opened by a client. + btst #3, $DD3 + beq @noSerial + subq #4,sp ; allocate space for return value move.l #'nsrd',-(sp) ; push serial driver resource type move.w #1,-(sp) ; SerialDMA driver is 'SERD' (1) move.w #mapTrue,ROMMapInsert ; get resource from ROM _GetResource move.l (sp)+,d0 ; did it get the handle? - beq.b @exitDrivers + beq.b @noSerial movea.l d0,a2 movea.l (a2),a1 SubQ #$4, A7 @@ -2915,29 +2671,16 @@ LoadDrivers _BlockMove jsr (a1) ; call the install code -@exitDrivers +@noSerial rts STRING PASCAL SndName DC.W '.Sound' ; - - IF hasEDisk THEN -EDiskName DC.W '.EDisk' ; - ENDIF - IF hasNewAge THEN -NewAgeName DC.W '.NewAge' ; - ENDIF - IF hasNetBoot THEN -NetBootName DC.W '.netBOOT' - ENDIF - - IF hasPwrControls THEN -BacklightName - DC.W '.Backlight' - ENDIF - +BlueBoxSharedName + DC.W '.BlueBoxShared' +AppleCDName DC.W '.AppleCD' IF hasBCScreen THEN BCScreenName @@ -2970,6 +2713,7 @@ BCScreenName ; app heap during system initialization time. ;________________________________________________________________________________________ + align 16 DrawBeepScreen PEA -4(A5) ; set up QuickDraw global area _InitGraf @@ -3107,6 +2851,16 @@ FROVideo MOVE.L A0,A1 ; save the param block pointer for _Open BNE.B @End @TryDefault + movem.l d0-d7/a0-a4, -(sp) + subq #2, sp + clr.l -(sp) + move #$02EB, d0 + _DisplayDispatch + move (sp)+, d0 + tst d0 + movem.l (sp)+, d0-d7/a0-a4 + bne.s @End + BSR OpnVidDeflt ; open the default video device, set video params BEQ @End ; -> got it @@ -4049,4 +3803,5 @@ OnePage equ $1000 align 16 + dcb.b 64, 0 end \ No newline at end of file diff --git a/OS/StartMgr/StartMgr.make b/OS/StartMgr/StartMgr.make index 767ffa7..907abca 100644 --- a/OS/StartMgr/StartMgr.make +++ b/OS/StartMgr/StartMgr.make @@ -28,6 +28,7 @@ StartMgrObjs = "{ObjDir}StartTop.a.o" Ά "{ObjDir}StartInit.a.o" Ά "{ObjDir}StartInterstix.c.o" Ά + "{ObjDir}Boot1.a.o" Ά "{ObjDir}StartSearch.a.o" Ά "{ObjDir}StartLibGlue.c.o" Ά "{ObjDir}StartBoot.a.o" Ά @@ -239,6 +240,10 @@ Boot3Objects = "{ObjDir}Boot3.a.o" C {StdCOpts} -o "{Targ}" "{StartDir}UnivTestEnv:SONIC_Test.c" -i "{StartDir}UnivTestEnv:" +"{ObjDir}Boot1.a.o" Δ "{StartDir}Boot1.a" + Asm {StdAOpts} -o "{Targ}" "{StartDir}Boot1.a" + + "{ObjDir}Boot3.a.o" Δ "{IntAIncludes}LinkedPatchMacros.a" Ά "{ObjDir}StandardEqu.d" Ά "{AIncludes}Folders.a" Ά diff --git a/OS/StartMgr/StartSearch.a b/OS/StartMgr/StartSearch.a index 255d654..0ed592a 100644 --- a/OS/StartMgr/StartSearch.a +++ b/OS/StartMgr/StartSearch.a @@ -204,6 +204,8 @@ NoDefaultVal EQU $6666 ; the sign of the ... no default disk selected IMPORT ITTBOOT ; BootItt.c ENDIF + IMPORT BootBlocks + Locals RECORD {link},INCR @@ -274,7 +276,19 @@ FindStartupDevice PROC EXPORT IMPORT GetDefaultStartup ; StartSearch.a link A4, #frameSize - + + + bsr SmallFunction2 + cmp.w #-1,d0 + bne.s @refnumNotFirst + move.l #$00000C04,d0 + dc.w $FE22 +@refnumNotFirst + + BSR SelectDevice + + BRA @GotIt ; SKIP EVERYTHING + BSR EmbarkOnSearch ; Initialize our state. BSR LoadSlotDrivers ; Default is a slot device, execute boot code @@ -283,18 +297,12 @@ FindStartupDevice PROC EXPORT MOVE.L Ticks, startTicks(A4) ; Init the time we got here in case we have PowerMgr BSR LoadSCSIDrivers ; Load all the drivers we can - BSR WaitForPollDrive ; Wait until the boot drive has warmed up - CLR.B -6(A4) - - BSR LoadATADrivers - - BSR OpenLANDiskDriver + BSR SmallFunction1 BRA @FirstEntry ; First time through: keep original goal @NextPass - IF hasPwrControls THEN ; WITH PmgrRec,pmCommandRec TestFor hwCbPwrMgr ; do we have Power Manager? beq.s @noSleep ; if not then skip time check @@ -316,7 +324,6 @@ FindStartupDevice PROC EXPORT @waitsleep BEQ.S @waitsleep ; Wait for the drugs to take affect @nosleep ENDWITH - ENDIF ; Move.L D7, D7 @@ -340,28 +347,19 @@ FindStartupDevice PROC EXPORT MoveQ.L #$1, D7 Lea.L IsItAnything, A3 @after_less_stuff - IMPORT ATAMgr_5d940 - Bsr.L ATAMgr_5d940 -@after_stuff - BSR LoadSCSIDrivers ; load more drivers if we can - BSR OpenLANDiskDriver + + MOVE.L #$00000C04,D0 + DC.W $FE22 @TryAgain BSR VisualUpdate ; Update dynamic user feedback - IMPORT PMIDLERELATEDDRIVERCALL - BSR.L PMIDLERELATEDDRIVERCALL - IMPORT INTERC_2750 - BSR.L INTERC_2750 - - @FirstEntry - BSR DaFuq BSR FindNextCandidate ; Find the next potential Startup Device. - BEQ.S @NextPass ; Branch if we're at the end of the queue. + BEQ @NextPass ; Branch if we're at the end of the queue. BSR SelectDevice ; Set up parameter block for this device. BSR CheckMouseEject ; Eject it if requested by mouse-down. @@ -424,6 +422,13 @@ EmbarkOnSearch SUBQ.W #4,SP ; make room for parameters on the stack MOVE.L SP,A0 ; and point to them _GetDefaultStartup ; get info about the default device + + MOVE.L A7,A0 + MOVE.L A0,-(SP) + MOVE.L #$00010113,D0 + DC.W $FE22 + ADDQ #4,SP + CLR -4(A4) MOVE.L (SP), startPRAM(A4) ; store for later partition check MOVE.W (SP)+,D3 ; D3.L = @@ -621,95 +626,34 @@ LoadSCSIDrivers ENDIF - - -LoadATADrivers - BTst.B #$7, ($B23) - BEQ @L3 - MoveM.L D1-D7/A0-A6, -(A7) - Move D4, -$8(A4) - Move.L -$C(A4), D5 - Move.L #$FF, D2 - Move.L D5, D1 - AndI #$F800, D1 - CmpI #$2000, D1 - BEQ.B @L0 - AndI.L #$FFFF00FF, D3 - CmpI #$FFCA, D5 - BEQ.B @L0 - Bra.B @L2 -@L0 _DisableDynWait - _GetTimeOut - BNE.B @L1 - MoveQ.L #$19, D0 -@L1 Move.L D0, -(A7) - MoveQ.L #$0, D0 - Move.B -$9(A4), D0 - LsL #$8, D0 - Move.B -$C(A4), D0 - Move.L D0, -(A7) - IMPORT ATAMgr_5d9b0 - BSR.L ATAMgr_5d9b0 - AddQ #$8, A7 - CmpI #$0, D0 - BEQ.B @L2 - Move D0, -$8(A4) - IMPORT ATAMgr_5d940 -@L2 BSR.L ATAMgr_5d940 - MoveM.L (A7)+, D1-D7/A0-A6 - Move -$8(A4), D4 -@L3 Rts +SmallFunction1 + pea lsdSRsrcID(a4) + move.l #$00010112,d0 + dc.w $FE22 + addq #4,sp + tst.w d0 + bz.s @dontUseD0 + move.w d0,d4 +@dontUseD0 + rts -PostATA - MoveM.L D0-D3/A0-A2, -(A7) - MoveA.L ([$2B6],$288), A2 - - Move.L A2, D0 - BEQ.B @return - Move $6(A2), D1 - MoveQ.L #$0, D2 - -@loop MoveA.L $14(A2,D2.L), A1 - Move.L A1, D0 - BEQ.B @return - Move $C8(A1), D0 - - Clr D3 - Cmp D3, D0 - BEQ.B @skip - MoveA.L $C4(A1), A0 - Move.L A0, D0 - BEQ.B @return - Jsr (A0) - Bra.B @return - -@skip AddQ #$4, D2 - SubQ #$1, D1 - BNE.B @loop - -@return MoveM.L (A7)+, D0-D3/A0-A2 - Rts - - - -OpenLANDiskDriver - Lea.L @DriverName, A1 - Lea.L -$32(A7), A7 - MoveA.L A7, A0 - Move.L A1, $12(A0) - DC.W $A000 - Tst D0 - BNE.B @L7 - Move $18(A0), D4 -@L7 Lea.L $32(A7), A7 - Rts - - STRING Pascal -@DriverName DC.B '.LANDisk' - ALIGN 2 +SmallFunction2 + lea BootBlocks,a0 ; that's the ROM-based boot 1 + move.l a6,a1 + move.l #$400,d0 + _BlockMove + cmp.w #'LK',(a6) + bne.s @notBootBlocks ; should never happen because this is ROM + clr.l -(sp) + move.l #$0001011C,d0 + dc.w $FE22 + addq #4,sp + move.l d0,a2 +@notBootBlocks + rts @@ -820,6 +764,23 @@ WaitForPollDrive ;________________________________________________________________________________________ FindNextCandidate + TST.L A2 + BNZ @doNotRestartSearch + + CLR.L -(SP) + MOVE.L #$0001011C,D0 + DC.W $FE22 + ADDQ #4,SP + + MOVE.L D0,A2 + CMP.W #-1,D0 + BNE.S @DoneLooking + + MOVE.L #$00000C04,D0 + DC.W $FE22 + RTS + +@doNotRestartSearch BSR.S NextDQEntry ; Find the next drive queue entry. BNE.S @ckThisOut ; valid -> check out the drive ; not: we've searched the whole queue. @@ -950,12 +911,37 @@ DontEject RTS ; Return with status ;________________________________________________________________________________________ GetStartupInfo + MOVE.L A0,-(SP) ; save IOPB ptr for later + + MOVEQ #0,D0 + MOVE.W ioPosOffset(A0),D0 + MOVE.L D0,-(SP) + MOVE.L #$0001010F,D0 + DC.W $FE22 + ADDQ #4,SP + + MOVE.L (SP)+,A0 ; restore that IOPB ptr to A0 + + TST.W D0 ; we asked Classic if we should use ROM blocks + BZ @SearchDiskForBootBlocks + + MOVEM.L A0/A1,-(SP) + LEA BootBlocks,A0 + MOVE.L A6,A1 + MOVE.L #$400,D0 + _BlockMove + MOVEM.L (SP)+,A0/A1 + BRA.S @TryTheseRomBootBlocks + +@SearchDiskForBootBlocks MOVE.W #1,IOPosMode(A0) ; position relative to start CLR.L IOPosOffset(A0) ; start at byte position 0 MOVE.L A6,IOBuffer(A0) ; load boot blocks at (A6) MOVE.L #$400,IOReqCount(A0) ; two 512-byte blocks _Read ; read the boot blocks BNE.S @Exit ; -> error, so exit + +@TryTheseRomBootBlocks move.l a0,-(sp) BSR.L CacheFlush ; flush the caches move.l (sp)+,a0 diff --git a/OS/SysUtil.a b/OS/SysUtil.a index 8a21319..b0f2a64 100644 --- a/OS/SysUtil.a +++ b/OS/SysUtil.a @@ -1064,9 +1064,9 @@ POSTWRITE MOVE.L #$4000C,D0 _WriteXPRam - IMPORT InterC_29c0_Wireless - MACHINE MC68030 - BSR.L InterC_29c0_Wireless +; IMPORT InterC_29c0_Wireless +; MACHINE MC68030 +; BSR.L InterC_29c0_Wireless ; MACHINE MC68000 ClkXit MOVE.W (SP)+,D0 ; pass back error code <30oct85> LAK