File:  [Research Unix] / researchv9 / sys / boot / stand / bootxx.c
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:31:11 2018 UTC (8 years, 3 months ago) by root
Branches: belllabs, MAIN
CVS tags: researchv9-SUN3, HEAD
researchv9-SUN3

#include <machine/sunromvec.h>

/* Dummy device table to satisfy external references */
struct boottab *(devsw[]) = {(struct boottab *)0, };

int (*readfile()) ();

/*
 * Reads in the "real" boot program and jumps
 * to it.  If this attempt fails, prints "boot failed" and returns to its
 * caller.
 */
main()
{
	register struct bootparam *bp;
	register char *s, c;
	register int io;
	int (*addr)();

	extern struct boottab *(devsw[]);

	if (romp->v_bootparam == 0)
		bp = (struct bootparam *)0x2000;	/* Old Sun-1 address */
	else
		bp = *(romp->v_bootparam);		/* S-2: via romvec */

	/* If we were linked with a driver, use it in preference to PROM */
	if (*devsw)
		bp->bp_boottab = *devsw;

	s = bp->bp_argv[0];
	while (*s && *s != ')') s++;

	c = *s; *s = '\0';
	printf("Load: %s)boot\n", bp->bp_argv[0]);
	*s = c;

	io = physopen(bp, "boot", 0);

	if (io >= 0) {
		addr = readfile(io, 0);		/* Read silently */
		if ((int)addr != -1)
			_exitto(addr);
	}
	printf("boot failed\n");
	return;
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.