* Copyright (c) 1982 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
* @(#)boot.c 6.7 (Berkeley) %G%
* Boot program... arguments passed in r10 and r11 determine
* whether boot stops to ask for system name and which device
/* Types in r10 specifying major device */
* constants for converting a "minor" device numbers to unit number
#define PARTITIONMASK 0x7
register howto
, devtype
; /* howto=r11, devtype=r10 */
register type
, part
, unit
;
howto
= RB_ASKNAME
|RB_SINGLE
;
unit
= (int)((unsigned)devtype
>> UNITSHIFT
) & UNITMASK
;
part
= unit
& PARTITIONMASK
;
unit
= unit
>> PARTITIONSHIFT
;
if ((howto
&RB_ASKNAME
)==0) {
if (type
>= 0 && type
< sizeof(devname
) / 2
*cp
++ = devname
[type
][0];
*cp
++ = devname
[type
][1];
howto
= RB_SINGLE
|RB_ASKNAME
;
if (howto
& RB_ASKNAME
) {
howto
= RB_SINGLE
|RB_ASKNAME
;
howto
= RB_SINGLE
|RB_ASKNAME
;
i
= read(io
, (char *)&x
, sizeof x
);
(x
.a_magic
!= 0407 && x
.a_magic
!= 0413 && x
.a_magic
!= 0410))
if (x
.a_magic
== 0413 && lseek(io
, 0x400, 0) == -1)
if (read(io
, (char *)0, x
.a_text
) != x
.a_text
)
if (x
.a_magic
== 0413 || x
.a_magic
== 0410)
while ((int)addr
& CLOFSET
)
if (read(io
, addr
, x
.a_data
) != x
.a_data
)
x
.a_bss
+= 128*512; /* slop */
for (i
= 0; i
< x
.a_bss
; i
++)
printf(" start 0x%x\n", x
.a_entry
);
(*((int (*)()) x
.a_entry
))();
/* 750 Patchable Control Store magic */
#define PCS_BITCNT 0x2000 /* number of patchbits */
#define PCS_MICRONUM 0x400 /* number of ucode locs */
#define PCS_PATCHADDR 0xf00000 /* start addr of patchbits */
#define PCS_PCSADDR (PCS_PATCHADDR+0x8000) /* start addr of pcs */
#define PCS_PATCHBIT (PCS_PATCHADDR+0xc000) /* patchbits enable reg */
#define PCS_ENABLE 0xfff00000 /* enable bits for pcs */
register int *ip
; /* known to be r11 below */
register int i
; /* known to be r10 below */
register int *jp
; /* known to be r9 below */
if (sid
.cpuany
.cp_type
!=VAX_750
|| sid
.cpu750
.cp_urev
<95 || pcsdone
)
printf("Updating 11/750 microcode: ");
closeparen
= index(pcs
, ')');
strcat(pcs
, "pcs750.bin");
* We ask for more than we need to be sure we get only what we expect.
* locs 0 - 1023 packed patchbits
* 1024 - 11264 packed microcode
if (read(i
, (char *)0, 23*512) != 22*512) {
printf("Error reading %s\n", pcs
);
* Enable patchbit loading and load the bits one at a time.
*((int *)PCS_PATCHBIT
) = 1;
ip
= (int *)PCS_PATCHADDR
;
for (i
=0; i
< PCS_BITCNT
; i
++) {
asm(" extzv r10,$1,(r9),(r11)+");
*((int *)PCS_PATCHBIT
) = 0;
* Load PCS microcode 20 bits at a time.
for (i
=j
=0; j
< PCS_MICRONUM
* 4; i
+=20, j
++) {
asm(" extzv r10,$20,(r9),(r11)+");
i
= *jp
; /* get 1st 20 bits of microcode again */
i
|= PCS_ENABLE
; /* reload these bits with PCS enable set */
*((int *)PCS_PCSADDR
) = i
;
printf("new rev level=%d\n", sid
.cpu750
.cp_urev
);