/* boot.c 7.3 90/06/22 */
#include "machine/mtpr.h"
* Boot program... arguments passed in r10 and r11 determine
* whether boot stops to ask for system name and which device
#define DEV_DFLT 1 /* vd/dk */
/*#define DEV_DFLT 2 /* hd */
register char *cp
; /* skip r12 */
register u_int howto
, devtype
; /* howto=r11, devtype=r10 */
if ((devtype
& B_MAGICMASK
) != B_DEVMAGIC
)
devtype
= DEV_DFLT
<< B_TYPESHIFT
; /* unit, partition 0 */
howto
= RB_ASKNAME
|RB_SINGLE
;
if ((howto
& RB_ASKNAME
) == 0) {
type
= (devtype
>> B_TYPESHIFT
) & B_TYPEMASK
;
if ((unsigned)type
< ndevs
&& devsw
[type
].dv_name
)
howto
|= RB_SINGLE
|RB_ASKNAME
;
if (howto
& RB_ASKNAME
) {
copyunix(howto
, opendev
, io
);
howto
|= RB_SINGLE
|RB_ASKNAME
;
howto
|= RB_SINGLE
|RB_ASKNAME
;
copyunix(howto
, devtype
, io
)
register io
, howto
, devtype
; /* NOTE ORDER */
register int esym
; /* must be r9 */
if (read(io
, (char *)&x
, sizeof(x
)) != sizeof(x
) || N_BADMAG(x
)) {
if (x
.a_magic
== ZMAGIC
&& lseek(io
, 0x400, 0) == -1)
if (read(io
, (char *)RELOC
, x
.a_text
) != x
.a_text
)
addr
= (char *)(x
.a_text
+ RELOC
);
if (x
.a_magic
== ZMAGIC
|| x
.a_magic
== NMAGIC
)
while ((int)addr
& CLOFSET
)
printf("+%ld", x
.a_data
);
if (read(io
, addr
, x
.a_data
) != x
.a_data
)
if (howto
& RB_KDB
&& x
.a_syms
) {
for (i
= 0; i
< x
.a_bss
; i
++)
*(int *)addr
= x
.a_syms
; /* symbol table size */
printf("[+%ld", x
.a_syms
);
if (read(io
, addr
, x
.a_syms
) != x
.a_syms
)
if (read(io
, addr
, sizeof (int)) != sizeof (int))
i
= *(int *)addr
- sizeof (int); /* string table size */
if (read(io
, addr
, i
) != i
)
esym
= roundup((int)addr
, sizeof (int));
x
.a_bss
+= 32*1024; /* slop */
for (i
= 0; i
< x
.a_bss
; i
++)
printf(" start 0x%lx\n", x
.a_entry
);
mtpr(PADC
, 0); /* Purge data cache */
mtpr(PACC
, 0); /* Purge code cache */
mtpr(DCR
, 1); /* Enable data cache */
(*((int (*)()) x
.a_entry
))();