* 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.
* @(#)bootxx.c 7.4 (Berkeley) %G%
char bootprog
[] = "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 */
howto
= 0; devtype
= 0; devtype
= devtype
;
printf("loading %s\n", bootprog
);
copyunix(howto
, opendev
, io
);
copyunix(howto
, devtype
, io
)
register howto
, devtype
, io
; /* howto=r11, devtype=r10 */
i
= read(io
, (char *)&x
, sizeof x
);
if (i
!= sizeof x
|| N_BADMAG(x
))
if ((x
.a_magic
== ZMAGIC
|| x
.a_magic
== NMAGIC
) &&
lseek(io
, 0x400, L_SET
) == -1)
if (read(io
, (char *)0, x
.a_text
) != x
.a_text
)
if (x
.a_magic
== ZMAGIC
|| x
.a_magic
== NMAGIC
)
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
))();