# 2.11BSD#431 - /usr/src/sys/conf/boot/siboot.s

##### Functions

    _doboot           X

##### Variables

    hardboot          X

       1: /*
       2:  *	SCCS id	@(#)siboot.s	2.0 (2.11BSD)	4/13/91
       3:  */
       4: #include "localopts.h"
       5:
       6: /  The boot options and device are placed in the last SZFLAGS bytes
       7: /  at the end of core for the bootstrap.
       8: ENDCORE=        160000          / end of core, mem. management off
       9: SZFLAGS=        6               / size of boot flags
      10: BOOTOPTS=       2               / location of options, bytes below ENDCORE
      11: BOOTDEV=        4               / boot unit
      12: CHECKWORD=      6
      13:
      14: .globl  _doboot, hardboot, _bootcsr
      15: .text
      16: _doboot:
      17:         mov     4(sp),r4        / boot options
      18:         mov     2(sp),r3        / boot device
      19:
      20: #ifndef KERN_NONSEP
      21: /  If running separate I/D, need to turn off memory management.
      22: /  Call the routine unmap in low text, after setting up a jump
      23: /  in low data where the PC will be pointing.
      24: .globl  unmap
      25:         mov     $137,*$unmap+2          / jmp *$hardboot
      26:         mov     $hardboot,*$unmap+4
      27:         jmp     unmap
      28:         / "return" from unmap will be to hardboot in data
      29: .data
      30: #else
      31: /  Reset to turn off memory management
      32:         reset
      33: #endif
      34:
      35: /  On power fail, hardboot is the entry point (map is already off)
      36: /  and the args are in r4 (RB_POWRFAIL), r3 (rootdev)
      37:
      38: hardboot:
      39:         mov     r4, ENDCORE-BOOTOPTS
      40:         ash     $-3,r3          / shift out the partition number
      41:         bic     $!7,r3          / save only the drive number
      42:         mov     r3, ENDCORE-BOOTDEV
      43:         com     r4              / if CHECKWORD == ~bootopts, flags are believed
      44:         mov     r4, ENDCORE-CHECKWORD
      45: 1:
      46:         reset
      47:
      48: /  The remainder of the code is dependent on the boot device.
      49: /  If you have a bootstrap ROM, just jump to the correct entry.
      50: /  Otherwise, use a BOOT opcode, if available;
      51: /  if necessary, read in block 0 to location 0 "by hand".
      52:
      53: / si 9500 bootstrap - bmarsh@nosc
      54:
      55: WC      = 256.
      56: READ    = 4
      57: GO      = 1
      58:
      59: sicnr   = 0
      60: siwcr   = sicnr+2
      61: sipcr   = sicnr+4
      62: sihsr   = sicnr+6
      63: simar   = sicnr+10
      64: sierr   = sicnr+12
      65: siscr   = sicnr+24
      66:
      67:         mov     _bootcsr,r1
      68:         bit     $200,siscr(r1)  / see if grant set
      69:         bne     1f              / if set, is dual ported controller
      70:         mov     sierr(r1),r0    / load error register
      71:         bic     $037777,r0      / clear all but contention and error bits
      72:         cmp     $140000,r0      / see if we have a contention error
      73:         bne     2f              / if not, controller is not dual ported
      74: 1:
      75:         bit     $200,siscr(r1)  / test for grant
      76:         bne     2f              / if set, ok for read
      77:         clr     sicnr(r1)       / send logic master clear
      78:         mov     $1,siscr(r1)    / request grant
      79:         br      1b              / loop until grant
      80: 2:
      81:         mov     ENDCORE-BOOTDEV,r0
      82:         ash     $10.,r0
      83:         mov     r0,sipcr(r1)    / port 0 cylinder 0, unit
      84:         clr     sihsr(r1)       / head 0 sector 0
      85:         clr     simar(r1)       / address 0
      86:         mov     $WC,siwcr(r1)   / word count
      87:         mov     $READ+GO,sicnr(r1)
      88: 1:
      89:         tstb    sicnr(r1)
      90:         bge     1b
      91:         mov     ENDCORE-BOOTDEV,r0
      92:         clr     pc

#### Defined functions

BOOTDEV defined in line 11; used 3 times

- in line 42, 81, 91

BOOTOPTS defined in line 10; used 1 times

- in line 39

CHECKWORD defined in line 12; used 1 times

- in line 44

ENDCORE defined in line 8; used 5 times

- in line 39-44(3), 81, 91

SZFLAGS defined in line 9; never used
_doboot declared in line 14; defined in line 16; used 1 times

- in line 14

#### Defined variables

GO defined in line 57; used 1 times

- in line 87

READ defined in line 56; used 1 times

- in line 87

WC defined in line 55; used 1 times

- in line 86

hardboot declared in line 14; defined in line 38; used 2 times

- in line 14, 26

sicnr defined in line 59; used 9 times

- in line 60-65(6), 77, 87-89(2)

sierr defined in line 64; used 1 times

- in line 70

sihsr defined in line 62; used 1 times

- in line 84

simar defined in line 63; used 1 times

- in line 85

sipcr defined in line 61; used 1 times

- in line 83

siscr defined in line 65; used 3 times

- in line 68, 75-78(2)

siwcr defined in line 60; used 1 times

- in line 86

Last modified: 1991-04-20 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 624 |