* Copyright (c) 1982, 1986 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
* @(#)bootra.c 7.1 (Berkeley) 6/5/86
char bootprog
[20] = "ra(0,0)boot";
* Boot program... arguments passed in r10 and r11
* are passed through to the full boot program.
register unsigned howto
, devtype
; /* howto=r11, devtype=r10 */
unit
= (devtype
>> B_UNITSHIFT
) & B_UNITMASK
;
unit
+= 8 * ((devtype
>> B_ADAPTORSHIFT
) & B_ADAPTORMASK
);
partition
= (devtype
>> B_PARTITIONSHIFT
) & B_PARTITIONMASK
;
*cp
++ = partition
/ 10 + '0';
*cp
++ = partition
% 10 + '0';
bcopy((caddr_t
) ")boot", cp
, 6);
printf("loading %s\n", bootprog
);
copyunix(howto
, devtype
, io
);
copyunix(howto
, devtype
, io
)
register howto
, devtype
, io
; /* howto=r11, devtype=r10 */
i
= read(io
, (char *)&x
, sizeof x
);
(x
.a_magic
!= 0407 && x
.a_magic
!= 0413 && x
.a_magic
!= 0410))
if ((x
.a_magic
== 0413 || x
.a_magic
== 0410) &&
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
++)
(*((int (*)()) x
.a_entry
))();