#define _LOCORE
#define __HAVE_OLD_DISKLABEL
#define OMIT_DKTYPENUMS
#define OMIT_FSTYPENUMS
#include "sys/disklabel.h"
#include "../include/mtpr.h"
#include "../include/asm.h"
_C_LABEL(_start):
_C_LABEL(start):
.globl _C_LABEL(start) # this is the symbolic name for the start
.globl _C_LABEL(_start) # of code to be relocated. We can use this
.org 0x00 # uVAX booted from TK50 starts here
brb from_0x00 # continue behind dispatch-block
.org 0x02 # information used by uVAX-ROM
.byte 0xcf # offset in words to identification area
.byte 1 # this byte must be 1
.word 0 # logical block number (word swapped)
.word 0 # of the secondary image
.org 0x08 #
brb from_0x08 # skip ...
.org 0x0C # 11/750 & 8200 starts here
movzbl $1,_C_LABEL(from)# We booted from "old" rom.
brw cont_750
from_0x00: # uVAX from TK50
brw start_uvax # all uVAXen continue there
from_0x08: # Any machine from VMB
movzbl $4,_C_LABEL(from) # Booted from full VMB
movl 52(%r11), %r7 # load iovec/bqo into %r7
addl3 (%r7), %r7, %r6 # load qio into %r6
pushl %r11 # base of rpb
pushl $0 # virtual-flag
pushl $33 # read-logical-block
pushl $1 # lbn to start reading
pushl $7680 # number of bytes to read
pushab start_uvax # buffer-address
calls $6, (%r6) # call the qio-routine
brw start_uvax
.org LABELOFFSET
.globl _C_LABEL(romlabel)
_C_LABEL(romlabel):
.long 0
.org LABELOFFSET + d_end_
#define VOLINFO 0
#define SISIZE 16
#define SILOAD 0
#define SIOFF 0x200
.org 0x19e # do not move, see comment earlier about CASEL
.byte 0x18 # must be 0x18
.byte 0x00 # must be 0x00 (MBZ)
.byte 0x00 # any value
.byte 0xFF - (0x18 + 0x00 + 0x00)
.byte 0x00 # must be 0x00 (MBZ)
.byte VOLINFO
.byte 0x00 # any value
.byte 0x00 # any value
.long SISIZE # size in blocks of secondary image
.long SILOAD # load offset (usually 0)
.long SIOFF # byte offset into secondary image
.long (SISIZE + SILOAD + SIOFF) # sum of previous 3
.align 2
.globl _C_LABEL(from)
_C_LABEL(from):
.long 0
cont_750:
movl $_C_LABEL(start), %sp # move stack to avoid clobbering the code
pushr $0x131 # save clobbered registers
clrl %r4 # %r4 == # of blocks transferred
movab _C_LABEL(start),%r5 # %r5 have base address for next transfer
pushl %r5 # ...on stack also (Why?)
1: incl %r4 # increment block count
movl %r4,%r8 # LBN is in %r8 for rom routine
addl2 $0x200,%r5 # Increase address for next read
cmpl $16,%r4 # read 15 blocks?
beql 2f # Yep
movl %r5,(%sp) # move address to stack also
jsb (%r6) # read 512 bytes
blbs %r0,1b # jump if read succeeded
halt # otherwise die...
2: tstl (%sp)+ # remove boring arg from stack
popr $0x131 # restore clobbered registers
brw start_all # Ok, continue...
.org 0x200 # uVAX booted from disk starts here
start_uvax:
movzbl $2,_C_LABEL(from) # Booted from subset-VMB
brb start_all
start_all:
movl $_C_LABEL(start), %sp # move stack to a better
pushr $0x1fff # save all regs, used later.
subl3 $_C_LABEL(start), $_C_LABEL(edata), %r0
moval _C_LABEL(start), %r1 # get actual base-address of code
subl3 $_C_LABEL(start), $_C_LABEL(end), %r2
movl $_C_LABEL(start), %r3 # get relocated base-address of code
movc5 %r0, (%r1), $0, %r2, (%r3) # copy code to new location
movpsl -(%sp)
movl $relocated, -(%sp) # return-address on top of stack
rei # can be replaced with new address
relocated: # now relocation is done !!!
movl %sp, _C_LABEL(bootregs)
calls $0, _C_LABEL(Xmain) # call Xmain (gcc workaround)which is
halt # not intended to return ...
ENTRY(hoppabort, 0)
movl 4(%ap),%r6
movl _C_LABEL(rpb),%r11
mnegl $1,%ap # Hack to figure out boot device.
movpsl -(%sp)
pushab 2(%r6)
mnegl $1,_C_LABEL(vax_load_failure)
rei
halt
ENTRY(unit_init, R6|R7|R8|R9|R10|R11)
mfpr $17,%r7 # Wanted bu KDB
movl 4(%ap),%r0 # init routine address
movl 8(%ap),%r9 # RPB in %r9
movl 12(%ap),%r1 # VMB argument list
callg (%r1),(%r0)
ret
ENTRY(getchar, 0)
halt
#ifndef USE_PRINTF
ENTRY(putchar, 0)
ret
ENTRY(printf, 0)
ret
#endif
ENTRY(panic, 0)
halt