debug_init();
boot(bootdev)	dev_t	bootdev;{	register char *bootfile = kernels[0];	register struct cmd_state *cmd;	register int i;#ifdef DEBUG	*(u_int16_t*)0xb8148 = 0x4730;#endif	gateA20(1);#ifndef _TEST	memprobe();#endif#ifdef DEBUG	*(u_int16_t*)0xb8148 = 0x4f31;#endif	cons_probe();	printf("\n>> OpenBSD BOOT: %u/%u k [%s]\n", cnvmem, extmem, version);	/* XXX init cmd here to cut on .data !!! */	cmd = (struct cmd_state *)alloc(sizeof(*cmd));	devboot(bootdev, cmd->bootdev);	cmd->image[0] = '\0';	cmd->cwd[0] = '/';	cmd->cwd[1] = '\0';	cmd->addr = (void *)0x100000;	cmd->timeout = 50;	for (i = 0;;) {		strncpy(cmd->image, bootfile, sizeof(cmd->image));		do {			printf("boot> ");		} while(!getcmd(cmd) && !execmd(cmd));		if (cmd->rc < 0)			break;		printf("\nbooting %s: ", cmd->path);		exec (cmd->path, cmd->addr, boothowto);		if(kernels[++i] == NULL)			bootfile = kernels[i=0];		else			bootfile = kernels[i];		cmd->timeout += 20;		printf(" failed(%d)\nwill try %s\n", errno, bootfile);	}}