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 >
Text File  |  1994-03-01  |  2KB  |  75 lines

  1.     Title    'Force Boot Device to Network BootP' ;
  2. *
  3. * Module for "Force" shell
  4. * Ben Cranston March 1, 1994
  5. *
  6.     Print    Off            ; Here be includes
  7.     Include    'RomEqu.a'        ;
  8.     Include    'Start.a'        ;
  9.     Include    'Traps.a'        ;
  10.     Print    On,NoGen        ; Here be includes
  11.     Main                ; Begin module
  12. *
  13. S    Record    {A6Link},Decr        ; Stack frame
  14. A6Link    DS.L    1            ; Caller's A6
  15. Curr    DS    SlotDev            ; Current PRAM value
  16. Want    DS    SlotDev            ; Desired PRAM value
  17. SPB    DS    spBlock            ; Pointer to setup resource
  18. SS    Equ    *            ; Stack size
  19.     EndR                ; Stack frame
  20. *
  21.     Eject                ;
  22. *
  23. * Decide if we want it on or off.
  24. *
  25.     Link    A6,#S.SS        ; Make local frame
  26.     Tst.L    D1            ; Did we get a data resource?
  27.     BEq.S    @999            ; If not then get out
  28.     Clr.L    S.Want(A6)        ; Initially set Off state
  29.     Move.L    D1,A0            ; Get handle
  30.     Move.L    (A0),A0            ; Get pointer
  31.     Tst.B    1(A0)            ; Does he want it on or off
  32.     BEq.S    @010            ; If turning off go do so
  33. *
  34. * Find a network card and compute desired setting.
  35. *
  36.     LEA    S.SPB(A6),A0        ; Get spBlock address
  37.     Move.B    #1,spBlock.spSlot(A0)    ; Find in any REAL slot
  38.     Clr.B    spBlock.spId(A0)    ; Find any resource number
  39.     Clr.B    spBlock.spExtDev(A0)    ; External device zero?
  40.     Clr.B    spBlock.spHwDev(A0)    ; Ignore external hardware
  41.     Move.B    #3,spBlock.spTBMask(A0)    ; Look at Category and CType
  42.     Move.W    #catNetwork,spBlock.spCategory(A0) ; Network category
  43.     Move.W    #typEtherNet,spBlock.spCType(A0) ; EtherNet type
  44.     _sNextTypesRsrc            ; Get next sResource info
  45.     BNE.S    @900            ; If error then get out
  46.     Clr.B    S.Want.sdExtDevID(A6)    ; Clear external device
  47.     Clr.B    S.Want.sdPartition(A6)    ; Clear partition
  48.     Move.B    spBlock.spSlot(A0),S.Want.sdSlotNum(A6) ; Set slot number
  49.     Move.B    #$81,S.Want.sdSRsrcID(A6) ; Set sResource number
  50. *
  51. * Compare against current setting and decide if we must reset.
  52. *
  53. @010    ;
  54.     LEA    S.Curr(A6),A0        ; Get current setting
  55.     _GetDefaultStartup        ; Get current setting
  56.     Move.L    S.Curr(A6),D1        ; Get current setting
  57.     Cmp.L    S.Want(A6),D1        ; Do we have to change it?
  58.     BEq.S    @900            ; If not then skip
  59. *
  60. * Write desired contents to PRAM and force reboot.
  61. *
  62.     LEA    S.Want(A6),A0        ; Get desired setting
  63.     _SetDefaultStartup        ; Write parameter RAM
  64.     Move.L    #1,D0            ; Set flag to force reboot
  65.     Bra.S    @999            ; Return to driver
  66. *
  67. @900    ;
  68.     Clr.L    D0            ; Set no reboot
  69. @999    ;
  70.     UnLk    A6            ; Drop local frame
  71.     RTS                ; Return to INIT31
  72. *
  73.     EndMain                ; Keep MPW happy
  74.     End                ; ForceNetBoot.a
  75.