home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HyperLib 1997 Winter - Disc 1
/
HYPERLIB-1997-Winter-CD1.ISO.7z
/
HYPERLIB-1997-Winter-CD1.ISO
/
オンラインウェア
/
UTIL
/
ForcePRAM.sit
/
ForceNetBoot.a
< prev
next >
Wrap
Text File
|
1994-03-01
|
2KB
|
75 lines
Title 'Force Boot Device to Network BootP' ;
*
* Module for "Force" shell
* Ben Cranston March 1, 1994
*
Print Off ; Here be includes
Include 'RomEqu.a' ;
Include 'Start.a' ;
Include 'Traps.a' ;
Print On,NoGen ; Here be includes
Main ; Begin module
*
S Record {A6Link},Decr ; Stack frame
A6Link DS.L 1 ; Caller's A6
Curr DS SlotDev ; Current PRAM value
Want DS SlotDev ; Desired PRAM value
SPB DS spBlock ; Pointer to setup resource
SS Equ * ; Stack size
EndR ; Stack frame
*
Eject ;
*
* Decide if we want it on or off.
*
Link A6,#S.SS ; Make local frame
Tst.L D1 ; Did we get a data resource?
BEq.S @999 ; If not then get out
Clr.L S.Want(A6) ; Initially set Off state
Move.L D1,A0 ; Get handle
Move.L (A0),A0 ; Get pointer
Tst.B 1(A0) ; Does he want it on or off
BEq.S @010 ; If turning off go do so
*
* Find a network card and compute desired setting.
*
LEA S.SPB(A6),A0 ; Get spBlock address
Move.B #1,spBlock.spSlot(A0) ; Find in any REAL slot
Clr.B spBlock.spId(A0) ; Find any resource number
Clr.B spBlock.spExtDev(A0) ; External device zero?
Clr.B spBlock.spHwDev(A0) ; Ignore external hardware
Move.B #3,spBlock.spTBMask(A0) ; Look at Category and CType
Move.W #catNetwork,spBlock.spCategory(A0) ; Network category
Move.W #typEtherNet,spBlock.spCType(A0) ; EtherNet type
_sNextTypesRsrc ; Get next sResource info
BNE.S @900 ; If error then get out
Clr.B S.Want.sdExtDevID(A6) ; Clear external device
Clr.B S.Want.sdPartition(A6) ; Clear partition
Move.B spBlock.spSlot(A0),S.Want.sdSlotNum(A6) ; Set slot number
Move.B #$81,S.Want.sdSRsrcID(A6) ; Set sResource number
*
* Compare against current setting and decide if we must reset.
*
@010 ;
LEA S.Curr(A6),A0 ; Get current setting
_GetDefaultStartup ; Get current setting
Move.L S.Curr(A6),D1 ; Get current setting
Cmp.L S.Want(A6),D1 ; Do we have to change it?
BEq.S @900 ; If not then skip
*
* Write desired contents to PRAM and force reboot.
*
LEA S.Want(A6),A0 ; Get desired setting
_SetDefaultStartup ; Write parameter RAM
Move.L #1,D0 ; Set flag to force reboot
Bra.S @999 ; Return to driver
*
@900 ;
Clr.L D0 ; Set no reboot
@999 ;
UnLk A6 ; Drop local frame
RTS ; Return to INIT31
*
EndMain ; Keep MPW happy
End ; ForceNetBoot.a