1: /*
   2:  *	SCCS id	@(#)boot.s	1.2 (Berkeley)	9/6/82
   3:  */
   4: #include "whoami.h"
   5: 
   6: #ifdef  UCB_AUTOBOOT
   7: /  The boot options and device are placed in the last SZFLAGS bytes
   8: /  at the end of core for the bootstrap.
   9: ENDCORE=        160000          / end of core, mem. management off
  10: SZFLAGS=        6               / size of boot flags
  11: BOOTOPTS=       2               / location of options, bytes below ENDCORE
  12: BOOTDEV=        4
  13: CHECKWORD=      6
  14: 
  15: reset=  5
  16: 
  17: .globl  _doboot, hardboot
  18: .text
  19: _doboot:
  20:         mov     4(sp),r4        / boot options
  21:         mov     2(sp),r3        / boot device
  22: 
  23: #ifndef KERN_NONSEP
  24: /  If running separate I/D, need to turn off memory management.
  25: /  Call the routine unmap in low text, after setting up a jump
  26: /  in low data where the PC will be pointing.
  27: .globl  unmap
  28:         mov     $137,*$unmap+2          / jmp *$hardboot
  29:         mov     $hardboot,*$unmap+4
  30:         jmp     unmap
  31:         / "return" from unmap will be to hardboot in data
  32: .data
  33: #else
  34: /  Reset to turn off memory management
  35:         reset
  36: #endif
  37: 
  38: /  On power fail, hardboot is the entry point (map is already off)
  39: /  and the args are in r4, r3.
  40: 
  41: hardboot:
  42:         mov     r4, ENDCORE-BOOTOPTS
  43:         mov     r3, ENDCORE-BOOTDEV
  44:         com     r4              / if CHECKWORD == ~bootopts, flags are believed
  45:         mov     r4, ENDCORE-CHECKWORD
  46: 1:
  47:         reset
  48: 
  49: /  The remainder of the code is dependent on the boot device.
  50: /  If you have a bootstrap ROM, just jump to the correct entry.
  51: /  Otherwise, use a BOOT opcode, if available;
  52: /  if necessary, read in block 0 to location 0 "by hand".
  53: 
  54: /
  55: / Bootstrap for DIVA Comp/V controller without boot opcode
  56: /
  57: HPCSR=  176700          / Drive #0
  58: HPDC=   176734          / Desired cylinder
  59: HPBAE=  176750          / Bus extension address (RH70)
  60: HPCS2=  176710          / Control/status register 2
  61: READIT= 71
  62: CSW=    177570          / Console switch display register
  63: 
  64: 1:
  65:         bitb    $200,*$HPCSR    / wait for ready
  66:         beq     1b
  67: 
  68:         mov     $0710,*$CSW     / For debugging
  69:         mov     $0,*$HPDC       / Cylinder 0
  70:         mov     $0,*$HPBAE      / Bus extension address = 0
  71:         mov     $HPCS2,r0
  72:         mov     $0,-(r0)        / HPCSR->hpda = 0 (desired address 0)
  73:         mov     $0,-(r0)        / HPCSR->hpba = 0 (buf address 0)
  74:         mov     $177400,-(r0)   / HPCSR->hpwc = -256 (one block)
  75:         mov     $READIT,-(r0)   / HPCSR->hpcs1 = HP_RCOM|HP_GO
  76:         mov     $0711,*$CSW     / For debugging
  77: 
  78: 1:
  79:         bitb    $200,*$HPCSR    / wait for done
  80:         beq     1b
  81:         mov     $0712,*$CSW     / For debugging
  82:         jmp     *$0
  83: 
  84: / no return
  85: #endif	UCB_AUTOBOOT

Defined functions

BOOTDEV defined in line 12; used 1 times
  • in line 43
BOOTOPTS defined in line 11; used 1 times
  • in line 42
CHECKWORD defined in line 13; used 1 times
  • in line 45
ENDCORE defined in line 9; used 3 times
SZFLAGS defined in line 10; never used
_doboot declared in line 17; defined in line 19; used 1 times
  • in line 17

Defined variables

CSW defined in line 62; used 3 times
HPBAE defined in line 59; used 1 times
  • in line 70
HPCS2 defined in line 60; used 1 times
  • in line 71
HPCSR defined in line 57; used 2 times
HPDC defined in line 58; used 1 times
  • in line 69
READIT defined in line 61; used 1 times
  • in line 75
hardboot declared in line 17; defined in line 41; used 2 times
Last modified: 1983-03-22
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 559
Valid CSS Valid XHTML 1.0 Strict